Browse Source

Pull request #5: Bugfix/10.0

Merge in ~NEIL/design from bugfix/10.0 to release/10.0

* commit '3cc42b6641b259fa8076e0bbc54cf7ef1d8bc05c':
  REPORT-32997 模板列宽修改但是值不变出现了缩进 转专人服务-Cafu
  REPORT-32520 修改代码规范
  REPORT-32520 修改代码规范
  REPORT-32520 修改页面设置超过2000后预览不能正常显示宽和高的bug
  REPORT-33944 改为常量
  REPORT-33944 大于允许的精度之外才是大于
  REPORT-33944 页边距为0,设计器虚线和实际有1的误差
  CHART-14399 坐标轴切换类型时,保留网格线类型和颜色	同步到final
  REPORT-34222 报表设计器给容器插件开个复制粘贴的接口 同步到final
  REPORT-34127 筛选条件,改了后面单元格条件之后,前面单元格自动跟着修改了
  REPORT-33018  fix 沿用之前的方案逻辑 防止产生假保存
  REPORT-32939 add comment
  REPORT-32939 设计器正常2g目前经常出现排队现象
  拼写错误
  MOBILE-27220 在表单移动端属性加一个“默认”和“自定义样式”开关
feature/big-screen
neil 4 years ago
parent
commit
f287cb9c94
  1. 11
      designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java
  2. 35
      designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java
  3. 4
      designer-realize/src/main/java/com/fr/grid/GridUI.java
  4. 6
      designer-realize/src/main/java/com/fr/grid/IntelliElements.java

11
designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java

@ -13,6 +13,7 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.fun.ReportLengthUNITProvider; import com.fr.design.fun.ReportLengthUNITProvider;
import com.fr.design.unit.UnitConvertUtil; import com.fr.design.unit.UnitConvertUtil;
import com.fr.general.ComparatorUtils;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.report.elementcase.ElementCase; import com.fr.report.elementcase.ElementCase;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
@ -39,8 +40,8 @@ public abstract class ColumnRowSizingAction extends AbstractColumnRowIndexAction
return ColumnRowSizingAction.this.title4UnitInputPane(); return ColumnRowSizingAction.this.title4UnitInputPane();
} }
}; };
UNIT len = getShowLen(report, cs); final UNIT oldLen = getShowLen(report, cs);
populateNumberDialog(uPane, len); populateNumberDialog(uPane, oldLen);
final CellSelection finalCS = cs; final CellSelection finalCS = cs;
uPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { uPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@ -51,8 +52,10 @@ public abstract class ColumnRowSizingAction extends AbstractColumnRowIndexAction
float newHeight = (float) uPane.update(); float newHeight = (float) uPane.update();
int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit(); int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit();
ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType); ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType);
UNIT len = lengthUNIT.float2UNIT(newHeight); UNIT newLen = lengthUNIT.float2UNIT(newHeight);
updateAction(report, len, finalCS); if (!ComparatorUtils.equals(oldLen, newLen)) {
updateAction(report, newLen, finalCS);
}
} catch (ValueNotChangeException e) { } catch (ValueNotChangeException e) {
// nothing // nothing
} }

35
designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java

@ -19,25 +19,20 @@ import java.awt.event.FocusEvent;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import javax.swing.BorderFactory; import javax.swing.*;
import javax.swing.Box;
import javax.swing.ButtonGroup;
import javax.swing.Icon;
import com.fr.design.gui.ispinner.ColumnRowSpinner;
import com.fr.page.PaperSettingProvider; import com.fr.page.PaperSettingProvider;
import com.fr.page.ReportSettingsProvider; import com.fr.page.ReportSettingsProvider;
import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import javax.swing.text.NumberFormatter;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.Margin; import com.fr.base.Margin;
@ -72,6 +67,7 @@ public class PageSetupPane extends BasicPane {
private PagePane pagePane; private PagePane pagePane;
private OtherPane otherPane; private OtherPane otherPane;
private UILabel zeroMarginWarn; private UILabel zeroMarginWarn;
private static final String E = "E";
public PageSetupPane() { public PageSetupPane() {
this.initComponents(); this.initComponents();
@ -212,6 +208,13 @@ public class PageSetupPane extends BasicPane {
((JSpinner.DefaultEditor) paperWidthSpinner.getEditor()).getTextField().setColumns(7); ((JSpinner.DefaultEditor) paperWidthSpinner.getEditor()).getTextField().setColumns(7);
paperHeightSpinner = new UIBasicSpinner(new SpinnerNumberModel(0.0, 0.0, Double.MAX_VALUE, 1.0)); paperHeightSpinner = new UIBasicSpinner(new SpinnerNumberModel(0.0, 0.0, Double.MAX_VALUE, 1.0));
((JSpinner.DefaultEditor) paperHeightSpinner.getEditor()).getTextField().setColumns(7); ((JSpinner.DefaultEditor) paperHeightSpinner.getEditor()).getTextField().setColumns(7);
JFormattedTextField txt = ((JSpinner.NumberEditor) paperWidthSpinner.getEditor()).getTextField();
((NumberFormatter) txt.getFormatter()).setAllowsInvalid(false);
txt = ((JSpinner.NumberEditor) paperHeightSpinner.getEditor()).getTextField();
((NumberFormatter) txt.getFormatter()).setAllowsInvalid(false);
unitLabel = new UnitFieldPane.UnitLabel(Constants.UNIT_MM, paperHeightSpinner.getPreferredSize().height); unitLabel = new UnitFieldPane.UnitLabel(Constants.UNIT_MM, paperHeightSpinner.getPreferredSize().height);
String[] inch = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_MM"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_INCH")}; String[] inch = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_MM"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_INCH")};
@ -738,8 +741,8 @@ public class PageSetupPane extends BasicPane {
return; return;
} }
// 最大2000,以免画的时候超边 // 最大2000,以免画的时候超边
this.paper_width = Math.min(paper_width, 2000); this.paper_width = Math.min(paper_width, Double.MAX_VALUE);
this.paper_height = Math.min(paper_height, 2000); this.paper_height = Math.min(paper_height, Double.MAX_VALUE);
this.paper_orientation = paper_orientation; this.paper_orientation = paper_orientation;
length_scale = !useLocale ? NUM_3 : NUM_POINT_3; length_scale = !useLocale ? NUM_3 : NUM_POINT_3;
} }
@ -766,18 +769,24 @@ public class PageSetupPane extends BasicPane {
FontMetrics fm = g2d.getFontMetrics(); FontMetrics fm = g2d.getFontMetrics();
// 横向的长度 // 横向的长度
String w_str = "" + paper_width; String w_str = "" + paper_width;
if (w_str.indexOf(CoreConstants.DOT) > 0) { if (!w_str.contains(E) && w_str.indexOf(CoreConstants.DOT) > 0) {
w_str = w_str.substring(0, w_str.indexOf(CoreConstants.DOT) + 2); w_str = w_str.substring(0, w_str.indexOf(CoreConstants.DOT) + 2);
} }
int w_length = fm.stringWidth(w_str); int w_length = fm.stringWidth(w_str);
paint_width = Math.max(paint_width, w_length + 26); paint_width = Math.max(paint_width, w_length + 26);
// 纵向的长度 // 纵向的长度
String h_str = "" + paper_height; String h_str = "" + paper_height;
if (h_str.indexOf(".") > 0) { //使用科学计数法显示长度的时候,限制纵向显示长度为9位
h_str = h_str.substring(0, h_str.indexOf(".") + 2); if (h_str.contains(E)) {
String str1 = h_str.substring(h_str.indexOf(E));
String str2 = h_str.substring(0, 9 - str1.length());
h_str = str2 + str1;
} else if (h_str.indexOf(CoreConstants.DOT) > 0) {
h_str = h_str.substring(0, h_str.indexOf(CoreConstants.DOT) + 2);
} }
int h_length = fm.stringWidth(h_str); int h_length = fm.stringWidth(h_str);
paint_height = Math.max(paint_height, h_length + 26); paint_height = Math.max(paint_height, h_length + 26);
paint_height = Math.min(paint_height, 74);
double startX = (pane_width - paint_width) / 2; double startX = (pane_width - paint_width) / 2;
double startY = (pane_height - paint_height) / 2; double startY = (pane_height - paint_height) / 2;
g2d.translate(startX, startY); g2d.translate(startX, startY);

4
designer-realize/src/main/java/com/fr/grid/GridUI.java

@ -300,6 +300,8 @@ public class GridUI extends ComponentUI {
private int resolution; private int resolution;
private static final double THRESHOLD = 1.0E-4D;
DrawLineHelper(int startIndex, int endIndex, boolean showGridLine, DrawLineHelper(int startIndex, int endIndex, boolean showGridLine,
boolean showPaginateLine, DynamicUnitList sizeList, double paperPaintSize, boolean showPaginateLine, DynamicUnitList sizeList, double paperPaintSize,
List paginateLineList, int resolution) { List paginateLineList, int resolution) {
@ -342,7 +344,7 @@ public class GridUI extends ComponentUI {
} }
// paint paper margin line. // paint paper margin line.
if (showPaginateLine && paperSumSize >= paperPaintSize) { if (showPaginateLine && paperSumSize - paperPaintSize > THRESHOLD) {
paginateLineList.add(getPaginateLine2D((int) sumSize)); paginateLineList.add(getPaginateLine2D((int) sumSize));
paperSumSize = tmpSize; paperSumSize = tmpSize;
} }

6
designer-realize/src/main/java/com/fr/grid/IntelliElements.java

@ -194,8 +194,12 @@ public class IntelliElements {
TemplateCellElement newCellElement = new DefaultTemplateCellElement(colIndex, rowIndex); TemplateCellElement newCellElement = new DefaultTemplateCellElement(colIndex, rowIndex);
applyStyle(newCellElement, sourceCellElement);//style applyStyle(newCellElement, sourceCellElement);//style
if (sourceCellElement.getValue() instanceof DSColumn) { if (sourceCellElement.getValue() instanceof DSColumn) {
DSColumn dsColumn = (DSColumn) sourceCellElement.getValue(); try{
DSColumn dsColumn = (DSColumn)((DSColumn) sourceCellElement.getValue()).clone();
newCellElement.setValue(dsColumn); newCellElement.setValue(dsColumn);
}catch (CloneNotSupportedException e){
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
newCellElement.setCellExpandAttr(sourceCellElement.getCellExpandAttr()); newCellElement.setCellExpandAttr(sourceCellElement.getCellExpandAttr());
} else if (sourceCellElement.getValue() instanceof Number) { } else if (sourceCellElement.getValue() instanceof Number) {
newCellElement.setValue(processNumber((Number) sourceCellElement.getValue())); newCellElement.setValue(processNumber((Number) sourceCellElement.getValue()));

Loading…
Cancel
Save