diff --git a/build.gradle b/build.gradle index 3580cbae0d..617b9d0fa8 100644 --- a/build.gradle +++ b/build.gradle @@ -72,7 +72,9 @@ allprojects { implementation 'com.fr.datasource:fine-datasource:' + frVersion implementation 'com.fr.decision:fine-decision:' + 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 testImplementation 'org.easymock:easymock:3.5.1' testImplementation 'org.powermock:powermock-module-junit4:1.7.1' 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 6ca4ed6808..5d6ee4e5ac 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 @@ -14,10 +14,10 @@ import javax.swing.BoxLayout; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JScrollPane; -import java.awt.Dimension; import java.util.Iterator; -import java.util.Map; import java.util.LinkedHashMap; +import java.util.Map; +import java.awt.Dimension; @Open public abstract class ConditionAttributesPane extends BasicBeanPane { @@ -69,7 +69,12 @@ public abstract class ConditionAttributesPane extends BasicBeanPane { selectedItemScrollPane.setViewportView(selectedItemPane); selectedItemScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); selectedItemScrollPane.setMinimumSize(new Dimension((int) selectedItemScrollPane.getPreferredSize().getWidth(), MIN_HEIGHT)); + dealScrollPane(selectedItemScrollPane); propertyChangePane.add(selectedItemScrollPane); + } + + protected void dealScrollPane(JScrollPane scrollPane){ + } public void updateBean(T ob) { diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java index b138f4e58c..d0bc499a29 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java +++ b/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.impl.Connection; import com.fr.data.impl.NameDatabaseConnection; +import com.fr.data.impl.storeproc.ProcedureDataModel; import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.data.operator.DataOperator; 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.utils.gui.GUICoreUtils; import com.fr.file.ConnectionConfig; - -import com.fr.script.Calculator; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +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.ItemEvent; import java.awt.event.ItemListener; @@ -273,7 +280,8 @@ public class ProcedureDataPane extends AbstractTableDataPane imp protected Void doInBackground() throws Exception { DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER); sp.setCalculating(true); - sp.creatDataModel(Calculator.createCalculator()); + ProcedureDataModel[] dataModels = DesignTableDataManager.createLazyDataModel(sp, false); + sp.refreshDataModelListAndResultNames(dataModels); return null; } diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java index f9de1cfa41..96069b4356 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java @@ -25,13 +25,19 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { private static final String HOST_NAME = "127.0.0.1"; private static final String LOCAL_HOTS_NAME = "localhost"; 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 { - FILTER_SET.add(HTTP + HOST_NAME + QUOTATION + PORT + PATH); - 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); + initFilerSet(port); + } + + 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; @@ -164,6 +170,11 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { @Override public boolean checkValid() { boolean result = false; + String newPort = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort()); + if (!ComparatorUtils.equals(port, newPort)) { + // 使用过程中 更改了内置服务器端口 重新初始化下 + initFilerSet(newPort); + } if (FILTER_SET.contains(connection.getUrl())) { FineLoggerFactory.getLogger().error("url is same with local designer"); return result; diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java index 0a8529abf3..4f4ac9e3b5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/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 isDownPaneVisible = true ; private int paraHeight; + private int parentHeight = -1; public UIResizableContainer(int direction) { this(new JPanel(), new JPanel(), direction); @@ -207,7 +208,8 @@ public class UIResizableContainer extends JPanel { if (verticalToolPane == null || downPane == null) { return; } - + // REPORT-42913 如果用户修改了分辨率或者dpi,可能造成toolPaneY大于parent.getHeight,整个downPane将丢失,因此这里调整下toolPaneY + adjustToolPaneY(parent); if (direction == Constants.RIGHT) { if(isDownPaneVisible){ 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 public void addLayoutComponent(String name, Component comp) { } @@ -540,4 +554,4 @@ public class UIResizableContainer extends JPanel { jf.setSize(500, 500); jf.setVisible(true); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/App.java b/designer-base/src/main/java/com/fr/design/mainframe/App.java index 3cae10f6bb..c941df8afd 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/App.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/App.java @@ -41,4 +41,15 @@ public interface App extends Mutable, Aftermath { * @return 报表 */ T asIOFile(FILE tplFile); + + + /** + * 输出workbook等对象 + * @param tplFile 文件 + * @param needCheck 是否需要check + * @return + */ + default T asIOFile(FILE tplFile, boolean needCheck) { + return asIOFile(tplFile); + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 73d5d0bb1f..6c6de287e6 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -136,9 +136,9 @@ public abstract class JTemplate> this.editingFILE = file; this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder()); + designModel = createDesignModel(); addCenterPane(); this.undoState = createUndoState(); - designModel = createDesignModel(); consumeTimer.setEnabled(shouldInitForCollectInfo(isNewFile)); initAndStartPlugin(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java index 8019cc178a..678b9bf841 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java @@ -56,7 +56,7 @@ public final class JTemplateFactory { String[] defaultAppExtensions = app.defaultExtensions(); for (String defaultAppExtension : defaultAppExtensions) { if (defaultAppExtension.equalsIgnoreCase(fileExtension)) { - BaseBook bb = app.asIOFile(file); + BaseBook bb = app.asIOFile(file, false); if (bb != null) { return (T) bb; } diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java index 9f5c7fbaa9..e6b276437a 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java +++ b/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:现在要考虑左边日志模板的影响 */ 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(); @@ -308,7 +312,7 @@ public final class GUICoreUtils { if (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); } /** diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java index 90982ded53..aa8c9e46c8 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java +++ b/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.JPanel; +import javax.swing.JScrollPane; +import java.util.Iterator; import java.awt.BorderLayout; import java.awt.Dimension; -import java.util.Iterator; /** * Created by IntelliJ IDEA. @@ -27,6 +28,9 @@ import java.util.Iterator; * Time : 上午9:16 */ public class DataSeriesConditionPane extends ConditionAttributesPane { + + private static final int SCROLL_BAR_UNIT_INCREMENT = 16; + protected Plot plot; public DataSeriesConditionPane(Plot plot) { @@ -43,6 +47,10 @@ public class DataSeriesConditionPane extends ConditionAttributesPane implements TreeSelection */ public void populateParameterPropertyPane() { //参数 - setParameterArray(getNoRepeatParas(getTarget().getParameters())); + setParameterArray(DesignModelAdapter.getCurrentModelAdapter().getParameters()); refreshParameter(); //容器 ParameterPropertyPane.getInstance().populateBean(this); @@ -728,7 +729,7 @@ public class FormDesigner extends TargetComponent
implements TreeSelection if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) { FormDesigner.this.fireTargetModified(); if (evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED) { - setParameterArray(getNoRepeatParas(getTarget().getParameters())); + setParameterArray(getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters())); refreshParameter(); } } else { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java b/designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java index abe0c97e86..efc7ff2b04 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java @@ -36,10 +36,10 @@ public class FormModelAdapter extends DesignModelAdapter> * 参数改变. */ public void parameterChanged() { - //实时更新参数 - jTemplate.populateParameter(); // 更新缓存的参数 updateCachedParameter(); + //实时更新参数 + jTemplate.populateParameter(); } /** diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java index 371fcde7a8..35f3ccbb1f 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java +++ b/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.bindListeners2Widgets(); this.addAttributeChangeListener(changeListener); - + // 直接return时 也要处理下相应数据 + MobileCollapsedStyle style = ((ChartEditor) xCreator.toData()).getMobileCollapsedStyle(); if (!FormDesignerUtils.isAppRelayout(designer) || isInAbsoluteLayout()) { + fix(style); return; } @@ -199,8 +201,6 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane { } } }); - - MobileCollapsedStyle style = ((ChartEditor) xCreator.toData()).getMobileCollapsedStyle(); this.mobileCollapsedStyleEditor.setStyle(style); fix(style); this.mobileCollapsedStyleEditor.setSelected(style.isCollapsedWork()); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java b/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java index fff25486dc..1a4f20c3dd 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java @@ -66,9 +66,10 @@ public class WorkBookModelAdapter extends DesignModelAdapter 0) { modelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Latest"))); @@ -86,9 +86,13 @@ public class RecentSearchManager implements AlphaFineSearchProvider { public SearchResult getMoreSearchResult(String searchText) { return new SearchResult(); } - - private synchronized SearchResult getRecentModelList(String searchText) { - return searchBySort(searchText); + + /** + * 将单次遍历的关键词的搜索结果添加到结果集中 + * @param searchText + */ + private synchronized void addToRecentModelList(String searchText) { + searchBySort(searchText); } public List getRecentModelList() { @@ -161,7 +165,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider { * 按序搜索 */ private synchronized SearchResult searchBySort(String key) { - recentModelList = new SearchResult(); try { initReader(); @@ -175,7 +178,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider { Query query = new TermQuery(term); TopFieldDocs docs = searcher.search(query, MAX_SIZE, sortKey); ScoreDoc[] scores = docs.scoreDocs; - this.recentModelList = new SearchResult(); //遍历结果 for (ScoreDoc scoreDoc : scores) { Document document = searcher.doc(scoreDoc.doc); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java index cb6fb8d3e3..adadab36d4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java @@ -42,7 +42,11 @@ class CptApp extends AbstractWorkBookApp { @Override public WorkBook asIOFile(FILE file) { + return asIOFile(file, true); + } + @Override + public WorkBook asIOFile(FILE file, boolean needCheck) { if (XMLEncryptUtils.isCptEncoded() && !XMLEncryptUtils.checkVaild(DesignerEnvManager.getEnvManager().getEncryptionKey())) { if (!new DecodeDialog(file).isPwdRight()) { @@ -67,7 +71,9 @@ class CptApp extends AbstractWorkBookApp { } catch (Exception exp) { FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Report_NS_Exception_ReadError") + file, exp); } - checkNameStyle(namestyle); + if (needCheck) { + checkNameStyle(namestyle); + } return tpl; } diff --git a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java index af41fd0884..049761417d 100644 --- a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java +++ b/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); - parameterArray = getNoRepeatParas(getTargetParameter(workBook)); + parameterArray = getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters()); refreshParameter(); allParameters = reportParameterAttr.getParameters();