Browse Source

Merge branch 'release/10.0' of https://code.fineres.com/scm/~qinghui.liu/design into release/10.0

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
429f63df6c
  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. 7
      designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java
  5. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java
  6. 16
      designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanchartDataSheetNoCheckPane.java
  7. 16
      designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java
  8. 2
      designer-form/src/main/java/com/fr/design/mainframe/FormArea.java
  9. 11
      designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java
  10. 8
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java
  11. 26
      designer-realize/src/main/java/com/fr/start/MainDesigner.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());
}
}

7
designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java

@ -6,9 +6,7 @@ import com.fr.design.actions.core.ActionFactory;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.mainframe.ChartPropertyPane;
import com.fr.design.module.ChartEmptyDataStyleAction;
import com.fr.design.module.ChartHyperlinkGroup;
import com.fr.design.module.ChartPreStyleAction;
import com.fr.design.module.DesignModuleFactory;
import com.fr.form.ui.ChartEditor;
import com.fr.locale.InterMutableKey;
@ -20,7 +18,6 @@ import com.fr.plugin.chart.vanchart.export.ImagePainter;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import com.fr.van.chart.DownloadOnlineSourcesHelper;
import com.fr.van.chart.map.server.ChartMapEditorAction;
/**
* Created by juhaoyu on 2018/6/27.
@ -43,10 +40,6 @@ public class ChartDesignerActivator extends Activator implements Prepare {
DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class);
ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction());
ActionFactory.registerChartEmptyDataStyleAction(new ChartEmptyDataStyleAction());
ActionFactory.registerChartMapEditorAction(new ChartMapEditorAction());
ActionFactory.registerChartCollection(ChartCollection.class);
DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption());

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-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanchartDataSheetNoCheckPane.java

@ -1,10 +1,12 @@
package com.fr.van.chart.designer.style.datasheet;
import com.fr.chart.chartglyph.DataSheet;
import com.fr.design.gui.iscrollbar.UIScrollBar;
import com.fr.plugin.chart.base.AttrDataSheet;
import javax.swing.JPanel;
import java.awt.Component;
import java.awt.Container;
/**
* Created by mengao on 2017/5/24.
@ -19,6 +21,20 @@ public class VanchartDataSheetNoCheckPane extends VanChartDataSheetPane {
return components;
}
@Override
protected void layoutContentPane() {
leftcontentPane = createContentPane();
this.add(leftcontentPane);
}
@Override
protected void setLeftContentPaneBounds(Container parent, UIScrollBar scrollBar, int beginY, int maxheight) {
int width = parent.getWidth();
int height = parent.getHeight();
scrollBar.setBounds(0, 0, 0, 0);
leftcontentPane.setBounds(0, 0, width, height);
}
public void populate(AttrDataSheet attrDataSheet) {
populate(attrDataSheet.getDataSheet());
}

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);

26
designer-realize/src/main/java/com/fr/start/MainDesigner.java

@ -3,7 +3,6 @@ package com.fr.start;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.file.WebPreviewUtils;
import com.fr.design.actions.file.newReport.NewPolyReportAction;
import com.fr.design.actions.file.newReport.NewWorkBookAction;
@ -34,6 +33,8 @@ import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ShortCut;
import com.fr.design.module.ChartEmptyDataStyleAction;
import com.fr.design.module.ChartPreStyleAction;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.utils.concurrent.ThreadFactoryBuilder;
import com.fr.design.utils.gui.GUICoreUtils;
@ -54,23 +55,24 @@ import com.fr.stable.xml.XMLTools;
import com.fr.start.module.StartupArgs;
import com.fr.start.server.ServerTray;
import com.fr.third.org.apache.commons.lang3.time.StopWatch;
import com.fr.van.chart.map.server.ChartMapEditorAction;
import com.fr.workspace.WorkContext;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.border.MatteBorder;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.util.ArrayList;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class MainDesigner extends BaseDesigner {
@ -160,15 +162,7 @@ public class MainDesigner extends BaseDesigner {
if (WorkContext.getCurrent().isRoot()) {
menuDef.addShortCut(new ServerConfigManagerAction(), new StyleListAction(), new WidgetManagerAction());
if (ActionFactory.getChartPreStyleAction() != null) {
menuDef.addShortCut(ActionFactory.getChartPreStyleAction());
}
if (ActionFactory.getChartEmptyDataStyleAction() != null) {
menuDef.addShortCut(ActionFactory.getChartEmptyDataStyleAction());
}
if (ActionFactory.getChartMapEditorAction() != null) {
menuDef.addShortCut(ActionFactory.getChartMapEditorAction());
}
menuDef.addShortCut(new ChartPreStyleAction(), new ChartEmptyDataStyleAction(),new ChartMapEditorAction());
}
insertMenu(menuDef, MenuHandler.SERVER);

Loading…
Cancel
Save