diff --git a/build.performance.gradle b/build.performance.gradle index 102205679..fe011898f 100644 --- a/build.performance.gradle +++ b/build.performance.gradle @@ -15,7 +15,6 @@ task appletJar<<{ fileset(dir:"${basicDir}/chart/build/classes/main") fileset(dir:"${basicDir}/report/build/classes/main") fileset(dir:"${basicDir}/platform/build/classes/main") - fileset(dir:"${basicDir}/performance/build/classes/main") } unjar(src:"${libDir}/3rd.jar",dest:"./tmp") unjar(src:"${libDir}/servlet-api.jar",dest:"./tmp") diff --git a/designer/src/com/fr/design/present/PresentPane.java b/designer/src/com/fr/design/present/PresentPane.java index 043b069b0..7d1d571fc 100644 --- a/designer/src/com/fr/design/present/PresentPane.java +++ b/designer/src/com/fr/design/present/PresentPane.java @@ -57,12 +57,12 @@ public class PresentPane extends UIComboBoxPane { @Override protected List> initPaneList() { if (keys == null) { - keys = new ArrayList<>(); + keys = new ArrayList(); } if (displays == null) { - displays = new ArrayList<>(); + displays = new ArrayList(); } - List> paneList = new ArrayList<>(); + List> paneList = new ArrayList>(); FurtherBasicBeanPane none = new NonePresentPane(); paneList.add(none); keys.add("NOPRESENT"); @@ -99,7 +99,7 @@ public class PresentPane extends UIComboBoxPane { @Override protected UIComboBox createComboBox() { - return new DictionaryComboBox<>(keys.toArray(new String[keys.size()]), displays.toArray(new String[displays.size()])); + return new DictionaryComboBox(keys.toArray(new String[keys.size()]), displays.toArray(new String[displays.size()])); } @Override diff --git a/designer/src/com/fr/design/report/ReportExportAttrPane.java b/designer/src/com/fr/design/report/ReportExportAttrPane.java index 33eb07519..1f549c62e 100644 --- a/designer/src/com/fr/design/report/ReportExportAttrPane.java +++ b/designer/src/com/fr/design/report/ReportExportAttrPane.java @@ -31,7 +31,7 @@ public class ReportExportAttrPane extends BasicPane { wordExportPane = new WordExportPane(); uiTabbedPane.addTab("Word", wordExportPane); Set providers = ExtraDesignClassManager.getInstance().getArray(ExportAttrTabProvider.XML_TAG); - paneList = new ArrayList<>(); + paneList = new ArrayList(); for (ExportAttrTabProvider provider : providers) { uiTabbedPane.addTab(provider.title(), provider.toSwingComponent()); paneList.add(provider.toExportPane()); diff --git a/designer/src/com/fr/design/report/VerifierListPane.java b/designer/src/com/fr/design/report/VerifierListPane.java index 9bdedbd8a..6b34af21b 100644 --- a/designer/src/com/fr/design/report/VerifierListPane.java +++ b/designer/src/com/fr/design/report/VerifierListPane.java @@ -1 +1,100 @@ -package com.fr.design.report; import com.fr.data.Verifier; import com.fr.design.ExtraDesignClassManager; import com.fr.design.fun.VerifyDefineProvider; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.ObjectJControlPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.general.Inter; import com.fr.general.NameObject; import com.fr.report.write.ReportWriteAttr; import com.fr.report.write.ValueVerifier; import com.fr.report.write.WClassVerifier; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import java.util.ArrayList; import java.util.Set; /** * 校验列表 */ public class VerifierListPane extends ObjectJControlPane { public VerifierListPane(ElementCasePane ePane) { super(ePane); } /** * 创建选项 * * @return 选项 */ public NameableCreator[] createNameableCreators() { NameableCreator[] creators = new NameableCreator[]{ new NameObjectCreator(Inter.getLocText(new String[]{"BuildIn", "Verify"}), "/com/fr/web/images/reportlet.png", ValueVerifier.class, BuildInVerifierPane.class) }; Set set = ExtraDesignClassManager.getInstance().getArray(VerifyDefineProvider.MARK_STRING); for (VerifyDefineProvider provider : set) { creators = ArrayUtils.add(creators, new NameObjectCreator( provider.nameForVerifier(), provider.iconPath(), provider.classForVerifier(), provider.appearanceForVerifier() ) { }); } creators = ArrayUtils.add(creators, new NameObjectCreator( Inter.getLocText(new String[]{"Custom", "Verify"}), "/com/fr/web/images/reportlet.png", WClassVerifier.class, CustomVerifierPane.class)); return creators; } @Override protected String title4PopupWindow() { return "Verify Collections"; } public void populate(ReportWriteAttr reportWriteAttr) { if (reportWriteAttr == null) { return; } java.util.List nameObjectList = new ArrayList<>(); int verifierCount = reportWriteAttr.getVerifierCount(); for (int i = 0; i < verifierCount; i++) { Verifier verifier = reportWriteAttr.getVerifier(i); nameObjectList.add(new NameObject(verifier.getName(), verifier)); } this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()])); } public void updateReportWriteAttr(ReportWriteAttr reportWriteAttr) { // Nameable[]居然不能强转成NameObject[],一定要这么写... Nameable[] res = this.update(); NameObject[] res_array = new NameObject[res.length]; java.util.Arrays.asList(res).toArray(res_array); reportWriteAttr.clearVerifiers(); for (int i = 0; i < res_array.length; i++) { NameObject nameObject = res_array[i]; if (nameObject.getObject() instanceof Verifier) { Verifier verifier = (Verifier) nameObject.getObject(); verifier.setName(nameObject.getName()); reportWriteAttr.addVerifier(verifier); } } } } \ No newline at end of file +package com.fr.design.report; + +import com.fr.data.Verifier; +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.fun.VerifyDefineProvider; +import com.fr.design.gui.controlpane.NameObjectCreator; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.gui.controlpane.ObjectJControlPane; +import com.fr.design.mainframe.ElementCasePane; +import com.fr.general.Inter; +import com.fr.general.NameObject; +import com.fr.report.write.ReportWriteAttr; +import com.fr.report.write.ValueVerifier; +import com.fr.report.write.WClassVerifier; +import com.fr.stable.ArrayUtils; +import com.fr.stable.Nameable; + +import java.util.ArrayList; +import java.util.Set; + +/** + * 校验列表 + */ +public class VerifierListPane extends ObjectJControlPane { + + public VerifierListPane(ElementCasePane ePane) { + super(ePane); + } + + /** + * 创建选项 + * + * @return 选项 + */ + public NameableCreator[] createNameableCreators() { + NameableCreator[] creators = new NameableCreator[]{ + new NameObjectCreator(Inter.getLocText(new String[]{"BuildIn", "Verify"}), + "/com/fr/web/images/reportlet.png", + ValueVerifier.class, + BuildInVerifierPane.class) + }; + Set set = ExtraDesignClassManager.getInstance().getArray(VerifyDefineProvider.MARK_STRING); + for (VerifyDefineProvider provider : set) { + creators = ArrayUtils.add(creators, new NameObjectCreator( + provider.nameForVerifier(), + provider.iconPath(), + provider.classForVerifier(), + provider.appearanceForVerifier() + ) { + }); + } + creators = ArrayUtils.add(creators, new NameObjectCreator( + Inter.getLocText(new String[]{"Custom", "Verify"}), + "/com/fr/web/images/reportlet.png", + WClassVerifier.class, + CustomVerifierPane.class)); + return creators; + } + + @Override + protected String title4PopupWindow() { + return "Verify Collections"; + } + + public void populate(ReportWriteAttr reportWriteAttr) { + if (reportWriteAttr == null) { + return; + } + + java.util.List nameObjectList = new ArrayList(); + + int verifierCount = reportWriteAttr.getVerifierCount(); + for (int i = 0; i < verifierCount; i++) { + Verifier verifier = reportWriteAttr.getVerifier(i); + nameObjectList.add(new NameObject(verifier.getName(), verifier)); + } + + this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()])); + } + + public void updateReportWriteAttr(ReportWriteAttr reportWriteAttr) { + // Nameable[]居然不能强转成NameObject[],一定要这么写... + Nameable[] res = this.update(); + NameObject[] res_array = new NameObject[res.length]; + java.util.Arrays.asList(res).toArray(res_array); + + reportWriteAttr.clearVerifiers(); + + for (int i = 0; i < res_array.length; i++) { + NameObject nameObject = res_array[i]; + if (nameObject.getObject() instanceof Verifier) { + Verifier verifier = (Verifier) nameObject.getObject(); + verifier.setName(nameObject.getName()); + reportWriteAttr.addVerifier(verifier); + } + } + } + + +} \ No newline at end of file diff --git a/designer/src/com/fr/design/write/submit/SubmitVisitorListPane.java b/designer/src/com/fr/design/write/submit/SubmitVisitorListPane.java index 3dfea6c15..899017003 100644 --- a/designer/src/com/fr/design/write/submit/SubmitVisitorListPane.java +++ b/designer/src/com/fr/design/write/submit/SubmitVisitorListPane.java @@ -68,7 +68,7 @@ public class SubmitVisitorListPane extends ObjectJControlPane { return; } - List nameObjectList = new ArrayList<>(); + List nameObjectList = new ArrayList(); int submiterCount = reportWriteAttr.getSubmitVisitorCount(); for (int i = 0; i < submiterCount; i++) { @@ -169,8 +169,8 @@ public class SubmitVisitorListPane extends ObjectJControlPane { public CustomPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); customCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); - customSubmitPanes = new HashMap<>(); - comboItemsMap = new HashMap<>(); + customSubmitPanes = new HashMap(); + comboItemsMap = new HashMap(); Set providers = ExtraDesignClassManager.getInstance().getArray(SubmitProvider.MARK_STRING); addSubmitPane(new DefaultSubmit()); @@ -178,7 +178,7 @@ public class SubmitVisitorListPane extends ObjectJControlPane { addSubmitPane(provider); } - configTypes = new ArrayList<>(); + configTypes = new ArrayList(); for (Map.Entry entry : customSubmitPanes.entrySet()) { String key = entry.getKey(); configTypes.add(comboItemsMap.get(key)); diff --git a/designer/src/com/fr/grid/IntelliElements.java b/designer/src/com/fr/grid/IntelliElements.java index 475235e56..a5d805563 100644 --- a/designer/src/com/fr/grid/IntelliElements.java +++ b/designer/src/com/fr/grid/IntelliElements.java @@ -194,7 +194,12 @@ public class IntelliElements { TemplateCellElement newCellElement = new DefaultTemplateCellElement(colIndex, rowIndex); applyStyle(newCellElement, sourceCellElement);//style if (sourceCellElement.getValue() instanceof DSColumn) { - DSColumn dsColumn = (DSColumn) sourceCellElement.getValue(); + DSColumn dsColumn = null; + try { + dsColumn = (DSColumn) ((DSColumn) sourceCellElement.getValue()).clone(); + } catch (CloneNotSupportedException e) { + FRContext.getLogger().error(e.getMessage(), e); + } newCellElement.setValue(dsColumn); newCellElement.setCellExpandAttr(sourceCellElement.getCellExpandAttr()); } else if (sourceCellElement.getValue() instanceof Number) { diff --git a/designer_base/src/com/fr/design/data/DesignTableDataManager.java b/designer_base/src/com/fr/design/data/DesignTableDataManager.java index 621e303b1..5248c9626 100644 --- a/designer_base/src/com/fr/design/data/DesignTableDataManager.java +++ b/designer_base/src/com/fr/design/data/DesignTableDataManager.java @@ -36,6 +36,7 @@ import java.io.ByteArrayOutputStream; import java.text.Collator; import java.util.*; import java.util.Map.Entry; +import java.util.concurrent.ConcurrentHashMap; /** * 设计器管理操作数据集的类: @@ -54,11 +55,11 @@ public abstract class DesignTableDataManager { * 其实globalDsCache没有绝对的必要,只是为了操作方便。如果没有它,那么每次清空服务器数据集或者存储过程的时候,还要去遍历找一下, * 这个操作可能比较复杂 。 从减少代码复杂度的角度看,还是很有必要的 */ - private static java.util.Map globalDsCache = new java.util.HashMap(); - private static java.util.Map dsNameChangedMap = new HashMap(); + private static java.util.Map globalDsCache = new ConcurrentHashMap(); + private static java.util.Map dsNameChangedMap = new ConcurrentHashMap(); // private static List dsListeners = new ArrayList(); - private static Map> dsListenersMap = new HashMap>(); + private static Map> dsListenersMap = new ConcurrentHashMap>();; public static String NO_PARAMETER = "no_paramater_pane"; diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java index a275d3d5d..28d71f988 100644 --- a/designer_base/src/com/fr/design/mainframe/JTemplate.java +++ b/designer_base/src/com/fr/design/mainframe/JTemplate.java @@ -121,7 +121,10 @@ public abstract class JTemplate> ex return; } long saveTime = System.currentTimeMillis(); // 保存模板的时间点 - tic.collectInfo(template, this, openTime, saveTime); + try { + tic.collectInfo(template, this, openTime, saveTime); + } catch (Throwable th) { // 不管收集过程中出现任何异常,都不应该影响模版保存 + } openTime = saveTime; // 更新 openTime,准备下一次计算 } diff --git a/designer_base/src/com/fr/design/mainframe/loghandler/LogHandlerBar.java b/designer_base/src/com/fr/design/mainframe/loghandler/LogHandlerBar.java index 4fbef485d..d0a45a5a7 100644 --- a/designer_base/src/com/fr/design/mainframe/loghandler/LogHandlerBar.java +++ b/designer_base/src/com/fr/design/mainframe/loghandler/LogHandlerBar.java @@ -25,8 +25,6 @@ public class LogHandlerBar extends JPanel implements ItemSelectable { private int SERVERNUM = 0; private boolean isWithSerious; - private int i; - private Timer timer; public LogHandlerBar() { this(null); @@ -87,32 +85,7 @@ public class LogHandlerBar extends JPanel implements ItemSelectable { } public synchronized void timerPaint() { - isWithSerious = true; - timer = new Timer(500, null); - ActionListener taskAction = new ActionListener() { - public void actionPerformed(ActionEvent e) { - if (i < 5) { - isWithSerious = i % 2 == 0 ? true : false; - repaint(); - } else if (i == 5) { - if (timer == null) - return; - timer.stop(); - timer = null; - i = 0; - isWithSerious = true; - return; - } - i++; - } - }; - if (timer != null) { - timer.addActionListener(taskAction); - } - // taskAction里还有可能置空timer. - if (timer != null) { - timer.start(); - } + repaint(); } public int getInfo() { diff --git a/designer_base/src/com/fr/design/roleAuthority/ReportAndFSManagePane.java b/designer_base/src/com/fr/design/roleAuthority/ReportAndFSManagePane.java index 2c332c312..3419b8560 100644 --- a/designer_base/src/com/fr/design/roleAuthority/ReportAndFSManagePane.java +++ b/designer_base/src/com/fr/design/roleAuthority/ReportAndFSManagePane.java @@ -203,8 +203,7 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo buttonGroup.setBorder(BorderFactory.createMatteBorder(1, LEFT_GAP, 0, 0, UIConstants.LINE_COLOR)); buttonGroup.setNeedLeftRightOutLine(false); } - - + private int getMode(){ return isSupportFS?FS_MANAGE: REPORT_PLATEFORM_MANAGE; } diff --git a/designer_chart/src/com/fr/design/mainframe/ChartPropertyPane.java b/designer_chart/src/com/fr/design/mainframe/ChartPropertyPane.java index f29efe7af..868fefbf7 100644 --- a/designer_chart/src/com/fr/design/mainframe/ChartPropertyPane.java +++ b/designer_chart/src/com/fr/design/mainframe/ChartPropertyPane.java @@ -30,7 +30,7 @@ public class ChartPropertyPane extends MiddleChartPropertyPane{ return new Dimension(super.getPreferredSize().width, 18); } }; - nameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 1, 0)); + nameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 1, 0)); nameLabel.setHorizontalAlignment(SwingConstants.CENTER); } diff --git a/designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java b/designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java index 1d9732205..53609b49d 100644 --- a/designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java +++ b/designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java @@ -16,6 +16,7 @@ import com.fr.design.gui.itabpane.TitleChangeListener; import com.fr.design.mainframe.chart.ChartEditPane; import com.fr.general.Inter; import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; import javax.swing.*; import java.awt.*; @@ -30,11 +31,11 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{ public MiddleChartPropertyPane() { initComponenet(); } - + protected void initComponenet() { this.setLayout(new BorderLayout()); this.setBorder(null); - + createNameLabel(); this.add(createNorthComponent(), BorderLayout.NORTH); chartEditPane = StableUtils.construct(ChartEditPane.class); @@ -47,11 +48,11 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{ this.createMainPane(); setSureProperty(); } - + protected abstract void createNameLabel(); - + protected abstract JComponent createNorthComponent(); - + protected abstract void createMainPane(); @@ -64,10 +65,10 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{ chartEditPane.setContainer(container); chartEditPane.addTitleChangeListener(titleListener); String tabname = chartEditPane.getSelectedTabName(); - nameLabel.setText(Inter.getLocText("Chart-Property_Table") + (tabname != null ? ('-' + chartEditPane.getSelectedTabName()) : "")); + nameLabel.setText(Inter.getLocText("Chart-Property_Table") + (tabname != null ? ('-' + chartEditPane.getSelectedTabName()) : StringUtils.EMPTY)); resetChartEditPane(); } - + protected void resetChartEditPane() { remove(chartEditPane); add(chartEditPane, BorderLayout.CENTER); @@ -75,20 +76,20 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{ repaint(); revalidate(); } - + protected TitleChangeListener titleListener = new TitleChangeListener() { - + @Override public void fireTitleChange(String addName) { nameLabel.setText(Inter.getLocText("Chart-Property_Table") + '-' + addName); } }; - /** - * 感觉ChartCollection加载图表属性界面. - * @param collection 收集图表 - * @param ePane 面板 - */ + /** + * 感觉ChartCollection加载图表属性界面. + * @param collection 收集图表 + * @param ePane 面板 + */ public void populateChartPropertyPane(ChartCollection collection, TargetComponent ePane) { addChartEditPane(collection.getSelectedChart().getPlot().getPlotID()); setSupportCellData(true); @@ -96,11 +97,11 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{ chartEditPane.populate(collection); } - /** - * 感觉ChartCollection加载图表属性界面. - * @param collection 收集图表 - * @param ePane 面板 - */ + /** + * 感觉ChartCollection加载图表属性界面. + * @param collection 收集图表 + * @param ePane 面板 + */ public void populateChartPropertyPane(BaseChartCollection collection, TargetComponent ePane) { if (collection instanceof ChartCollection) { populateChartPropertyPane((ChartCollection)collection, ePane); @@ -127,18 +128,18 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{ return BaseUtils.readIcon("/com/fr/design/images/m_report/qb.png"); } - /** - * 预定义定位 - * @return 定位 - */ + /** + * 预定义定位 + * @return 定位 + */ public Location preferredLocation() { return Location.WEST_BELOW; } - /** - * 创建标题Panel - * @return 标题panel - */ + /** + * 创建标题Panel + * @return 标题panel + */ public UITitlePanel createTitlePanel() { return new UITitlePanel(this); } @@ -148,14 +149,14 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{ */ public void refreshDockingView() { // TODO Auto-generated method stub - + } - + /** * 设置是否支持单元格数据. */ public void setSupportCellData(boolean supportCellData) { - if(chartEditPane != null) { + if (chartEditPane != null) { chartEditPane.setSupportCellData(supportCellData); } } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java b/designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java index fc3b70108..f681f275e 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java @@ -22,6 +22,7 @@ import com.fr.design.mainframe.chart.gui.ChartTypePane; import com.fr.general.ComparatorUtils; import com.fr.general.FRLogger; import com.fr.general.Inter; +import com.fr.stable.StringUtils; import javax.swing.*; import javax.swing.event.ChangeEvent; @@ -31,7 +32,7 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.List; -public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4DataSourceChange, ChartEditPaneProvider { +public class ChartEditPane extends BasicPane implements AttributeChange, Prepare4DataSourceChange, ChartEditPaneProvider { private final static int CHANGE_MIN_TIME = 80; @@ -119,7 +120,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 } catch (CloneNotSupportedException e) { FRLogger.getLogger().error("error in clone ChartEditPane"); } - if(ComparatorUtils.equals(selectedPane.title4PopupWindow(),PaneTitleConstants.CHART_STYLE_TITLE)){ + if (ComparatorUtils.equals(selectedPane.title4PopupWindow(), PaneTitleConstants.CHART_STYLE_TITLE)) { dealWithStyleChange(); } @@ -130,10 +131,11 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 /** * 重新构造面板 + * * @param currentChart 图表 */ - public void reLayout(Chart currentChart){ - if(currentChart != null){ + public void reLayout(Chart currentChart) { + if (currentChart != null) { int chartIndex = getSelectedChartIndex(currentChart); this.removeAll(); this.setLayout(new BorderLayout()); @@ -141,22 +143,22 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 addTypePane(); boolean isDefault = true; - String plotID = ""; - if(currentChart.getPlot() != null){ + String plotID = StringUtils.EMPTY; + if (currentChart.getPlot() != null) { plotID = currentChart.getPlot().getPlotID(); isDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID); } - if(isDefault){ + if (isDefault) { paneList.add(dataPane4SupportCell); paneList.add(stylePane); paneList.add(otherPane); this.isDefaultPane = true; - }else{ + } else { ChartDataPane chartDataPane = createChartDataPane(plotID); paneList.add(chartDataPane); AbstractChartAttrPane[] otherPaneList = ChartTypeInterfaceManager.getInstance().getAttrPaneArray(plotID, listener); - for(int i = 0; i < otherPaneList.length; i++){ + for (int i = 0; i < otherPaneList.length; i++) { otherPaneList[i].addAttributeChangeListener(listener); paneList.add(otherPaneList[i]); } @@ -178,6 +180,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 } protected void setSelectedTab() { + //doNothing } /** @@ -223,7 +226,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 return; } - if(checkNeedsReLayout(collection.getSelectedChart())){ + if (isNeedsReLayout(collection.getSelectedChart())) { reLayout(collection.getSelectedChart()); } @@ -250,12 +253,12 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 } } - public int getSelectedChartIndex(Chart chart){ + public int getSelectedChartIndex(Chart chart) { int index = 0; - if(typePane != null){ + if (typePane != null) { FurtherBasicBeanPane[] paneList = typePane.getPaneList(); - for(; index < paneList.length; index++){ - if(paneList[index].accept(chart)){ + for (; index < paneList.length; index++) { + if (paneList[index].accept(chart)) { return index; } } @@ -264,12 +267,12 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 } //populate的时候看看要不要重构面板 - private boolean checkNeedsReLayout(Chart chart){ - if(chart != null){ + private boolean isNeedsReLayout(Chart chart) { + if (chart != null) { int lastIndex = typePane.getSelectedIndex(); int currentIndex = getSelectedChartIndex(chart); boolean currentPane = true; - if(chart.getPlot() != null){ + if (chart.getPlot() != null) { String plotID = chart.getPlot().getPlotID(); currentPane = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID); } @@ -280,9 +283,10 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 /** * 当前界面是否是默认的界面 + * * @return 是否是默认的界面 */ - public boolean isDefaultPane(){ + public boolean isDefaultPane() { return this.isDefaultPane; } @@ -314,16 +318,17 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 } } - protected void dealWithStyleChange(){ - + protected void dealWithStyleChange() { + //doNothing } /** - *主要用于图表设计器,判断样式改变是否来自工具栏的全局样式按钮 + * 主要用于图表设计器,判断样式改变是否来自工具栏的全局样式按钮 + * * @param isFromToolBar 是否来自工具栏 */ - public void styleChange(boolean isFromToolBar){ - + public void styleChange(boolean isFromToolBar) { + //doNothing } /** @@ -342,7 +347,10 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 DesignTableDataManager.addDsChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { AbstractChartAttrPane attrPane = paneList.get(tabsHeaderIconPane.getSelectedIndex()); - attrPane.refreshChartDataPane(collection); + //不显示,没有处于编辑状态,没必要更新。 + if (attrPane.isShowing()) { + attrPane.refreshChartDataPane(collection); + } } }); } diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java index 04e678029..7189687d6 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java @@ -389,8 +389,8 @@ public class XCardSwitchButton extends XButton { return; } int tabLength = this.tagLayout.getComponentCount(); - Map cardWidth = new HashMap<>(); - Map cardHeight = new HashMap<>(); + Map cardWidth = new HashMap(); + Map cardHeight = new HashMap(); for (int i = 0; i < tabLength; i++) { XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i); CardSwitchButton tempCard = (CardSwitchButton) temp.toData(); diff --git a/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java b/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java index 5a156f346..3522c32b2 100644 --- a/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java +++ b/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java @@ -60,7 +60,7 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{ .setRendererClass(BooleanRender.class) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit")) }; - List defaultList = new ArrayList<>(); + List defaultList = new ArrayList(); for (CRPropertyDescriptor propertyDescriptor: propertyTableEditor) { defaultList.add(propertyDescriptor); diff --git a/designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java b/designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java index bb0f0cd3a..50f234324 100644 --- a/designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java +++ b/designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java @@ -54,7 +54,7 @@ public class PropertyGroupModel extends AbstractPropertyGroupModel { creator.resetCreatorName(value.toString()); } if(ComparatorUtils.equals("visible", properties[row].getName())){ - creator.resetVisible((boolean) value); + creator.resetVisible((Boolean) value); } properties[row].firePropertyChanged(); return true; diff --git a/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java b/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java index 929e10110..bfc7406de 100644 --- a/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java @@ -286,7 +286,9 @@ public class FormParaWidgetPane extends JPanel { private int calculateWidgetWindowRowNum() { //向上取整 - int rowNum = (int) Math.ceil((double) predifinedwidgeList.size() / (double) preWidgetShowMaxNum); + int eastRowNum = (int) Math.ceil((double) predifinedwidgeList.size() / (double) preWidgetShowMaxNum); + int westRowNum = (int) Math.ceil((double) loadWidgetOptions().length / (double) commonWidgetNum); + int rowNum = Math.max(eastRowNum, westRowNum); rowNum = Math.max(rowNum, 2); rowNum = Math.min(rowNum, preWidgetShowMaxRow); return rowNum;