diff --git a/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java b/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java index 781c57b052..6ca4ed6808 100644 --- a/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java +++ b/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java @@ -15,8 +15,9 @@ import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JScrollPane; import java.awt.Dimension; -import java.util.HashMap; import java.util.Iterator; +import java.util.Map; +import java.util.LinkedHashMap; @Open public abstract class ConditionAttributesPane extends BasicBeanPane { @@ -27,7 +28,7 @@ public abstract class ConditionAttributesPane extends BasicBeanPane { protected LiteConditionPane liteConditionPane; - protected java.util.Map classPaneMap = new HashMap(); + protected Map classPaneMap = new LinkedHashMap<>(); //可用的Actions. protected java.util.List useAbleActionList = new java.util.ArrayList(); @@ -70,7 +71,7 @@ public abstract class ConditionAttributesPane extends BasicBeanPane { selectedItemScrollPane.setMinimumSize(new Dimension((int) selectedItemScrollPane.getPreferredSize().getWidth(), MIN_HEIGHT)); propertyChangePane.add(selectedItemScrollPane); } - + public void updateBean(T ob) { updateMenuDef(); } diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java b/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java index 146085e3da..36cabec6bb 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java @@ -16,7 +16,7 @@ import javax.swing.text.Document; **/ public class FormulaTextField extends DictionaryTextField { - private static final BaseFormula EMPTY_FORMULA = BaseFormula.createFormulaBuilder().build("="); + private static final String EMPTY_STRING = "="; public FormulaTextField() { } @@ -43,7 +43,15 @@ public class FormulaTextField extends DictionaryTextField { if (this.value == null) { this.value = createDefault(); } - return this.value; + //保持联动 + linkValueByText(); + return value; + } + + private void linkValueByText() { + + String content = getText(); + this.value.setContent(content); } /** @@ -54,11 +62,28 @@ public class FormulaTextField extends DictionaryTextField { @Override public void setValue(BaseFormula value) { + if (value == null) { + value = createDefault(); + } this.value = value; - if (this.value == null) { - this.value = createDefault(); + } + + /** + * 是需要设置不带 = 号,还是带 = 号。 + * + * @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(this.value.getPureContent()); + setText(content); } private BaseFormula createDefault() { @@ -67,7 +92,8 @@ public class FormulaTextField extends DictionaryTextField { if (StringUtils.isNotEmpty(text)) { return BaseFormula.createFormulaBuilder().build(text); } else { - return EMPTY_FORMULA; + //防止默认值被修改, 每一次创建都是不一样的。 + return BaseFormula.createFormulaBuilder().build(EMPTY_STRING); } } } diff --git a/designer-base/src/main/java/com/fr/design/formula/SortFormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/SortFormulaPane.java index 4d598a7e25..7b6e536fc2 100644 --- a/designer-base/src/main/java/com/fr/design/formula/SortFormulaPane.java +++ b/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); diff --git a/designer-base/src/test/java/com/fr/design/formula/FormulaTextFieldTest.java b/designer-base/src/test/java/com/fr/design/formula/FormulaTextFieldTest.java new file mode 100644 index 0000000000..8c58f6023d --- /dev/null +++ b/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()); + } + +} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java index 098b965d06..0cd81f783e 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java +++ b/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()); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java index 8511430b34..889e6f5302 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java @@ -99,13 +99,13 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane { this.parent = parent; } + public VanChartPlotTooltipPane getPlotTooltipPane() { + return tooltipPane; + } + @Override protected JPanel createContentPane() { JPanel contentPane = new JPanel(new BorderLayout()); @@ -48,7 +53,10 @@ public class VanChartTooltipPane extends AbstractVanChartScrollPane { parent.initAllListeners(); } - Plot plot = this.chart.getPlot(); + populateTooltipPane(this.chart.getPlot()); + } + + public void populateTooltipPane(Plot plot) { DataSeriesCondition attr = ((VanChartPlot)plot).getAttrTooltipFromConditionCollection(); if(tooltipPane != null) { tooltipPane.populate((AttrTooltip)attr); @@ -74,7 +82,7 @@ public class VanChartTooltipPane extends AbstractVanChartScrollPane { @Override public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Tooltip"); + return Toolkit.i18nText("Fine-Design_Chart_Tooltip"); } protected VanChartPlotTooltipPane getTooltipPane(Plot plot) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 0f3af7537a..d8234c2b1d 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -79,6 +79,9 @@ public class EditingMouseListener extends MouseInputAdapter { //备份开始拖动的位置和大小 private Rectangle dragBackupBounds; + private int pressX; + private int pressY; + /** * 获取最小移动距离 * @@ -141,6 +144,8 @@ public class EditingMouseListener extends MouseInputAdapter { public void mousePressed(MouseEvent e) { int oldX = e.getX(); int oldY = e.getY(); + pressX = oldX; + pressY = oldY; offsetEventPoint(e); if (!stopEditing()) { return; @@ -189,6 +194,7 @@ public class EditingMouseListener extends MouseInputAdapter { * @param e 鼠标事件 */ public void mouseReleased(MouseEvent e) { + MouseEvent transEvent = new MouseEvent(e.getComponent(), MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton()); int oldX = e.getX(); int oldY = e.getY(); offsetEventPoint(e); @@ -213,6 +219,12 @@ public class EditingMouseListener extends MouseInputAdapter { lastPressEvent = null; lastXCreator = null; e.translatePoint(oldX - e.getX(), oldY - e.getY()); + if (pressX != oldX || pressY != oldY) { + // click只有在mouseReleased和mousePressed前后x/y坐标相等时才会被触发在mouseReleased之后 + // 但是当使用者来回点击切换时 存在mouseReleased和mousePressed前后x/y坐标不相等的情况 即鼠标按下去的位置和鼠标释放的位置不相等 存在偏移 + // 当这种偏移很小时 看起来就好像是点击了 实际上是手抖了或者鼠标轻微滑动了 所以这里对这种情况要有容错处理 + mouseClicked(transEvent); + } } private void mouseDraggingRelease(MouseEvent e) { @@ -327,8 +339,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 +354,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 +370,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 +438,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)); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index 967cabd06f..f127f8ea0d 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/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(); diff --git a/designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java b/designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java index e3d5f46e4e..ddab3a305e 100644 --- a/designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java +++ b/designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java @@ -1,5 +1,6 @@ package com.fr.design.parameter; +import com.fr.base.Parameter; import com.fr.design.constants.UIConstants; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XWParameterLayout; @@ -124,7 +125,8 @@ public class ParameterPropertyPane extends JPanel{ hideInJForm = jt instanceof JForm && !(creator instanceof XWParameterLayout || creator.getParent() instanceof XWParameterLayout); } catch (NullPointerException ex) { - hideInJForm = toolbarPane.updateBean().length <= 0; + Parameter[] parameters = toolbarPane.updateBean(); + hideInJForm = parameters == null || parameters.length <= 0; } if (isVisible && toolbarPane.hasSelectedLabelItem() && !hideInJForm) { addParaPane.setVisible(true); diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java index 07eefdd2bd..b1273ce58d 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java +++ b/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) { @@ -410,10 +410,10 @@ public class DSColumnAdvancedPane extends BasicPane { private static class JFormulaField extends JPanel { private CellElement cellElement; private FormulaTextField formulaTextField; - private BaseFormula defaultFormula; + private String defaultValue; public JFormulaField(String defaultValue) { - this.defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue); + this.defaultValue = defaultValue; this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); UILabel bottomLabel = new UILabel("="); @@ -421,7 +421,8 @@ public class DSColumnAdvancedPane extends BasicPane { this.add(bottomLabel); formulaTextField = new FormulaTextField(24); this.add(formulaTextField); - formulaTextField.setValue(defaultFormula); + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(this.defaultValue); + formulaTextField.setValueAndText(defaultFormula, true); UIButton bottomFrmulaButton = new UIButton("..."); this.add(bottomFrmulaButton); @@ -444,8 +445,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 +481,10 @@ public class DSColumnAdvancedPane extends BasicPane { public void doOk() { BaseFormula valueFormula = formulaPane.update(); if (valueFormula.getContent().length() <= 1) { - formulaTextField.setValue(defaultFormula); + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue); + formulaTextField.setValueAndText(defaultFormula, true); } else { - formulaTextField.setValue(valueFormula); + formulaTextField.setValueAndText(valueFormula, true); } } }).setVisible(true); diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index 983fbb9da7..248a274f57 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -646,7 +646,6 @@ public class CellDSColumnEditor extends CellQuickEditor { */ public class ResultSetSortConfigPane extends JPanel { private static final String DEFAULT_VALUE = "="; - private final BaseFormula DEFAULT_FORMULA = BaseFormula.createFormulaBuilder().build(); private JPanel contentPane; private UIButtonGroup sortTypePane; private JFormulaField formulaField; @@ -723,7 +722,8 @@ public class CellDSColumnEditor extends CellQuickEditor { } BaseFormula baseFormula = dSColumn.getSortFormulaObject(); if (baseFormula == null) { - this.formulaField.populateFormula(DEFAULT_FORMULA); + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(); + this.formulaField.populateFormula(defaultFormula); } else { this.formulaField.populateFormula(baseFormula); } @@ -1064,13 +1064,14 @@ public class CellDSColumnEditor extends CellQuickEditor { public class JFormulaField extends JPanel { private CellElement cellElement; private FormulaTextField formulaTextField; - private BaseFormula defaultFormula; + private String defaultValue; public JFormulaField(String defaultValue) { - - this.defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue); + + this.defaultValue = defaultValue; + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(this.defaultValue); formulaTextField = new FormulaTextField(); - formulaTextField.setValue(defaultFormula); + formulaTextField.setValueAndText(defaultFormula, false); JPanel textFieldPane = new JPanel(new BorderLayout()); textFieldPane.add(formulaTextField, BorderLayout.CENTER); @@ -1101,7 +1102,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 +1146,10 @@ public class CellDSColumnEditor extends CellQuickEditor { public void doOk() { BaseFormula valueFormula = formulaPane.update(); if (valueFormula.getContent().length() <= 1) { - formulaTextField.setValue(defaultFormula); + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue); + formulaTextField.setValueAndText(defaultFormula, false); } else { - formulaTextField.setValue(valueFormula); + formulaTextField.setValueAndText(valueFormula, false); } } }).setVisible(true); @@ -1164,8 +1166,7 @@ public class CellDSColumnEditor extends CellQuickEditor { */ public class CustomValuePane extends JPanel { private static final String DEFAULT_VALUE = "=$$$"; - private final BaseFormula DEFAULT_FORMULA = BaseFormula.createFormulaBuilder().build(DEFAULT_VALUE); - + private JFormulaField formulaField; public CustomValuePane() { @@ -1188,7 +1189,8 @@ public class CellDSColumnEditor extends CellQuickEditor { if (valueFormula != null) { formulaField.populateFormula(valueFormula); } else { - formulaField.populateFormula(DEFAULT_FORMULA); + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(DEFAULT_VALUE); + formulaField.populateFormula(defaultFormula); } formulaField.populateElement(cellElement); @@ -1201,7 +1203,7 @@ public class CellDSColumnEditor extends CellQuickEditor { Object value = cellElement.getValue(); if (value instanceof DSColumn) { DSColumn dSColumn = (DSColumn) (cellElement.getValue()); - dSColumn.setResultObject(this.formulaField.getFormula()); + dSColumn.setResultObject(StringUtils.isEmpty(this.formulaField.getFormulaText()) ? null : this.formulaField.getFormula()); } } } diff --git a/designer-realize/src/main/java/com/fr/start/MainDesigner.java b/designer-realize/src/main/java/com/fr/start/MainDesigner.java index 0020514f2d..ff3aadd36b 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/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);