Browse Source

Merge pull request #2096 in DESIGN/design from bugfix/10.0 to feature/10.0

* commit '89b64b3d54e2ce31922a2ce7334a42b267be30ab':
  CHART-15112 时间轴英文环境少单位
  REPORT-37460 && REPORT-37526 【frm设计界面支持缩放】模板放大后,点击报表块编辑,双击才能生效,缩小模板100%,单击就可以
  REPORT-37487 && REPORT-37484 1、回复 result 默认为 $$$ 。 2、和产品沟通,将两个面板分别默认展示 = 和不展示 = 3、恢复数据的联动
persist/11.0
superman 4 years ago
parent
commit
b224b4c5f9
  1. 33
      designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java
  2. 2
      designer-base/src/main/java/com/fr/design/formula/SortFormulaPane.java
  3. 28
      designer-base/src/test/java/com/fr/design/formula/FormulaTextFieldTest.java
  4. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java
  5. 16
      designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java
  6. 2
      designer-form/src/main/java/com/fr/design/mainframe/FormArea.java
  7. 11
      designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java
  8. 8
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

33
designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java

@ -16,7 +16,9 @@ import javax.swing.text.Document;
**/
public class FormulaTextField extends DictionaryTextField<BaseFormula> {
private static final BaseFormula EMPTY_FORMULA = BaseFormula.createFormulaBuilder().build("=");
private static final String EMPTY_STRING = "=";
private static final BaseFormula EMPTY_FORMULA = BaseFormula.createFormulaBuilder().build(EMPTY_STRING);
public FormulaTextField() {
}
@ -43,7 +45,15 @@ public class FormulaTextField extends DictionaryTextField<BaseFormula> {
if (this.value == null) {
this.value = createDefault();
}
return this.value;
//保持联动
linkValueByText();
return value;
}
private void linkValueByText() {
String content = getText();
this.value.setContent(content);
}
/**
@ -58,7 +68,24 @@ public class FormulaTextField extends DictionaryTextField<BaseFormula> {
if (this.value == null) {
this.value = createDefault();
}
setText(this.value.getPureContent());
}
/**
* 是需要设置不带 = 还是带 =
*
* @param value
* @param isPure 带不带 = , = 不带 =
*/
public void setValueAndText(BaseFormula value, boolean isPure) {
setValue(value);
String content = null;
if (isPure) {
content = this.value.getPureContent();
} else {
content = this.value.getContent();
}
setText(content);
}
private BaseFormula createDefault() {

2
designer-base/src/main/java/com/fr/design/formula/SortFormulaPane.java

@ -64,7 +64,7 @@ public abstract class SortFormulaPane extends JPanel {
public void doOk() {
BaseFormula fm = formulaPane.update();
if (fm != null) {
sortFormulaTextField.setValue(fm);
sortFormulaTextField.setValueAndText(fm, true);
}
}
}).setVisible(true);

28
designer-base/src/test/java/com/fr/design/formula/FormulaTextFieldTest.java

@ -0,0 +1,28 @@
package com.fr.design.formula;
import com.fr.base.BaseFormula;
import org.junit.Assert;
import org.junit.Test;
import static org.junit.Assert.*;
public class FormulaTextFieldTest {
@Test
public void testSet() {
FormulaTextField field = new FormulaTextField();
BaseFormula aaaa = BaseFormula.createFormulaBuilder().build("aaaa");
field.setValueAndText(aaaa, true);
Assert.assertEquals("aaaa", field.getText());
field.setValueAndText(aaaa, false);
Assert.assertEquals("=aaaa", field.getText());
field.setText("bbbb");
BaseFormula formula = field.getValue();
Assert.assertEquals("bbbb", formula.getPureContent());
}
}

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java

@ -162,8 +162,8 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
JPanel mainTickPane = new JPanel();
mainTickPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
mainUnitField.setPreferredSize(new Dimension(100,20));
secondUnitField.setPreferredSize(new Dimension(100,20));
mainUnitField.setPreferredSize(new Dimension(80,20));
secondUnitField.setPreferredSize(new Dimension(80,20));
mainTickPane.add(mainUnitField);
mainTickPane.add(mainType);

16
designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java

@ -327,8 +327,8 @@ public class EditingMouseListener extends MouseInputAdapter {
if (designer.getCursor().getType() == Cursor.HAND_CURSOR) {
designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
} // component.getParent() 是报表块所在的XWTitleLayout
int minX = button.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue();
int minY = button.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue();
int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue();
int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue();
if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) {
if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) {
designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
@ -342,8 +342,8 @@ public class EditingMouseListener extends MouseInputAdapter {
if (component.getCoverPane() != null) {
if (component.getCoverPane().getComponentCount() > 1) {
JComponent button1 = (JComponent) component.getCoverPane().getComponent(1);
int minX1 = button1.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue();
int minY1 = button1.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue();
int minX1 = button1.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue();
int minY1 = button1.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue();
if (e.getX() + GAP - component.getInsets().left > minX1 && e.getX() - GAP - component.getInsets().left < minX1 + button1.getWidth()) {
if (e.getY() + GAP - component.getInsets().top > minY1 && e.getY() - GAP - component.getInsets().top < minY1 + button1.getHeight()) {
designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
@ -358,8 +358,8 @@ public class EditingMouseListener extends MouseInputAdapter {
if (StringUtils.isEmpty(component.toData().getDescription())) {
return;
}
int minX1 = getParentPositionX(component, component.getX()) + component.getWidth() - ShareConstants.SHARE_EL_CONTROL_BUTTON_HW - designer.getArea().getHorizontalValue();
int minY1 = getParentPositionY(component, component.getY()) - designer.getArea().getVerticalValue();
int minX1 = getParentPositionX(component, component.getX()) + component.getWidth() - ShareConstants.SHARE_EL_CONTROL_BUTTON_HW - designer.getHorizontalScaleValue();
int minY1 = getParentPositionY(component, component.getY()) - designer.getVerticalScaleValue();
if (e.getX() + GAP - component.getInsets().left > minX1 && e.getX() - GAP - component.getInsets().left < minX1 + ShareConstants.SHARE_EL_CONTROL_BUTTON_HW) {
if (e.getY() + GAP - component.getInsets().top > minY1 && e.getY() - GAP - component.getInsets().top < minY1 + ShareConstants.SHARE_EL_CONTROL_BUTTON_HW) {
designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
@ -426,8 +426,8 @@ public class EditingMouseListener extends MouseInputAdapter {
if (designer.getCursor().getType() == Cursor.HAND_CURSOR) {
designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
int minX = button.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue();
int minY = button.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue();
int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue();
int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue();
if (e.getX() + GAP > minX && e.getX() - GAP < minX + button.getWidth()) {
if (e.getY() + GAP > minY && e.getY() - GAP < minY + button.getHeight()) {
designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

2
designer-form/src/main/java/com/fr/design/mainframe/FormArea.java

@ -773,7 +773,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
heightPane.setValue(height);
reCalculateHeight((int) height);
}
if (designer.getRootComponent().acceptType(XWFitLayout.class) && AssistUtils.equals(slide, DEFAULT_SLIDER) ) {
if (designer.getRootComponent().acceptType(XWFitLayout.class) && AssistUtils.equals(screenValue, DEFAULT_SLIDER) ) {
XWFitLayout layout = (XWFitLayout) designer.getRootComponent();
// 撤销时先refreshRoot了,此处去掉内边距再增加间隔
layout.moveContainerMargin();

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

@ -257,7 +257,7 @@ public class DSColumnAdvancedPane extends BasicPane {
this.sortOrderComboBox.setSortOrder(new SortOrder(sort));
BaseFormula sortFormulaObject = dSColumn.getSortFormulaObject();
sortFormulaTextField.setValue(sortFormulaObject);
sortFormulaTextField.setValueAndText(sortFormulaObject, true);
}
public void update(CellElement cellElement) {
@ -421,7 +421,7 @@ public class DSColumnAdvancedPane extends BasicPane {
this.add(bottomLabel);
formulaTextField = new FormulaTextField(24);
this.add(formulaTextField);
formulaTextField.setValue(defaultFormula);
formulaTextField.setValueAndText(defaultFormula, true);
UIButton bottomFrmulaButton = new UIButton("...");
this.add(bottomFrmulaButton);
@ -444,8 +444,7 @@ public class DSColumnAdvancedPane extends BasicPane {
public void populateFormula(BaseFormula baseFormula) {
this.formulaTextField.setValue(baseFormula);
this.formulaTextField.setText(baseFormula.getPureContent());
this.formulaTextField.setValueAndText(baseFormula, true);
}
public BaseFormula getFormula() {
@ -481,9 +480,9 @@ public class DSColumnAdvancedPane extends BasicPane {
public void doOk() {
BaseFormula valueFormula = formulaPane.update();
if (valueFormula.getContent().length() <= 1) {
formulaTextField.setValue(defaultFormula);
formulaTextField.setValueAndText(defaultFormula, true);
} else {
formulaTextField.setValue(valueFormula);
formulaTextField.setValueAndText(valueFormula, true);
}
}
}).setVisible(true);

8
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -1070,7 +1070,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
this.defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue);
formulaTextField = new FormulaTextField();
formulaTextField.setValue(defaultFormula);
formulaTextField.setValueAndText(defaultFormula, false);
JPanel textFieldPane = new JPanel(new BorderLayout());
textFieldPane.add(formulaTextField, BorderLayout.CENTER);
@ -1101,7 +1101,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
public void populateFormula(BaseFormula baseFormula) {
this.formulaTextField.setValue(baseFormula);
this.formulaTextField.setValueAndText(baseFormula, false);
}
public BaseFormula getFormula() {
@ -1145,9 +1145,9 @@ public class CellDSColumnEditor extends CellQuickEditor {
public void doOk() {
BaseFormula valueFormula = formulaPane.update();
if (valueFormula.getContent().length() <= 1) {
formulaTextField.setValue(defaultFormula);
formulaTextField.setValueAndText(defaultFormula, false);
} else {
formulaTextField.setValue(valueFormula);
formulaTextField.setValueAndText(valueFormula, false);
}
}
}).setVisible(true);

Loading…
Cancel
Save