Browse Source

merge code

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
ccb6f6c890
  1. 4
      build.gradle
  2. 9
      designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java
  3. 18
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java
  4. 21
      designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java
  5. 16
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java
  6. 11
      designer-base/src/main/java/com/fr/design/mainframe/App.java
  7. 2
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  8. 2
      designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java
  9. 8
      designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java
  10. 10
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java
  11. 10
      designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java
  12. 9
      designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java
  13. 4
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  14. 1
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java
  15. 5
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  16. 4
      designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java
  17. 6
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java
  18. 3
      designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java
  19. 7
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java
  20. 8
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java
  21. 14
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java
  22. 6
      designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java
  23. 2
      designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java

4
build.gradle

@ -72,7 +72,9 @@ allprojects {
implementation 'com.fr.datasource:fine-datasource:' + frVersion implementation 'com.fr.datasource:fine-datasource:' + frVersion
implementation 'com.fr.decision:fine-decision:' + frVersion implementation 'com.fr.decision:fine-decision:' + frVersion
implementation 'com.fr.schedule:fine-schedule:' + frVersion implementation 'com.fr.schedule:fine-schedule:' + frVersion
implementation 'com.fr.report:fine-report-engine:' + frDevVersion implementation 'com.fr.report:engine-report:' + frDevVersion
implementation 'com.fr.report:engine-chart:' + frDevVersion
implementation 'com.fr.report:engine-i18n:' + frDevVersion
implementation 'com.fr.design:design-i18n:' + frDevVersion implementation 'com.fr.design:design-i18n:' + frDevVersion
testImplementation 'org.easymock:easymock:3.5.1' testImplementation 'org.easymock:easymock:3.5.1'
testImplementation 'org.powermock:powermock-module-junit4:1.7.1' testImplementation 'org.powermock:powermock-module-junit4:1.7.1'

9
designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java

@ -14,10 +14,10 @@ import javax.swing.BoxLayout;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import java.awt.Dimension;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map;
import java.awt.Dimension;
@Open @Open
public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> { public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
@ -69,7 +69,12 @@ public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
selectedItemScrollPane.setViewportView(selectedItemPane); selectedItemScrollPane.setViewportView(selectedItemPane);
selectedItemScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); selectedItemScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
selectedItemScrollPane.setMinimumSize(new Dimension((int) selectedItemScrollPane.getPreferredSize().getWidth(), MIN_HEIGHT)); selectedItemScrollPane.setMinimumSize(new Dimension((int) selectedItemScrollPane.getPreferredSize().getWidth(), MIN_HEIGHT));
dealScrollPane(selectedItemScrollPane);
propertyChangePane.add(selectedItemScrollPane); propertyChangePane.add(selectedItemScrollPane);
}
protected void dealScrollPane(JScrollPane scrollPane){
} }
public void updateBean(T ob) { public void updateBean(T ob) {

18
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java

@ -5,6 +5,7 @@ import com.fr.base.StoreProcedureParameter;
import com.fr.data.core.db.TableProcedure; import com.fr.data.core.db.TableProcedure;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
import com.fr.data.impl.NameDatabaseConnection; import com.fr.data.impl.NameDatabaseConnection;
import com.fr.data.impl.storeproc.ProcedureDataModel;
import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.data.operator.DataOperator; import com.fr.data.operator.DataOperator;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
@ -29,13 +30,19 @@ import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionConfig;
import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.BorderFactory;
import java.awt.*; import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.JToolBar;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
@ -273,7 +280,8 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
protected Void doInBackground() throws Exception { protected Void doInBackground() throws Exception {
DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER); DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER);
sp.setCalculating(true); sp.setCalculating(true);
sp.creatDataModel(Calculator.createCalculator()); ProcedureDataModel[] dataModels = DesignTableDataManager.createLazyDataModel(sp, false);
sp.refreshDataModelListAndResultNames(dataModels);
return null; return null;
} }

21
designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java vendored

@ -25,13 +25,19 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
private static final String HOST_NAME = "127.0.0.1"; private static final String HOST_NAME = "127.0.0.1";
private static final String LOCAL_HOTS_NAME = "localhost"; private static final String LOCAL_HOTS_NAME = "localhost";
private static final String QUOTATION = ":"; private static final String QUOTATION = ":";
private static final String PORT = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort()); private static String port = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort());
static { static {
FILTER_SET.add(HTTP + HOST_NAME + QUOTATION + PORT + PATH); initFilerSet(port);
FILTER_SET.add(HTTPS + HOST_NAME + QUOTATION + PORT + PATH); }
FILTER_SET.add(HTTP + LOCAL_HOTS_NAME + QUOTATION + PORT + PATH);
FILTER_SET.add(HTTPS + LOCAL_HOTS_NAME + QUOTATION + PORT + PATH); private static void initFilerSet(String newPort) {
FILTER_SET.clear();
FILTER_SET.add(HTTP + HOST_NAME + QUOTATION + newPort + PATH);
FILTER_SET.add(HTTPS + HOST_NAME + QUOTATION + newPort + PATH);
FILTER_SET.add(HTTP + LOCAL_HOTS_NAME + QUOTATION + newPort + PATH);
FILTER_SET.add(HTTPS + LOCAL_HOTS_NAME + QUOTATION + newPort + PATH);
port = newPort;
} }
private String name; private String name;
@ -164,6 +170,11 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
@Override @Override
public boolean checkValid() { public boolean checkValid() {
boolean result = false; boolean result = false;
String newPort = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort());
if (!ComparatorUtils.equals(port, newPort)) {
// 使用过程中 更改了内置服务器端口 重新初始化下
initFilerSet(newPort);
}
if (FILTER_SET.contains(connection.getUrl())) { if (FILTER_SET.contains(connection.getUrl())) {
FineLoggerFactory.getLogger().error("url is same with local designer"); FineLoggerFactory.getLogger().error("url is same with local designer");
return result; return result;

16
designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -45,6 +45,7 @@ public class UIResizableContainer extends JPanel {
private boolean isLeftRightDragEnabled = true; private boolean isLeftRightDragEnabled = true;
private boolean isDownPaneVisible = true ; private boolean isDownPaneVisible = true ;
private int paraHeight; private int paraHeight;
private int parentHeight = -1;
public UIResizableContainer(int direction) { public UIResizableContainer(int direction) {
this(new JPanel(), new JPanel(), direction); this(new JPanel(), new JPanel(), direction);
@ -207,7 +208,8 @@ public class UIResizableContainer extends JPanel {
if (verticalToolPane == null || downPane == null) { if (verticalToolPane == null || downPane == null) {
return; return;
} }
// REPORT-42913 如果用户修改了分辨率或者dpi,可能造成toolPaneY大于parent.getHeight,整个downPane将丢失,因此这里调整下toolPaneY
adjustToolPaneY(parent);
if (direction == Constants.RIGHT) { if (direction == Constants.RIGHT) {
if(isDownPaneVisible){ if(isDownPaneVisible){
upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY); upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY);
@ -236,6 +238,18 @@ public class UIResizableContainer extends JPanel {
} }
} }
private void adjustToolPaneY(Container parent) {
if (parentHeight == -1) {
// 初始化下parentheight,存一下当前的父容器height
parentHeight = parent.getHeight();
} else if (parentHeight != parent.getHeight()) {
// parentHeight与父容器height不等时,代表用户调整分辨率或者dpi了,此时调整toolPaneY
toolPaneY = toolPaneY * parent.getHeight() / parentHeight;
toolPaneY = Math.min(toolPaneY, (parent.getHeight() - toolPaneHeight));
parentHeight = parent.getHeight();
}
}
@Override @Override
public void addLayoutComponent(String name, Component comp) { public void addLayoutComponent(String name, Component comp) {
} }

11
designer-base/src/main/java/com/fr/design/mainframe/App.java

@ -41,4 +41,15 @@ public interface App<T extends BaseBook> extends Mutable, Aftermath {
* @return 报表 * @return 报表
*/ */
T asIOFile(FILE tplFile); T asIOFile(FILE tplFile);
/**
* 输出workbook等对象
* @param tplFile 文件
* @param needCheck 是否需要check
* @return
*/
default T asIOFile(FILE tplFile, boolean needCheck) {
return asIOFile(tplFile);
}
} }

2
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -136,9 +136,9 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
this.editingFILE = file; this.editingFILE = file;
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder()); this.setBorder(BorderFactory.createEmptyBorder());
designModel = createDesignModel();
addCenterPane(); addCenterPane();
this.undoState = createUndoState(); this.undoState = createUndoState();
designModel = createDesignModel();
consumeTimer.setEnabled(shouldInitForCollectInfo(isNewFile)); consumeTimer.setEnabled(shouldInitForCollectInfo(isNewFile));
initAndStartPlugin(); initAndStartPlugin();

2
designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java

@ -56,7 +56,7 @@ public final class JTemplateFactory {
String[] defaultAppExtensions = app.defaultExtensions(); String[] defaultAppExtensions = app.defaultExtensions();
for (String defaultAppExtension : defaultAppExtensions) { for (String defaultAppExtension : defaultAppExtensions) {
if (defaultAppExtension.equalsIgnoreCase(fileExtension)) { if (defaultAppExtension.equalsIgnoreCase(fileExtension)) {
BaseBook bb = app.asIOFile(file); BaseBook bb = app.asIOFile(file, false);
if (bb != null) { if (bb != null) {
return (T) bb; return (T) bb;
} }

8
designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java

@ -298,7 +298,11 @@ public final class GUICoreUtils {
* @param win the current window august:现在要考虑左边日志模板的影响 * @param win the current window august:现在要考虑左边日志模板的影响
*/ */
public static void centerWindow(Window win) { public static void centerWindow(Window win) {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // Toolkit.getDefaultToolkit().getScreenSize()在有多个显示器也只能获取到主屏的大小
// getGraphicsConfiguration().getBounds()能获取多个屏时 设计器主体界面所在屏的大小和对应的坐标
Rectangle rectangle = win.getGraphicsConfiguration().getBounds();
Dimension screenSize = rectangle.getSize();
Dimension winSize = win.getSize(); Dimension winSize = win.getSize();
@ -308,7 +312,7 @@ public final class GUICoreUtils {
if (winSize.width > screenSize.width) { if (winSize.width > screenSize.width) {
winSize.width = screenSize.width; winSize.width = screenSize.width;
} }
win.setLocation((screenSize.width - winSize.width) / 2, (screenSize.height - winSize.height) / 2 - WINDOW_GAP); win.setLocation(rectangle.x + (screenSize.width - winSize.width) / 2, rectangle.y + (screenSize.height - winSize.height) / 2 - WINDOW_GAP);
} }
/** /**

10
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java

@ -15,9 +15,10 @@ import com.fr.log.FineLoggerFactory;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane;
import java.util.Iterator;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension; import java.awt.Dimension;
import java.util.Iterator;
/** /**
* Created by IntelliJ IDEA. * Created by IntelliJ IDEA.
@ -27,6 +28,9 @@ import java.util.Iterator;
* Time : 上午9:16 * Time : 上午9:16
*/ */
public class DataSeriesConditionPane extends ConditionAttributesPane<ConditionAttr> { public class DataSeriesConditionPane extends ConditionAttributesPane<ConditionAttr> {
private static final int SCROLL_BAR_UNIT_INCREMENT = 16;
protected Plot plot; protected Plot plot;
public DataSeriesConditionPane(Plot plot) { public DataSeriesConditionPane(Plot plot) {
@ -43,6 +47,10 @@ public class DataSeriesConditionPane extends ConditionAttributesPane<ConditionAt
this(null); this(null);
} }
protected void dealScrollPane(JScrollPane scrollPane){
scrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_BAR_UNIT_INCREMENT);
}
private void initAvailableActionList() { private void initAvailableActionList() {
addBasicAction(); addBasicAction();
addAxisPositionAction(); addAxisPositionAction();

10
designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java

@ -2,6 +2,8 @@ package com.fr.extended.chart;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.general.GeneralUtils;
import com.fr.stable.StringUtils;
import java.util.List; import java.util.List;
@ -17,6 +19,11 @@ public class UIComboBoxWithNone extends UIComboBox {
public UIComboBoxWithNone() { public UIComboBoxWithNone() {
super(); super();
addDefaultItem(); addDefaultItem();
setDefaultSelectedItem();
}
protected void setDefaultSelectedItem() {
setSelectedItem(StringUtils.EMPTY);
} }
@Override @Override
@ -43,7 +50,8 @@ public class UIComboBoxWithNone extends UIComboBox {
//找不到的都选中无。中文的无 英文下是none。 //找不到的都选中无。中文的无 英文下是none。
//改正:找不到的且anObject不是null的 全部选中无。 //改正:找不到的且anObject不是null的 全部选中无。
if (getSelectedIndex() == -1 && anObject != null) { //改正:找不到的且anObject不是null的且anObject不是空字符串的 全部选中无。
if (getSelectedIndex() == -1 && StringUtils.isNotEmpty(GeneralUtils.objectToString(anObject))) {
super.setSelectedItem(getDefaultLocaleString()); super.setSelectedItem(getDefaultLocaleString());
} }
} }

9
designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java

@ -4,6 +4,7 @@ import com.fr.design.beans.location.Absorptionline;
import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.HoverPainter; import com.fr.design.designer.beans.HoverPainter;
import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRParameterLayoutAdapter;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.beans.location.Direction;
import com.fr.design.designer.beans.location.Location; import com.fr.design.designer.beans.location.Location;
@ -136,6 +137,14 @@ public class StateModel {
private boolean addBean(XLayoutContainer container, int mouseX, int mouseY) { private boolean addBean(XLayoutContainer container, int mouseX, int mouseY) {
LayoutAdapter adapter = container.getLayoutAdapter(); LayoutAdapter adapter = container.getLayoutAdapter();
Rectangle rectangleContainer = ComponentUtils.getRelativeBounds(container); Rectangle rectangleContainer = ComponentUtils.getRelativeBounds(container);
// 判断是否能把控件从表单布局中拖拽到参数面板中
if (adapter instanceof FRParameterLayoutAdapter) {
for (XCreator xCreator : selectionModel.getSelection().getSelectedCreators()) {
if (!xCreator.canEnterIntoParaPane()) {
return false;
}
}
}
if (selectionModel.getSelection().size() == 1) { if (selectionModel.getSelection().size() == 1) {
return adapter.addBean(selectionModel.getSelection().getSelectedCreator(), return adapter.addBean(selectionModel.getSelection().getSelectedCreator(),
mouseX + designer.getArea().getHorizontalValue() - rectangleContainer.x, mouseX + designer.getArea().getHorizontalValue() - rectangleContainer.x,

4
designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java

@ -14,6 +14,7 @@ import com.fr.design.gui.chart.MiddleChartComponent;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.BaseJForm; import com.fr.design.mainframe.BaseJForm;
import com.fr.design.mainframe.CoverReportPane; import com.fr.design.mainframe.CoverReportPane;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.EditingMouseListener;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.HelpDialogManager; import com.fr.design.mainframe.HelpDialogManager;
@ -267,6 +268,9 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
if (this != (XCreator) designer.getRootComponent()) { if (this != (XCreator) designer.getRootComponent()) {
ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this); ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this);
editingMouseListener.startEditing(this, isEditing ? adapter.getDesignerEditor() : null, adapter); editingMouseListener.startEditing(this, isEditing ? adapter.getDesignerEditor() : null, adapter);
if (isEditing) {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);
}
} }
} }
HelpDialogManager.getInstance().setPane(coverPanel); HelpDialogManager.getInstance().setPane(coverPanel);

1
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java

@ -160,6 +160,7 @@ public class XCardSwitchButton extends XButton {
return; return;
} }
deleteCard(this, index); deleteCard(this, index);
selectionModel.setSelectedCreator(designer.getRootComponent());
designer.fireTargetModified(); designer.fireTargetModified();
LayoutUtils.layoutRootContainer(designer.getRootComponent()); LayoutUtils.layoutRootContainer(designer.getRootComponent());
FormHierarchyTreePane.getInstance().refreshRoot(); FormHierarchyTreePane.getInstance().refreshRoot();

5
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.ScreenResolution; import com.fr.base.ScreenResolution;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignState; import com.fr.design.DesignState;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
@ -204,7 +205,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
*/ */
public void populateParameterPropertyPane() { public void populateParameterPropertyPane() {
//参数 //参数
setParameterArray(getNoRepeatParas(getTarget().getParameters())); setParameterArray(DesignModelAdapter.getCurrentModelAdapter().getParameters());
refreshParameter(); refreshParameter();
//容器 //容器
ParameterPropertyPane.getInstance().populateBean(this); ParameterPropertyPane.getInstance().populateBean(this);
@ -728,7 +729,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) { if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) {
FormDesigner.this.fireTargetModified(); FormDesigner.this.fireTargetModified();
if (evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED) { if (evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED) {
setParameterArray(getNoRepeatParas(getTarget().getParameters())); setParameterArray(getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters()));
refreshParameter(); refreshParameter();
} }
} else { } else {

4
designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java

@ -36,10 +36,10 @@ public class FormModelAdapter extends DesignModelAdapter<Form, BaseJForm<Form>>
* 参数改变. * 参数改变.
*/ */
public void parameterChanged() { public void parameterChanged() {
//实时更新参数
jTemplate.populateParameter();
// 更新缓存的参数 // 更新缓存的参数
updateCachedParameter(); updateCachedParameter();
//实时更新参数
jTemplate.populateParameter();
} }
/** /**

6
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java

@ -176,8 +176,10 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
this.functionalWhenUnactivatedCheckBox.setSelected(!isFunctionalWhenUnactivated); this.functionalWhenUnactivatedCheckBox.setSelected(!isFunctionalWhenUnactivated);
this.bindListeners2Widgets(); this.bindListeners2Widgets();
this.addAttributeChangeListener(changeListener); this.addAttributeChangeListener(changeListener);
// 直接return时 也要处理下相应数据
MobileCollapsedStyle style = ((ChartEditor) xCreator.toData()).getMobileCollapsedStyle();
if (!FormDesignerUtils.isAppRelayout(designer) || isInAbsoluteLayout()) { if (!FormDesignerUtils.isAppRelayout(designer) || isInAbsoluteLayout()) {
fix(style);
return; return;
} }
@ -199,8 +201,6 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
} }
} }
}); });
MobileCollapsedStyle style = ((ChartEditor) xCreator.toData()).getMobileCollapsedStyle();
this.mobileCollapsedStyleEditor.setStyle(style); this.mobileCollapsedStyleEditor.setStyle(style);
fix(style); fix(style);
this.mobileCollapsedStyleEditor.setSelected(style.isCollapsedWork()); this.mobileCollapsedStyleEditor.setSelected(style.isCollapsedWork());

3
designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java

@ -66,9 +66,10 @@ public class WorkBookModelAdapter extends DesignModelAdapter<WorkBook, JWorkBook
* 参数改变. * 参数改变.
*/ */
public void parameterChanged() { public void parameterChanged() {
// 参数改变 先更新缓存
updateCachedParameter();
jTemplate.updateReportParameterAttr(); jTemplate.updateReportParameterAttr();
jTemplate.populateReportParameterAttr(); jTemplate.populateReportParameterAttr();
updateCachedParameter();
} }
/** /**

7
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java

@ -19,6 +19,11 @@ public class DocumentModel extends AlphaCellModel {
private String informationUrl; private String informationUrl;
private int documentId; private int documentId;
public static final String TITLE = "title";
public static final String CONTENT = "content";
public static final String DID = "did";
public static final String SEARCHCOUNT = "searchcount";
public DocumentModel(String name, String content, int documentId) { public DocumentModel(String name, String content, int documentId) {
super(name, content, CellType.DOCUMENT); super(name, content, CellType.DOCUMENT);
this.documentId = documentId; this.documentId = documentId;
@ -43,7 +48,7 @@ public class DocumentModel extends AlphaCellModel {
public JSONObject modelToJson() { public JSONObject modelToJson() {
JSONObject object = JSONObject.create(); JSONObject object = JSONObject.create();
JSONObject modelObject = JSONObject.create(); JSONObject modelObject = JSONObject.create();
modelObject.put("title", getName()).put("summary", getContent()).put("did", getDocumentId()).put("searchCount", getSearchCount()); modelObject.put(TITLE, getName()).put(CONTENT, getContent()).put(DID, getDocumentId()).put(SEARCHCOUNT, getSearchCount());
object.put("result", modelObject).put("cellType", getType().getTypeValue()); object.put("result", modelObject).put("cellType", getType().getTypeValue());
return object; return object;
} }

8
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java

@ -43,10 +43,10 @@ public class DocumentSearchManager implements AlphaFineSearchProvider {
* @return * @return
*/ */
public static DocumentModel getModelFromCloud(JSONObject object) { public static DocumentModel getModelFromCloud(JSONObject object) {
String name = object.optString("title"); String name = object.optString(DocumentModel.TITLE);
String content = object.optString("summary"); String content = object.optString(DocumentModel.CONTENT);
int documentId = object.optInt("did"); int documentId = object.optInt(DocumentModel.DID);
int searchCount = object.optInt("searchCount"); int searchCount = object.optInt(DocumentModel.SEARCHCOUNT);
return new DocumentModel(name, content, documentId, searchCount); return new DocumentModel(name, content, documentId, searchCount);
} }

14
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java

@ -66,10 +66,10 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
@Override @Override
public SearchResult getLessSearchResult(String[] searchText) { public SearchResult getLessSearchResult(String[] searchText) {
this.recentModelList = new SearchResult();
SearchResult modelList = new SearchResult(); SearchResult modelList = new SearchResult();
for (String aSearchText : searchText) { for (String aSearchText : searchText) {
recentModelList = getRecentModelList(aSearchText); addToRecentModelList(aSearchText);
} }
if (recentModelList != null && recentModelList.size() > 0) { if (recentModelList != null && recentModelList.size() > 0) {
modelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Latest"))); modelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Latest")));
@ -87,8 +87,12 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
return new SearchResult(); return new SearchResult();
} }
private synchronized SearchResult getRecentModelList(String searchText) { /**
return searchBySort(searchText); * 将单次遍历的关键词的搜索结果添加到结果集中
* @param searchText
*/
private synchronized void addToRecentModelList(String searchText) {
searchBySort(searchText);
} }
public List<AlphaCellModel> getRecentModelList() { public List<AlphaCellModel> getRecentModelList() {
@ -161,7 +165,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
* 按序搜索 * 按序搜索
*/ */
private synchronized SearchResult searchBySort(String key) { private synchronized SearchResult searchBySort(String key) {
recentModelList = new SearchResult();
try { try {
initReader(); initReader();
@ -175,7 +178,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
Query query = new TermQuery(term); Query query = new TermQuery(term);
TopFieldDocs docs = searcher.search(query, MAX_SIZE, sortKey); TopFieldDocs docs = searcher.search(query, MAX_SIZE, sortKey);
ScoreDoc[] scores = docs.scoreDocs; ScoreDoc[] scores = docs.scoreDocs;
this.recentModelList = new SearchResult();
//遍历结果 //遍历结果
for (ScoreDoc scoreDoc : scores) { for (ScoreDoc scoreDoc : scores) {
Document document = searcher.doc(scoreDoc.doc); Document document = searcher.doc(scoreDoc.doc);

6
designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java

@ -42,7 +42,11 @@ class CptApp extends AbstractWorkBookApp {
@Override @Override
public WorkBook asIOFile(FILE file) { public WorkBook asIOFile(FILE file) {
return asIOFile(file, true);
}
@Override
public WorkBook asIOFile(FILE file, boolean needCheck) {
if (XMLEncryptUtils.isCptEncoded() && if (XMLEncryptUtils.isCptEncoded() &&
!XMLEncryptUtils.checkVaild(DesignerEnvManager.getEnvManager().getEncryptionKey())) { !XMLEncryptUtils.checkVaild(DesignerEnvManager.getEnvManager().getEncryptionKey())) {
if (!new DecodeDialog(file).isPwdRight()) { if (!new DecodeDialog(file).isPwdRight()) {
@ -67,7 +71,9 @@ class CptApp extends AbstractWorkBookApp {
} catch (Exception exp) { } catch (Exception exp) {
FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Report_NS_Exception_ReadError") + file, exp); FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Report_NS_Exception_ReadError") + file, exp);
} }
if (needCheck) {
checkNameStyle(namestyle); checkNameStyle(namestyle);
}
return tpl; return tpl;
} }

2
designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java

@ -275,7 +275,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
paraDesignEditor.populate(parameterUI); paraDesignEditor.populate(parameterUI);
parameterArray = getNoRepeatParas(getTargetParameter(workBook)); parameterArray = getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters());
refreshParameter(); refreshParameter();
allParameters = reportParameterAttr.getParameters(); allParameters = reportParameterAttr.getParameters();

Loading…
Cancel
Save