From 4dd959fb1900ab5b2265506d1fe2ade79f31b9a4 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Sun, 20 Aug 2017 21:58:11 +0800 Subject: [PATCH 1/8] =?UTF-8?q?9.0=E6=96=B0=E5=9B=BE=E8=A1=A8=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=9D=A2=E6=9D=BF=E4=BF=AE=E6=94=B9=20=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=85=8D=E7=BD=AE=E9=9D=A2=E6=9D=BF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/data/ChartDataFilterPane.java | 172 ++++++++++-------- .../chart/gui/data/DatabaseTableDataPane.java | 2 + .../chart/gui/data/NormalChartDataPane.java | 12 +- .../chart/gui/data/TableDataPane.java | 11 +- .../report/AbstractReportDataContentPane.java | 1 + .../BubblePlotReportDataContentPane.java | 9 +- ...goryPlotMoreCateReportDataContentPane.java | 12 +- .../CategoryPlotReportDataContentPane.java | 15 +- .../MeterPlotReportDataContentPane.java | 17 +- .../table/AbstractTableDataContentPane.java | 18 +- ...egoryPlotMoreCateTableDataContentPane.java | 14 +- .../CategoryPlotTableDataContentPane.java | 12 +- .../table/GanttPlotTableDataContentPane.java | 14 +- .../table/MeterPlotTableDataContentPane.java | 17 +- .../table/SeriesNameUseFieldNamePane.java | 2 - .../table/SeriesNameUseFieldValuePane.java | 18 +- .../data/table/SeriesTypeUseComboxPane.java | 10 +- .../chart/gui/style/ThirdTabPane.java | 8 +- ...anChartBubblePlotTableDataContentPane.java | 17 +- .../designer/AbstractVanChartScrollPane.java | 4 + .../data/GanttPlotReportDataContentPane.java | 2 + .../data/GanttPlotTableDataContentPane.java | 5 +- .../component/ComboBoxWithButtonPane.java | 2 +- .../component/GanttReportDataContentPane.java | 8 +- .../component/GanttTableDataContentPane.java | 26 ++- .../component/GanttTableDataProjectPane.java | 2 +- .../component/TinyFormulaWithButtonPane.java | 2 +- .../link/GanttLinkReportDataContentPane.java | 7 +- .../link/GanttLinkTableDataContentPane.java | 18 +- .../data/component/report/AreaPane.java | 2 +- .../component/report/LineMapAreaPane.java | 6 +- .../component/report/LongLatAreaPane.java | 8 +- .../data/component/table/AreaPane.java | 4 +- .../data/component/table/LineMapAreaPane.java | 6 +- .../data/component/table/LongLatAreaPane.java | 8 +- .../VanAreaMapPlotReportDataContentPane.java | 3 +- .../VanPointMapPlotReportDataContentPane.java | 19 +- .../VanAreaMapPlotTableDataContentPane.java | 29 ++- .../VanPointMapPlotTableDataContentPane.java | 17 +- .../VanChartMapConditionAttrContentPane.java | 14 +- .../other/VanChartMapConditionAttrPane.java | 4 +- .../other/VanChartMapInteractivePane.java | 5 +- .../type/VanChartMapSourceChoosePane.java | 67 ++++--- .../MultiPiePlotReportDataContentPane.java | 18 +- .../MultiPiePlotTableDataContentPane.java | 20 +- .../StructurePlotReportDataContentPane.java | 13 +- .../StructurePlotTableDataContentPane.java | 27 ++- .../WordCloudPlotReportDataContentPane.java | 10 +- .../WordCloudPlotTableDataContentPane.java | 21 +-- 49 files changed, 437 insertions(+), 321 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java index f0a6d67bb0..f4a2381e7c 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java @@ -2,18 +2,20 @@ package com.fr.design.mainframe.chart.gui.data; import com.fr.base.Utils; import com.fr.base.chart.chartdata.TopDefinitionProvider; -import com.fr.chart.chartdata.TopDefinition; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.Plot; +import com.fr.chart.chartdata.TopDefinition; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; +import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.icheckbox.UICheckBox; -import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.layout.TableLayout; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.style.AbstractChartTabPane; import com.fr.design.mainframe.chart.gui.style.ThirdTabPane; import com.fr.general.Inter; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.stable.StringUtils; import javax.swing.*; @@ -31,8 +33,8 @@ import java.util.List; */ public class ChartDataFilterPane extends ThirdTabPane { private static final long serialVersionUID = 3650522989381790194L; - private static final int PAN_WIDTH = 210; - private static final int FIL_HEIGHT = 130; + private static final int PAN_WIDTH = 234; + private static final int FIL_HEIGHT = 150; private CategoryFilterPane categoryPane; private SeriesFilterPane seriesPane; @@ -45,6 +47,18 @@ public class ChartDataFilterPane extends ThirdTabPane { this.isNeedPresent = true; } + protected void initTabPane() { + if (!paneList.isEmpty()) { + tabPane = new UIHeadGroup(nameArray) { + @Override + public void tabChanged(int index) { + cardLayout.show(centerPane, nameArray[index]); + } + }; + tabPane.setPreferredSize(new Dimension(200, 20)); + } + } + protected List initPaneList(Plot plot, AbstractAttrNoScrollPane parent) { plot4Pane = plot; @@ -99,6 +113,8 @@ public class ChartDataFilterPane extends ThirdTabPane { this.removeAll(); paneList = initPaneList4NoPresent(plot4Pane, parentPane); initAllPane(); + tabPane.setPreferredSize(new Dimension(200, 20)); + centerPane.setPreferredSize(new Dimension(getContentPaneWidth(), 200)); this.validate(); } @@ -160,6 +176,10 @@ public class ChartDataFilterPane extends ThirdTabPane { private PresentComboBox present; private AbstractAttrNoScrollPane parent; + + private JPanel preDataNumPane; + private JPanel presentPane; + public CategoryFilterPane(AbstractAttrNoScrollPane parent) { super(true); this.parent = parent; @@ -175,59 +195,59 @@ public class ChartDataFilterPane extends ThirdTabPane { @Override protected JPanel createContentPane() { this.setLayout(new BorderLayout()); - JPanel pane = new JPanel(); + JPanel pane = initOtherPane(); this.add(pane, BorderLayout.NORTH); - pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS)); - pane.setPreferredSize(new Dimension(200, 110)); - initOtherPane(pane); - initPresentPane(pane); return pane; } - protected void initOtherPane(JPanel pane) { - JPanel prePane = new JPanel(); - prePane.setLayout(new FlowLayout(FlowLayout.LEFT)); - prePane.setPreferredSize(new Dimension(200, 20)); - pane.add(prePane); - onlyPreData = new UICheckBox(Inter.getLocText("FR-Chart-Data_OnlyUseBefore")); + protected JPanel initOtherPane() { + onlyPreData = new UICheckBox(Inter.getLocText("Plugin-ChartF_OnlyUseBeforeRecords")); + JPanel panel1 = new JPanel(new BorderLayout()); + JPanel panel2 = new JPanel(new BorderLayout()); + panel1.add(onlyPreData, BorderLayout.NORTH); preDataNum = new UITextField(); - preDataNum.setPreferredSize(new Dimension(50, 20)); - prePane.add(onlyPreData); - prePane.add(preDataNum); - prePane.add(new BoldFontTextLabel(Inter.getLocText("FR-Chart-Data_Records"))); - JPanel otherPane = new JPanel(); - otherPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0)); - pane.add(otherPane); + UILabel label = new UILabel(Inter.getLocText("Plugin-ChartF_RecordsNum")); combineOther = new UICheckBox(Inter.getLocText("FR-Chart-Data_CombineOther")); combineOther.setSelected(true); - otherPane.add(combineOther); - JPanel catePane = new JPanel(); - pane.add(catePane); - catePane.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0)); + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {p,f}; + double[] rowSize = {p, p}; + Component[][] components = new Component[][]{ + new Component[]{label,preDataNum}, + new Component[]{combineOther,null} + }; + + preDataNumPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + preDataNumPane.setBorder(BorderFactory.createEmptyBorder(0,15,0,0)); + panel1.add(preDataNumPane, BorderLayout.CENTER); notShowNull = new UICheckBox(Inter.getLocText("FR-Chart-Data_NotShowCate")); - catePane.add(notShowNull); + panel2.add(notShowNull, BorderLayout.NORTH); onlyPreData.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { checkBoxUse(); } }); - } - private void initPresentPane(JPanel pane) { - JPanel presentPane = new JPanel(); - presentPane.setLayout(new FlowLayout(FlowLayout.LEFT, 8, 0)); - pane.add(presentPane); present = new PresentComboBox() { protected void fireChange() { fire(); } }; - present.setPreferredSize(new Dimension(70, 20)); - presentPane.add(new BoldFontTextLabel(Inter.getLocText("FR-Chart-Style_Present") + ":")); - presentPane.add(present); + presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("FR-Chart-Style_Present") ,present); + panel2.add(presentPane, BorderLayout.SOUTH); + + double[] column = {f}; + double[] row = {p, p}; + Component[][] coms = new Component[][]{ + new Component[]{panel1}, + new Component[]{panel2} + }; + return TableLayout4VanChartHelper.createGapTableLayoutPane(coms, row,column); } + private void fire() { if (this.parent != null) { this.parent.attributeChanged(); @@ -245,9 +265,7 @@ public class ChartDataFilterPane extends ThirdTabPane { * 检查分类过滤界面 Box是否可用. */ public void checkBoxUse() { - preDataNum.setEnabled(onlyPreData.isSelected()); - combineOther.setEnabled(onlyPreData.isSelected()); - ; + preDataNumPane.setVisible(onlyPreData.isSelected()); } /** @@ -320,6 +338,9 @@ public class ChartDataFilterPane extends ThirdTabPane { private AbstractAttrNoScrollPane parent; + private JPanel preDataNumPane; + private JPanel presentPane; + public SeriesFilterPane(AbstractAttrNoScrollPane parent) { super(true); this.parent = parent; @@ -335,62 +356,60 @@ public class ChartDataFilterPane extends ThirdTabPane { @Override protected JPanel createContentPane() { this.setLayout(new BorderLayout()); - JPanel pane = new JPanel(); + JPanel pane = initOtherPane(); this.add(pane, BorderLayout.NORTH); - pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS)); - pane.setPreferredSize(new Dimension(200, 110)); - initOtherPane(pane); - initPresentPane(pane); return pane; } - protected void initOtherPane(JPanel pane) { - JPanel prePane = new JPanel(); - prePane.setLayout(new FlowLayout(FlowLayout.LEFT)); - prePane.setPreferredSize(new Dimension(200, 20)); - pane.add(prePane); - onlyPreData = new UICheckBox(Inter.getLocText("FR-Chart-Data_OnlyUseBefore")); + protected JPanel initOtherPane() { + onlyPreData = new UICheckBox(Inter.getLocText("Plugin-ChartF_OnlyUseBeforeRecords")); + JPanel panel1 = new JPanel(new BorderLayout()); + JPanel panel2 = new JPanel(new BorderLayout()); + panel1.add(onlyPreData, BorderLayout.NORTH); preDataNum = new UITextField(); - preDataNum.setPreferredSize(new Dimension(50, 20)); - prePane.add(onlyPreData); - prePane.add(preDataNum); - prePane.add(new UILabel(Inter.getLocText("FR-Chart-Data_Records"))); - JPanel otherPane = new JPanel(); - otherPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0)); - pane.add(otherPane); - + UILabel label = new UILabel(Inter.getLocText("Plugin-ChartF_RecordsNum")); combineOther = new UICheckBox(Inter.getLocText("FR-Chart-Data_CombineOther")); combineOther.setSelected(true); - otherPane.add(combineOther); - JPanel catePane = new JPanel(); - pane.add(catePane); + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {p,f}; + double[] rowSize = {p, p}; + Component[][] components = new Component[][]{ + new Component[]{label,preDataNum}, + new Component[]{combineOther,null} + }; - catePane.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0)); + preDataNumPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + preDataNumPane.setBorder(BorderFactory.createEmptyBorder(0,15,0,0)); + panel1.add(preDataNumPane, BorderLayout.CENTER); notShowNull = new UICheckBox(Inter.getLocText("FR-Chart-Data_NotShowSeries")); - catePane.add(notShowNull); + panel2.add(notShowNull, BorderLayout.NORTH); onlyPreData.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { checkBoxUse(); } }); - } - private void initPresentPane(JPanel pane) { - JPanel presentPane = new JPanel(); - presentPane.setLayout(new FlowLayout(FlowLayout.LEFT, 8, 0)); - pane.add(presentPane); present = new PresentComboBox() { protected void fireChange() { fire(); } }; - present.setPreferredSize(new Dimension(70, 20)); - presentPane.add(new BoldFontTextLabel(Inter.getLocText("FR-Chart-Style_Present") + ":")); - presentPane.add(present); + presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("FR-Chart-Style_Present") ,present); + panel2.add(presentPane, BorderLayout.SOUTH); + + double[] column = {f}; + double[] row = {p, p}; + Component[][] coms = new Component[][]{ + new Component[]{panel1}, + new Component[]{panel2} + }; + return TableLayout4VanChartHelper.createGapTableLayoutPane(coms, row,column); } + private void fire() { if (this.parent != null) { parent.attributeChanged(); @@ -409,8 +428,7 @@ public class ChartDataFilterPane extends ThirdTabPane { * 检查Box是否可用 */ public void checkBoxUse() { - preDataNum.setEnabled(onlyPreData.isSelected()); - combineOther.setEnabled(onlyPreData.isSelected()); + preDataNumPane.setVisible(onlyPreData.isSelected()); } /** @@ -480,11 +498,8 @@ public class ChartDataFilterPane extends ThirdTabPane { @Override protected JPanel createContentPane() { this.setLayout(new BorderLayout()); - JPanel pane = new JPanel(); + JPanel pane = new JPanel(new BorderLayout()); this.add(pane, BorderLayout.NORTH); - pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS)); - pane.setPreferredSize(new Dimension(200, 110)); - initOtherPane(pane); return pane; } @@ -516,11 +531,8 @@ public class ChartDataFilterPane extends ThirdTabPane { @Override protected JPanel createContentPane() { this.setLayout(new BorderLayout()); - JPanel pane = new JPanel(); + JPanel pane = initOtherPane(); this.add(pane, BorderLayout.NORTH); - pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS)); - pane.setPreferredSize(new Dimension(200, 110)); - initOtherPane(pane); return pane; } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java index 6c74211b8a..7138071c1a 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java @@ -41,6 +41,8 @@ public class DatabaseTableDataPane extends BasicPane{ pane.add(reviewButton,BorderLayout.EAST); this.add(pane,BorderLayout.CENTER); + + this.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); } /** diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java index 6a33c6df96..8c464454a0 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java @@ -3,13 +3,13 @@ package com.fr.design.mainframe.chart.gui.data; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.constants.LayoutConstants; -import com.fr.design.dialog.BasicScrollPane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; +import com.fr.plugin.chart.designer.AbstractVanChartScrollPane; import javax.swing.*; import java.awt.*; @@ -46,7 +46,12 @@ public class NormalChartDataPane extends DataContentsPane { @Override protected JPanel createContentPane() { - return new BasicScrollPane() { + return new AbstractVanChartScrollPane() { + + protected void layoutContentPane() { + leftcontentPane = createContentPane(); + this.add(leftcontentPane); + } @Override protected JPanel createContentPane() { @@ -56,9 +61,10 @@ public class NormalChartDataPane extends DataContentsPane { this.setLayout(new BorderLayout(LayoutConstants.HGAP_LARGE,6)); JPanel northPane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE,0)); northPane.add(jcb, BorderLayout.CENTER); - UILabel label1 = new UILabel(Inter.getLocText("Chart-Data_Resource") + ":", SwingConstants.RIGHT); + UILabel label1 = new UILabel(Inter.getLocText("Chart-Data_Resource")); label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT)); northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); + northPane.setBorder(BorderFactory.createEmptyBorder(0,10,0,15)); this.add(northPane, BorderLayout.NORTH); this.add(cardPane, BorderLayout.CENTER); diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java index 382ca853d1..081b19db70 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java @@ -1,7 +1,8 @@ package com.fr.design.mainframe.chart.gui.data; import com.fr.base.TableData; -import com.fr.chart.chartattr.*; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.chart.chartattr.Plot; import com.fr.chart.chartdata.TableDataDefinition; import com.fr.chart.chartdata.TopDefinition; import com.fr.data.impl.NameTableData; @@ -11,7 +12,7 @@ import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.design.mainframe.chart.gui.data.table.*; +import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.general.Inter; import javax.swing.*; @@ -35,7 +36,7 @@ public class TableDataPane extends FurtherBasicBeanPane{ } private void initDataPane() { - UILabel label = new BoldFontTextLabel(Inter.getLocText("Chart-DS_TableData") + ":", SwingConstants.RIGHT) ; + UILabel label = new BoldFontTextLabel(Inter.getLocText("Chart-DS_TableData")) ; label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT)); tableDataPane = new DatabaseTableDataPane(label) { @Override @@ -45,9 +46,7 @@ public class TableDataPane extends FurtherBasicBeanPane{ } }; - tableDataPane.setBorder(BorderFactory.createMatteBorder(0,6,0, 0, getBackground())); - tableDataPane.setBorder(BorderFactory.createEmptyBorder(0,1,0,1)); - tableDataPane.setPreferredSize(new Dimension(205 , 20)); + tableDataPane.setPreferredSize(new Dimension(246 , 20)); this.setBorder(BorderFactory.createEmptyBorder(TOP,0,0,0)); this.add(tableDataPane, BorderLayout.NORTH); } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java index 768ecb7e87..35aa92b37e 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java @@ -45,6 +45,7 @@ public abstract class AbstractReportDataContentPane extends BasicBeanPane{ private boolean isNeedSummaryCaculateMethod = true; @@ -134,4 +136,10 @@ public abstract class AbstractTableDataContentPane extends BasicBeanPane { protected void initLayout() { this.setLayout(new BorderLayout(4, LayoutConstants.VGAP_MEDIUM)); JPanel northPane = new JPanel(new BorderLayout(4, 0)); - UILabel label1 = new UILabel(Inter.getLocText("ChartF-Series_Name_From") + ":", SwingConstants.RIGHT); + UILabel label1 = new UILabel(Inter.getLocText("ChartF-Series_Name_From")); label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT)); northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); - northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1)); + northPane.setBorder(BorderFactory.createEmptyBorder(10, 24, 0, 15)); + cardPane.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15)); this.add(northPane, BorderLayout.NORTH); this.add(cardPane, BorderLayout.CENTER); - this.add(dataScreeningPane = new ChartDataFilterPane(this.initplot, parent), BorderLayout.SOUTH); + dataScreeningPane = new ChartDataFilterPane(this.initplot, parent); + JPanel panel = new UIExpandablePane(Inter.getLocText("FR-Chart-Data_Filter"), 290, 24, dataScreeningPane); + this.add(panel, BorderLayout.SOUTH); } /** diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java index 9d3f9756e3..ad03f3c521 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java @@ -39,6 +39,11 @@ public abstract class ThirdTabPane extends BasicBeanPane{ nameArray[i] = np.name; centerPane.add(np.pane, nameArray[i]); } + initTabPane(); + initLayout(); + } + + protected void initTabPane() { if (!paneList.isEmpty()) { tabPane = new UIHeadGroup(nameArray) { @Override @@ -48,8 +53,7 @@ public abstract class ThirdTabPane extends BasicBeanPane{ }; centerPane.setBorder(myBorder); } - initLayout(); - } + } @Override public void paint(Graphics g) { diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java index 007a1490db..f9cda412e5 100644 --- a/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java @@ -6,7 +6,6 @@ import com.fr.chart.chartattr.BubblePlot; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartdata.BubbleTableDefinition; import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -15,6 +14,7 @@ import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; @@ -56,20 +56,19 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon double[] rowSize_north = {p, p, p, p}; Component[][] components_north = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Chart-Series_Name")+":", SwingConstants.RIGHT), seriesName}, - new Component[]{new UILabel("x :", SwingConstants.RIGHT), xCombox}, - new Component[]{new UILabel("y :", SwingConstants.RIGHT), yCombox}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")+":", SwingConstants.RIGHT), bubbleSize}, + new Component[]{new UILabel(Inter.getLocText("Chart-Series_Name")), seriesName}, + new Component[]{new UILabel("x" ), xCombox}, + new Component[]{new UILabel("y"), yCombox}, + new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), bubbleSize}, }; JPanel north = TableLayoutHelper.createTableLayoutPane(components_north,rowSize_north,columnSize_north); - north.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1)); + north.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15)); + JPanel filterPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),dataScreeningPane); Component[][] components = new Component[][]{ new Component[]{north}, - new Component[]{new JSeparator()}, - new Component[]{new BoldFontTextLabel(Inter.getLocText("Chart-Data_Filter"))}, - new Component[]{dataScreeningPane} + new Component[]{filterPane} }; diff --git a/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartScrollPane.java b/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartScrollPane.java index 7d9eae143f..4ca6938601 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartScrollPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartScrollPane.java @@ -27,4 +27,8 @@ public abstract class AbstractVanChartScrollPane extends BasicScrollPane { leftcontentPane.setBounds(0, 0, width, height); } } + public void reloaPane(JPanel pane){ + super.reloaPane(pane); + leftcontentPane.setBorder(BorderFactory.createEmptyBorder()); + } } diff --git a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/GanttPlotReportDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/GanttPlotReportDataContentPane.java index 92f6d939c5..2401deca7b 100644 --- a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/GanttPlotReportDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/GanttPlotReportDataContentPane.java @@ -5,6 +5,7 @@ import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPa import com.fr.plugin.chart.gantt.designer.data.data.component.GanttReportDataContentPane; import com.fr.plugin.chart.gantt.designer.data.data.component.GanttReportDataProjectPane; +import javax.swing.*; import java.awt.*; /** @@ -18,6 +19,7 @@ public class GanttPlotReportDataContentPane extends AbstractReportDataContentPan public GanttPlotReportDataContentPane() { initComponent(); this.setLayout(new BorderLayout(0, V_GAP)); + projectPane.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); this.add(projectPane, BorderLayout.NORTH); this.add(contentPane, BorderLayout.CENTER); } diff --git a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/GanttPlotTableDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/GanttPlotTableDataContentPane.java index b07f637098..4af06f8c69 100644 --- a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/GanttPlotTableDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/GanttPlotTableDataContentPane.java @@ -5,6 +5,7 @@ import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane import com.fr.plugin.chart.gantt.designer.data.data.component.GanttTableDataContentPane; import com.fr.plugin.chart.gantt.designer.data.data.component.GanttTableDataProjectPane; +import javax.swing.*; import java.awt.*; import java.util.List; @@ -19,8 +20,10 @@ public class GanttPlotTableDataContentPane extends AbstractTableDataContentPane public GanttPlotTableDataContentPane() { initComponent(); this.setLayout(new BorderLayout(0, V_GAP)); + projectPane.setBorder(BorderFactory.createEmptyBorder(0,17,0,15)); this.add(projectPane, BorderLayout.NORTH); - this.add(contentPane, BorderLayout.CENTER); + this.add(new JSeparator(), BorderLayout.CENTER); + this.add(contentPane, BorderLayout.SOUTH); } private void initComponent() { diff --git a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java index bd1d887139..54bb8cb826 100644 --- a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java +++ b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java @@ -33,7 +33,7 @@ public abstract class ComboBoxWithButtonPane extends JPanel { button.setPreferredSize(new Dimension(20, 20)); button.addActionListener(getButtonListener()); - UILabel title = new UILabel(getTitleText(), SwingConstants.RIGHT); + UILabel title = new UILabel(getTitleText()); title.setPreferredSize(new Dimension(60, 20)); this.setLayout(new BorderLayout(H_GAP, 0)); diff --git a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java index f87c8e1626..24c85d96e3 100644 --- a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java @@ -28,7 +28,11 @@ public class GanttReportDataContentPane extends AbstractReportDataContentPane{ public GanttReportDataContentPane() { this.setLayout(new BorderLayout()); initAllComponent(); - this.add(getContentPane(), BorderLayout.CENTER); + JPanel panel = getContentPane(); + panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); + this.add(panel, BorderLayout.CENTER); + this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight())); + } private void initAllComponent() { @@ -51,7 +55,7 @@ public class GanttReportDataContentPane extends AbstractReportDataContentPane{ protected void initLayout() { this.setLayout(new BorderLayout(4, 0)); - UILabel label = new UILabel(title + ":", SwingConstants.RIGHT); + UILabel label = new UILabel(title); label.setPreferredSize(new Dimension(75, 20)); this.add(label, BorderLayout.WEST); diff --git a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttTableDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttTableDataContentPane.java index 570199b4c2..ff2aaee225 100644 --- a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttTableDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttTableDataContentPane.java @@ -33,29 +33,27 @@ public class GanttTableDataContentPane extends AbstractTableDataContentPane{ public GanttTableDataContentPane() { this.setLayout(new BorderLayout()); initAllComponent(); - this.add(getContentPane(), BorderLayout.CENTER); + JPanel panel = getContentPane(); + panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); + this.add(panel, BorderLayout.CENTER); + this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight())); + } private void initAllComponent() { seriesComboBox = new UIComboBox(); - seriesComboBox.setPreferredSize(new Dimension(100,20)); startTimeComboBox = new UIComboBox(); - startTimeComboBox.setPreferredSize(new Dimension(100,20)); endTimeComboBox = new UIComboBox(); - endTimeComboBox.setPreferredSize(new Dimension(100,20)); markerTimeComboBox = new UIComboBox(); - markerTimeComboBox.setPreferredSize(new Dimension(100,20)); markerTimeComboBox.addItem(NONE); processComboBox = new UIComboBox(); - processComboBox.setPreferredSize(new Dimension(100,20)); processComboBox.addItem(NONE); taskIDComboBox = new UIComboBox(); - taskIDComboBox.setPreferredSize(new Dimension(100,20)); taskIDComboBox.addItem(NONE); taskIDComboBox.setToolTipText(Inter.getLocText("Plugin-ChartF_Task_ID_Tooltip")); } @@ -67,15 +65,15 @@ public class GanttTableDataContentPane extends AbstractTableDataContentPane{ double[] col = {p,f}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Chart-Series_Name")+":", SwingConstants.RIGHT), seriesComboBox}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Start_Time")+":", SwingConstants.RIGHT), startTimeComboBox}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_End_Time")+":", SwingConstants.RIGHT), endTimeComboBox}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Marker_Time")+":", SwingConstants.RIGHT), markerTimeComboBox}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Process")+":", SwingConstants.RIGHT), processComboBox}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Task_ID")+":", SwingConstants.RIGHT), taskIDComboBox} + new Component[]{new UILabel(Inter.getLocText("Chart-Series_Name")), seriesComboBox}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Start_Time")), startTimeComboBox}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_End_Time")), endTimeComboBox}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Marker_Time")), markerTimeComboBox}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Process")), processComboBox}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Task_ID")), taskIDComboBox} }; - return TableLayoutHelper.createTableLayoutPane(components, row, col); + return TableLayoutHelper.createGapTableLayoutPane(components, row, col,24,6); } @Override diff --git a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java index 5714b22e6a..76e8f09ee1 100644 --- a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java +++ b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java @@ -38,7 +38,7 @@ public class GanttTableDataProjectPane extends AbstractTableDataContentPane impl projectName = new ComboBoxWithButtonPane(){ @Override protected String getTitleText() { - return Inter.getLocText("Plugin-ChartF_Project_Name") + ":"; + return Inter.getLocText("Plugin-ChartF_Project_Name"); } @Override diff --git a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java index 014893f9ac..1cb2416156 100644 --- a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java +++ b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java @@ -27,7 +27,7 @@ public abstract class TinyFormulaWithButtonPane extends JPanel implements UIObse } public TinyFormulaWithButtonPane(String text, String iconUrl) { - editLabel = new UIEditLabel(text,SwingConstants.RIGHT){ + editLabel = new UIEditLabel(text,SwingConstants.LEFT){ protected void doAfterMousePress(){ clearAllBackground(); } diff --git a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/link/GanttLinkReportDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/link/GanttLinkReportDataContentPane.java index 31ca34d0e6..ad32fd1433 100644 --- a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/link/GanttLinkReportDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/link/GanttLinkReportDataContentPane.java @@ -25,8 +25,9 @@ public class GanttLinkReportDataContentPane extends AbstractReportDataContentPan public GanttLinkReportDataContentPane() { this.setLayout(new BorderLayout()); initAllComponent(); - this.add(getContentPane(), BorderLayout.CENTER); - } + JPanel panel = getContentPane(); + panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); + this.add(panel, BorderLayout.CENTER); } private void initAllComponent() { startTaskID = createTinyFormulaPaneWithTitle(Inter.getLocText("Plugin-ChartF_Start_Task_ID")); @@ -42,7 +43,7 @@ public class GanttLinkReportDataContentPane extends AbstractReportDataContentPan protected void initLayout() { this.setLayout(new BorderLayout(4, 0)); - UILabel label = new UILabel(title + ":", SwingConstants.RIGHT); + UILabel label = new UILabel(title ); label.setPreferredSize(new Dimension(75, 20)); this.add(label, BorderLayout.WEST); diff --git a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/link/GanttLinkTableDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/link/GanttLinkTableDataContentPane.java index e760e9cd24..f3d627bdc1 100644 --- a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/link/GanttLinkTableDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/link/GanttLinkTableDataContentPane.java @@ -8,7 +8,6 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.general.Inter; -import com.fr.plugin.chart.gantt.data.VanGanttDefinitionHelper; import com.fr.plugin.chart.gantt.data.VanGanttLinkTableDefinition; import com.fr.plugin.chart.gantt.designer.data.data.GanttDataPaneHelper; import com.fr.stable.StringUtils; @@ -28,18 +27,19 @@ public class GanttLinkTableDataContentPane extends AbstractTableDataContentPane public GanttLinkTableDataContentPane() { this.setLayout(new BorderLayout()); initAllComponent(); - this.add(getContentPane(), BorderLayout.CENTER); + JPanel panel = getContentPane(); + panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); + this.add(panel, BorderLayout.CENTER); + this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight())); + } private void initAllComponent() { startTaskIDComboBox = new UIComboBox(); - startTaskIDComboBox.setPreferredSize(new Dimension(100,20)); endTaskIDComboBox = new UIComboBox(); - endTaskIDComboBox.setPreferredSize(new Dimension(100,20)); linkTypeComboBox = new UIComboBox(); - linkTypeComboBox.setPreferredSize(new Dimension(100,20)); } @@ -50,12 +50,12 @@ public class GanttLinkTableDataContentPane extends AbstractTableDataContentPane double[] col = {p,f}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Start_Task_ID")+":", SwingConstants.RIGHT), startTaskIDComboBox}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_End_Task_ID")+":", SwingConstants.RIGHT), endTaskIDComboBox}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Link_Type")+":", SwingConstants.RIGHT), linkTypeComboBox} + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Start_Task_ID")), startTaskIDComboBox}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_End_Task_ID")), endTaskIDComboBox}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Link_Type")), linkTypeComboBox} }; - return TableLayoutHelper.createTableLayoutPane(components, row, col); + return TableLayoutHelper.createGapTableLayoutPane(components, row, col,24,6); } @Override diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/report/AreaPane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/report/AreaPane.java index 7e10def23d..f7714b4e42 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/report/AreaPane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/report/AreaPane.java @@ -31,7 +31,7 @@ public class AreaPane extends AbstractReportDataContentPane { double[] columnSize = {p, f}; double[] rowSize = {p}; Component[][] components = new Component[][]{ - new Component[]{new BoldFontTextLabel(Inter.getLocText("FR-Chart-Area_Name") + ":", SwingConstants.RIGHT), areaName} + new Component[]{new BoldFontTextLabel(Inter.getLocText("FR-Chart-Area_Name")), areaName} }; return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); } diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/report/LineMapAreaPane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/report/LineMapAreaPane.java index d342c62c11..43f09c6f0e 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/report/LineMapAreaPane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/report/LineMapAreaPane.java @@ -2,8 +2,8 @@ package com.fr.plugin.chart.map.designer.data.component.report; import com.fr.general.Inter; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.plugin.chart.map.designer.data.component.LongitudeLatitudeAndArea; import com.fr.plugin.chart.map.data.VanMapReportDefinition; +import com.fr.plugin.chart.map.designer.data.component.LongitudeLatitudeAndArea; import javax.swing.*; import java.awt.*; @@ -19,8 +19,8 @@ public class LineMapAreaPane extends PointMapAreaPane { protected JPanel createContentPane() { initAreaPane(); initEndAreaPane(); - JPanel panel1 = TableLayout4VanChartHelper.createTitlePane(Inter.getLocText("Plugin-ChartF_Start_Point")+":", areaPane, LEFT_GAP); - JPanel panel2 = TableLayout4VanChartHelper.createTitlePane(Inter.getLocText("Plugin-ChartF_End_Point")+":", endAreaPane, LEFT_GAP); + JPanel panel1 = TableLayout4VanChartHelper.createTitlePane(Inter.getLocText("Plugin-ChartF_Start_Point"), areaPane, LEFT_GAP); + JPanel panel2 = TableLayout4VanChartHelper.createTitlePane(Inter.getLocText("Plugin-ChartF_End_Point"), endAreaPane, LEFT_GAP); JPanel content = new JPanel(new BorderLayout(0, V_GAP)); content.add(panel1, BorderLayout.NORTH); diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/report/LongLatAreaPane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/report/LongLatAreaPane.java index f8123f7865..40191317d4 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/report/LongLatAreaPane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/report/LongLatAreaPane.java @@ -34,11 +34,11 @@ public class LongLatAreaPane extends AreaPane { double[] columnSize = {p, f}; double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ - new Component[]{new BoldFontTextLabel(Inter.getLocText("Plugin-ChartF_Longitude") + ":", SwingConstants.RIGHT), longitude}, - new Component[]{new BoldFontTextLabel(Inter.getLocText("Plugin-ChartF_Latitude") + ":", SwingConstants.RIGHT), latitude}, - new Component[]{new BoldFontTextLabel(Inter.getLocText("FR-Chart-Area_Name") + ":", SwingConstants.RIGHT), areaName} + new Component[]{new BoldFontTextLabel(Inter.getLocText("Plugin-ChartF_Longitude")), longitude}, + new Component[]{new BoldFontTextLabel(Inter.getLocText("Plugin-ChartF_Latitude")), latitude}, + new Component[]{new BoldFontTextLabel(Inter.getLocText("FR-Chart-Area_Name")), areaName} }; - return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); + return TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,50,6); } @Override diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/table/AreaPane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/table/AreaPane.java index f9dd177924..96557be51f 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/table/AreaPane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/table/AreaPane.java @@ -46,9 +46,9 @@ public class AreaPane extends AbstractTableDataContentPane { double[] columnSize = {p, f}; double[] rowSize = {p}; Component[][] components = new Component[][]{ - new Component[]{new BoldFontTextLabel(Inter.getLocText("FR-Chart-Area_Name") + ":", SwingConstants.RIGHT), areaNameCom} + new Component[]{new BoldFontTextLabel(Inter.getLocText("FR-Chart-Area_Name")), areaNameCom} }; - return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); + return TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,50,6); } protected void initAreaNameCom() { diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/table/LineMapAreaPane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/table/LineMapAreaPane.java index 867417e36c..d28defd399 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/table/LineMapAreaPane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/table/LineMapAreaPane.java @@ -2,8 +2,8 @@ package com.fr.plugin.chart.map.designer.data.component.table; import com.fr.general.Inter; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.plugin.chart.map.designer.data.component.LongitudeLatitudeAndArea; import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; +import com.fr.plugin.chart.map.designer.data.component.LongitudeLatitudeAndArea; import com.fr.plugin.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane; import javax.swing.*; @@ -25,8 +25,8 @@ public class LineMapAreaPane extends PointMapAreaPane { initAreaPane(parentPane); initEndAreaPane(parentPane); - JPanel startPane = TableLayout4VanChartHelper.createTitlePane(Inter.getLocText("Plugin-ChartF_Start_Point")+":", areaPane, LEFT_GAP); - JPanel endPane = TableLayout4VanChartHelper.createTitlePane(Inter.getLocText("Plugin-ChartF_End_Point")+":", endAreaPane, LEFT_GAP); + JPanel startPane = TableLayout4VanChartHelper.createTitlePane(Inter.getLocText("Plugin-ChartF_Start_Point"), areaPane, LEFT_GAP); + JPanel endPane = TableLayout4VanChartHelper.createTitlePane(Inter.getLocText("Plugin-ChartF_End_Point"), endAreaPane, LEFT_GAP); JPanel content = new JPanel(new BorderLayout(0, V_GAP)); content.add(startPane, BorderLayout.NORTH); diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/table/LongLatAreaPane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/table/LongLatAreaPane.java index 21a8cfbdc5..23b0dc7735 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/table/LongLatAreaPane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/data/component/table/LongLatAreaPane.java @@ -36,12 +36,12 @@ public class LongLatAreaPane extends AreaPane { double[] columnSize = {p, f}; double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ - new Component[]{new BoldFontTextLabel(Inter.getLocText("Plugin-ChartF_Longitude") + ":", SwingConstants.RIGHT), longitudeCom}, - new Component[]{new BoldFontTextLabel(Inter.getLocText("Plugin-ChartF_Latitude") + ":", SwingConstants.RIGHT), latitudeCom}, - new Component[]{new BoldFontTextLabel(Inter.getLocText("FR-Chart-Area_Name") + ":", SwingConstants.RIGHT), areaNameCom} + new Component[]{new BoldFontTextLabel(Inter.getLocText("Plugin-ChartF_Longitude")), longitudeCom}, + new Component[]{new BoldFontTextLabel(Inter.getLocText("Plugin-ChartF_Latitude")), latitudeCom}, + new Component[]{new BoldFontTextLabel(Inter.getLocText("FR-Chart-Area_Name")), areaNameCom} }; - return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); + return TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,50,6); } public void refreshBoxListWithSelectTableData(List list) { diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java index bfb382e627..ba183ef56e 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java @@ -25,6 +25,7 @@ public class VanAreaMapPlotReportDataContentPane extends AbstractReportDataConte initAreaName(); this.add(getContent(), "0,0,2,0"); + this.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); } protected void initAreaName() { @@ -33,7 +34,7 @@ public class VanAreaMapPlotReportDataContentPane extends AbstractReportDataConte protected void initLayout() { this.setLayout(new BorderLayout(4, 0)); - UILabel label = new UILabel(Inter.getLocText("FR-Chart-Area_Name") + ":", SwingConstants.RIGHT); + UILabel label = new UILabel(Inter.getLocText("FR-Chart-Area_Name")); label.setPreferredSize(new Dimension(75, 20)); this.add(label, BorderLayout.WEST); diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java index 067e312bdf..50b86590c2 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java @@ -2,6 +2,9 @@ package com.fr.plugin.chart.map.designer.data.contentpane.report; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.general.Inter; import com.fr.plugin.chart.map.data.VanMapReportDefinition; @@ -48,6 +51,10 @@ public class VanPointMapPlotReportDataContentPane extends VanAreaMapPlotReportDa //================================public class=================================== public class LongLatReportFormulaPane extends BasicBeanPane { + + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + private UIButtonGroup locationType; private JPanel centerPane; @@ -85,7 +92,17 @@ public class VanPointMapPlotReportDataContentPane extends VanAreaMapPlotReportDa locationType.setSelectedIndex(0); - this.add(locationType, BorderLayout.NORTH); + double[] columnSize = {p, f}; + double[] rowSize = {p}; + + Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Geographical_Position")),locationType}, + }; + + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,30,6); + + + this.add(panel, BorderLayout.NORTH); this.add(centerPane, BorderLayout.CENTER); } diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java index f3f5add45b..4f978fb4a8 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java @@ -5,9 +5,10 @@ import com.fr.chart.chartattr.ChartCollection; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; -import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; @@ -33,11 +34,16 @@ public class VanAreaMapPlotTableDataContentPane extends AbstractTableDataContent initAreaNameCom(); JPanel areaNamePane = createAreaNamePane(); + JSeparator jSeparator = new JSeparator(); + areaNamePane.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); + jSeparator.setPreferredSize(new Dimension(246,2)); - this.add(areaNamePane, BorderLayout.CENTER); + this.add(areaNamePane, BorderLayout.NORTH); + this.add(jSeparator, BorderLayout.CENTER); seriesTypeUseComboxPane = new SeriesTypeUseComboxPaneWithOutFilter(parent, new VanChartMapPlot()); this.add(seriesTypeUseComboxPane, BorderLayout.SOUTH); + } protected void initAreaNameCom() { @@ -53,14 +59,21 @@ public class VanAreaMapPlotTableDataContentPane extends AbstractTableDataContent } protected JPanel createAreaNamePane() { - JPanel areaNamePane = new JPanel(new BorderLayout(4, 0)); - areaNamePane.setBorder(BorderFactory.createMatteBorder(0, 0, 6, 1, getBackground())); - UILabel label = new BoldFontTextLabel(Inter.getLocText("FR-Chart-Area_Name") + ":", SwingConstants.RIGHT); - label.setPreferredSize(new Dimension(75, 20)); + UILabel label = new BoldFontTextLabel(Inter.getLocText("FR-Chart-Area_Name")); + label.setPreferredSize(new Dimension(80, 20)); areaNameCom.setPreferredSize(new Dimension(100, 20)); - areaNamePane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{areaNameCom, null, null, label, null})); - return areaNamePane; + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {p, f}; + double[] rowSize = {p}; + + Component[][] components = new Component[][]{ + new Component[]{label, areaNameCom}, + }; + + return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + } protected void makeToolTipUse(UIComboBox comBox) { diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java index b5ab74fa6b..67bc3dd42b 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java @@ -2,6 +2,9 @@ package com.fr.plugin.chart.map.designer.data.contentpane.table; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.general.Inter; import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; @@ -80,6 +83,10 @@ public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableData public LongLatAreaTableComboPane() { + + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + this.setLayout(new BorderLayout(0, 5)); centerPane = new JPanel(new CardLayout()){ @Override @@ -110,7 +117,15 @@ public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableData locationType.setSelectedIndex(0); - this.add(locationType, BorderLayout.NORTH); + double[] columnSize = {p, f}; + double[] rowSize = {p}; + Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Geographical_Position")),locationType}, + }; + + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,30,6); + + this.add(panel, BorderLayout.NORTH); this.add(centerPane, BorderLayout.CENTER); } diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/other/VanChartMapConditionAttrContentPane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/other/VanChartMapConditionAttrContentPane.java index 3a9783bde7..547241ef52 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/other/VanChartMapConditionAttrContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/other/VanChartMapConditionAttrContentPane.java @@ -3,14 +3,18 @@ package com.fr.plugin.chart.map.designer.other; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionCollection; import com.fr.design.condition.ConditionAttributesPane; -import com.fr.plugin.chart.designer.other.AbstractConditionAttrContentPane; import com.fr.plugin.chart.designer.other.VanChartConditionAttrContentPane; -import com.fr.plugin.chart.map.designer.other.condition.pane.*; -import com.fr.plugin.chart.type.MapMarkerType; -import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.designer.VanMapAreaAndPointGroupPane; import com.fr.plugin.chart.map.designer.VanMapAreaPointAndLineGroupPane; +import com.fr.plugin.chart.map.designer.other.condition.pane.VanChartBubblePointMapConditionPane; +import com.fr.plugin.chart.map.designer.other.condition.pane.VanChartCommonPointMapConditionPane; +import com.fr.plugin.chart.map.designer.other.condition.pane.VanChartDefaultPointMapConditionPane; +import com.fr.plugin.chart.map.designer.other.condition.pane.VanChartImagePointMapConditionPane; +import com.fr.plugin.chart.map.designer.other.condition.pane.VanChartLineMapConditionPane; +import com.fr.plugin.chart.map.designer.other.condition.pane.VanChartMapConditionPane; +import com.fr.plugin.chart.type.MapMarkerType; +import com.fr.plugin.chart.type.MapType; import javax.swing.*; import java.awt.*; @@ -19,7 +23,7 @@ import java.awt.*; * Created by Mitisky on 16/5/23. * 组合地图时有两个 */ -public class VanChartMapConditionAttrContentPane extends AbstractConditionAttrContentPane { +public class VanChartMapConditionAttrContentPane extends VanChartConditionAttrContentPane { private VanChartConditionAttrContentPane pointConditionPane; private VanChartConditionAttrContentPane areaConditionPane; private VanChartConditionAttrContentPane lineConditionPane; diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/other/VanChartMapConditionAttrPane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/other/VanChartMapConditionAttrPane.java index 3a1089c302..14009eb6de 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/other/VanChartMapConditionAttrPane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/other/VanChartMapConditionAttrPane.java @@ -1,13 +1,13 @@ package com.fr.plugin.chart.map.designer.other; -import com.fr.plugin.chart.designer.other.AbstractConditionAttrContentPane; +import com.fr.plugin.chart.designer.other.VanChartConditionAttrContentPane; import com.fr.plugin.chart.designer.other.VanChartConditionAttrPane; /** * Created by Mitisky on 16/5/20. */ public class VanChartMapConditionAttrPane extends VanChartConditionAttrPane{ - protected AbstractConditionAttrContentPane createConditionAttrContentPane() { + protected VanChartConditionAttrContentPane createConditionAttrContentPane() { return new VanChartMapConditionAttrContentPane(); } } diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/other/VanChartMapInteractivePane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/other/VanChartMapInteractivePane.java index 36c3d5fc85..e732825692 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/other/VanChartMapInteractivePane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/other/VanChartMapInteractivePane.java @@ -2,15 +2,14 @@ package com.fr.plugin.chart.map.designer.other; import com.fr.chart.chartattr.Plot; import com.fr.general.Inter; -import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.designer.PlotFactory; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.other.AutoRefreshPane; import com.fr.plugin.chart.designer.other.AutoRefreshPaneWithoutTooltip; import com.fr.plugin.chart.designer.other.VanChartInteractivePaneWithMapZoom; -import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.map.VanChartMapPlot; +import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.vanchart.VanChart; import javax.swing.*; @@ -24,7 +23,7 @@ public class VanChartMapInteractivePane extends VanChartInteractivePaneWithMapZo @Override protected JPanel createHyperlinkPane() { hyperlinkPane = new VanChartMapHyperLinkPane(); - return TableLayout4VanChartHelper.createTitlePane(Inter.getLocText("M_Insert-Hyperlink"), hyperlinkPane, HYPERLINK_LEFT_GAP); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("M_Insert-Hyperlink"), hyperlinkPane); } @Override protected void populateHyperlink(Plot plot) { diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java index 0d401855a7..cb3980d491 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java @@ -7,6 +7,7 @@ import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.FRTreeComboBox; import com.fr.design.gui.icombobox.UIComboBox; @@ -81,7 +82,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { private UITextArea attribution; private UIComboBox zoomLevel; - private UIComboBox viewCenterCom; + private UIButtonGroup viewCenterCom; private JPanel longAndLatPane; private UISpinner longitude; private UISpinner latitude; @@ -112,18 +113,20 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { public VanChartMapSourceChoosePane() { this.setLayout(new BorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(10,0,0,10)); + this.setBorder(BorderFactory.createEmptyBorder(10,0,0,0)); double p = TableLayout.PREFERRED; - double[] columnSize = {226}; + double[] columnSize = {246}; double[] rowSize = {p,p,p,p,p,p,p,p}; + JPanel panel = new JPanel(new BorderLayout()); + panel.add(createMapSourcesPane(), BorderLayout.NORTH); + panel.add(createGISLayerPane(), BorderLayout.CENTER); + + JPanel BasePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Designer_Basic"), panel); + Component[][] comps = new Component[][]{ - new Component[]{new JSeparator()}, - new Component[]{createMapSourcesPane()}, - new Component[]{new JSeparator()}, - new Component[]{createGISLayerPane()}, - new Component[]{new JSeparator()}, + new Component[]{BasePane}, new Component[]{createMapInitStatusPane()} }; JPanel contentPane = TableLayoutHelper.createTableLayoutPane(comps,rowSize,columnSize); @@ -190,7 +193,17 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { sourceComboBox.addPopupMenuListener(popupMenuListener); sourceTitleLabel = createSourceTitleLabel(); - return TableLayout4VanChartHelper.createTableLayoutPaneWithUILabel(sourceTitleLabel, sourceComboBox); + + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {p, f}; + double[] rowSize = {p,p}; + Component[][] components = new Component[][]{ + new Component[]{null,null}, + new Component[]{sourceTitleLabel,sourceComboBox}, + + }; + return TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize, columnSize); } private JPanel createGISLayerPane() { @@ -259,7 +272,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { panel.add(gisLayer, BorderLayout.CENTER); panel.add(layerCardPane, BorderLayout.SOUTH); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Gis_Layer"), panel); + return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_Gis_Layer"), panel); } private JPanel createCustomTileLayer() { @@ -391,24 +404,26 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { private JPanel createMapInitStatusPane() { zoomLevel = new UIComboBox(ZOOM_LEVELS); - viewCenterCom = new UIComboBox(new String[]{AUTO_CENTER_STRING, CUSTOM_CENTER_STRING}); + viewCenterCom = new UIButtonGroup(new String[]{AUTO_CENTER_STRING, CUSTOM_CENTER_STRING}); longitude = new UISpinner(-Double.MAX_VALUE,Double.MAX_VALUE,1,0.0); latitude = new UISpinner(-Double.MAX_VALUE,Double.MAX_VALUE,1,0.0); double p = TableLayout.PREFERRED; - double[] rowSize = {p,p}; + double[] rowSize = {p,p,p}; Component[][] comps = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Zoom_Layer"), SwingConstants.RIGHT), zoomLevel}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_View_Center"), SwingConstants.RIGHT), viewCenterCom}, + new Component[]{null, null}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Zoom_Layer")), zoomLevel}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_View_Center")), viewCenterCom}, }; - final JPanel northPane = TableLayoutHelper.createTableLayoutPane(comps,rowSize,COLUMN_SIZE); + final JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps,rowSize,COLUMN_SIZE); Component[][] longAndLatComps = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Longitude"), SwingConstants.RIGHT), longitude}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Latitude"), SwingConstants.RIGHT), latitude} + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Longitude")), longitude}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Latitude")), latitude} }; - longAndLatPane = TableLayoutHelper.createTableLayoutPane(longAndLatComps,rowSize,COLUMN_SIZE); + longAndLatPane =TableLayout4VanChartHelper.createGapTableLayoutPane(longAndLatComps,rowSize,COLUMN_SIZE); + longAndLatPane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0)); longAndLatPane.setVisible(false); JPanel contentPane = new JPanel(new BorderLayout(0, 6)){ @@ -425,17 +440,17 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { contentPane.add(northPane, BorderLayout.NORTH); contentPane.add(longAndLatPane, BorderLayout.CENTER); - viewCenterCom.addItemListener(new ItemListener() { + viewCenterCom.addActionListener(new ActionListener() { @Override - public void itemStateChanged(ItemEvent e) { + public void actionPerformed(ActionEvent e) { longAndLatPane.setVisible(!isAutoViewCenter()); } }); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Map_Init_Status"), contentPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Map_Init_Status"), contentPane); } private boolean isAutoViewCenter() { - return ComparatorUtils.equals(viewCenterCom.getSelectedItem(), AUTO_CENTER_STRING); + return viewCenterCom.getSelectedIndex()==0; } private PopupMenuListener popupMenuListener = new PopupMenuListener() { @@ -534,7 +549,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { private void resetViewCenter(VanChartMapPlot mapPlot) { mapPlot.getViewCenter().setAuto(true); - viewCenterCom.setSelectedItem(AUTO_CENTER_STRING); + viewCenterCom.setSelectedIndex(0); } private void resetZoomLevel(VanChartMapPlot mapPlot) { @@ -575,15 +590,17 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { ViewCenter viewCenter = mapPlot.getViewCenter(); if(viewCenter.isAuto()){ - viewCenterCom.setSelectedItem(AUTO_CENTER_STRING); + viewCenterCom.setSelectedIndex(0); longitude.setValue(0); latitude.setValue(0); } else { - viewCenterCom.setSelectedItem(CUSTOM_CENTER_STRING); + viewCenterCom.setSelectedIndex(1); longitude.setValue(viewCenter.getLongitude()); latitude.setValue(viewCenter.getLatitude()); } + longAndLatPane.setVisible(!isAutoViewCenter()); + checkLayerCardPane(); } diff --git a/designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotReportDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotReportDataContentPane.java index 80e3b4d284..6933d39d5a 100644 --- a/designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotReportDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotReportDataContentPane.java @@ -62,7 +62,7 @@ public class MultiPiePlotReportDataContentPane extends AbstractReportDataContent double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize_north = {p, f}; - double[] rowSize_north = {p, p}; + double[] rowSize_north = {p, p, p}; levelNumEdit = new UISpinner(1, 15, 1, levelNum){ @Override @@ -87,8 +87,9 @@ public class MultiPiePlotReportDataContentPane extends AbstractReportDataContent nameField.setPreferredSize(new Dimension(WD, HT)); Component[][] components_north = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Level_Number")+":", SwingConstants.RIGHT), levelNumEdit}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name")+":", SwingConstants.RIGHT), nameField}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name")), nameField}, + new Component[]{new JSeparator(), null}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Level_Number")), levelNumEdit}, }; return TableLayoutHelper.createTableLayoutPane(components_north, rowSize_north, columnSize_north); @@ -115,22 +116,23 @@ public class MultiPiePlotReportDataContentPane extends AbstractReportDataContent double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize_center = {p, f}; - double[] rowSize_center = new double[levelNum + 1]; + double[] rowSize_center = new double[levelNum + 2]; initLevelNameList(); - for (int i = 0; i < levelNum + 1; i++){ + for (int i = 0; i < levelNum + 2; i++){ rowSize_center[i] = p; } - Component[][] components_center = new Component[levelNum + 1][]; + Component[][] components_center = new Component[levelNum + 2][]; for (int i = 0; i < levelNum; i++){ - components_center[i] = new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Level") + String.valueOf(i+1) +":", SwingConstants.RIGHT), levelNameList.get(i)}; + components_center[i] = new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Level") + String.valueOf(i+1)), levelNameList.get(i)}; } value = new TinyFormulaPane(); - components_center[levelNum] = new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")+":", SwingConstants.RIGHT), value}; + components_center[levelNum] = new Component[]{new JSeparator(), null}; + components_center[levelNum+1] = new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), value}; registerListener4Center(); diff --git a/designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotTableDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotTableDataContentPane.java index 6953a94907..a82873aaaa 100644 --- a/designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotTableDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotTableDataContentPane.java @@ -84,17 +84,17 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize_center = {p, f}; - double[] rowSize_center = new double[levelNum + 2]; + double[] rowSize_center = new double[levelNum + 3]; initLevelNameList(); - for (int i = 0; i < levelNum + 2; i++){ + for (int i = 0; i < levelNum + 3; i++){ rowSize_center[i] = p; } - Component[][] components_center = new Component[levelNum + 2][]; + Component[][] components_center = new Component[levelNum + 3][]; for (int i = 0; i < levelNum; i++){ - components_center[i] = new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Level") + String.valueOf(i+1) +":", SwingConstants.RIGHT), levelNameList.get(i)}; + components_center[i] = new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Level") + String.valueOf(i+1)), levelNameList.get(i)}; } value = new UIComboBox(); @@ -103,8 +103,9 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa calculateCombox.reset(); calculateCombox.setPreferredSize(new Dimension(WD, HT)); - components_center[levelNum] = new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")+":", SwingConstants.RIGHT), value}; - components_center[levelNum+1] = new Component[]{new UILabel(Inter.getLocText("Chart-Summary_Method") + ":", SwingConstants.RIGHT), calculateCombox}; + components_center[levelNum] = new Component[]{new JSeparator(), null}; + components_center[levelNum+1] = new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), value}; + components_center[levelNum+2] = new Component[]{new UILabel(Inter.getLocText("Chart-Summary_Method")), calculateCombox}; initCenterItemListener(); @@ -147,7 +148,7 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize_north = {p, f}; - double[] rowSize_north = {p, p}; + double[] rowSize_north = {p, p, p}; levelNumEdit = new UISpinner(1, 15, 1, levelNum){ @Override @@ -173,8 +174,9 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa nameField.setPreferredSize(new Dimension(WD, HT)); Component[][] components_north = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Level_Number")+":", SwingConstants.RIGHT), levelNumEdit}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name")+":", SwingConstants.RIGHT), nameField}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name")), nameField}, + new Component[]{new JSeparator(),null }, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Level_Number")), levelNumEdit}, }; return TableLayoutHelper.createTableLayoutPane(components_north, rowSize_north, columnSize_north); diff --git a/designer_chart/src/com/fr/plugin/chart/structure/desinger/data/StructurePlotReportDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/structure/desinger/data/StructurePlotReportDataContentPane.java index f5d611ee12..feeecf8b2a 100644 --- a/designer_chart/src/com/fr/plugin/chart/structure/desinger/data/StructurePlotReportDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/structure/desinger/data/StructurePlotReportDataContentPane.java @@ -38,14 +38,15 @@ public class StructurePlotReportDataContentPane extends AbstractReportDataConten nodeValue = new TinyFormulaPane(); Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Node_Name"), SwingConstants.RIGHT), nodeName}, - new Component[]{new UILabel("id", SwingConstants.RIGHT), nodeID}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Parent_ID"), SwingConstants.RIGHT), parentID}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name"), SwingConstants.RIGHT), seriesName}, - new Component[]{new UILabel(Inter.getLocText("Chart-Series_Value"), SwingConstants.RIGHT), nodeValue}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Node_Name")), nodeName}, + new Component[]{new UILabel("id"), nodeID}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Parent_ID")), parentID}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name")), seriesName}, + new Component[]{new UILabel(Inter.getLocText("Chart-Series_Value")), nodeValue}, }; - JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,24,6); + panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); this.setLayout(new BorderLayout()); this.add(panel, BorderLayout.CENTER); diff --git a/designer_chart/src/com/fr/plugin/chart/structure/desinger/data/StructurePlotTableDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/structure/desinger/data/StructurePlotTableDataContentPane.java index ed2fcf8c04..26ad1dbae0 100644 --- a/designer_chart/src/com/fr/plugin/chart/structure/desinger/data/StructurePlotTableDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/structure/desinger/data/StructurePlotTableDataContentPane.java @@ -30,7 +30,8 @@ public class StructurePlotTableDataContentPane extends AbstractTableDataContentP public StructurePlotTableDataContentPane() { double p = TableLayout.PREFERRED; - double[] columnSize = {p, p}; + double f = TableLayout.FILL; + double[] columnSize = {p, f}; double[] rowSize = {p, p, p, p, p, p}; nodeName = new UIComboBox(); @@ -40,26 +41,20 @@ public class StructurePlotTableDataContentPane extends AbstractTableDataContentP nodeValue = new UIComboBox(); calculateCombox = new CalculateComboBox(); - nodeName.setPreferredSize(new Dimension(100, 20)); - nodeId.setPreferredSize(new Dimension(100, 20)); - parenrId.setPreferredSize(new Dimension(100, 20)); - seriesName.setPreferredSize(new Dimension(100, 20)); - nodeValue.setPreferredSize(new Dimension(100, 20)); - calculateCombox.setPreferredSize(new Dimension(100, 20)); - Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Node_Name"), SwingConstants.RIGHT), nodeName}, - new Component[]{new UILabel("id", SwingConstants.RIGHT), nodeId}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Parent_ID"), SwingConstants.RIGHT), parenrId}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name"), SwingConstants.RIGHT), seriesName}, - new Component[]{new UILabel(Inter.getLocText("Chart-Series_Value"), SwingConstants.RIGHT), nodeValue}, - new Component[]{new UILabel(Inter.getLocText("Chart-Summary_Method"), SwingConstants.RIGHT), calculateCombox} + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Node_Name")), nodeName}, + new Component[]{new UILabel("id"), nodeId}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Parent_ID")), parenrId}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name")), seriesName}, + new Component[]{new UILabel(Inter.getLocText("Chart-Series_Value")), nodeValue}, + new Component[]{new UILabel(Inter.getLocText("Chart-Summary_Method")), calculateCombox} }; - JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); - + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,24,6); + panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); this.setLayout(new BorderLayout()); this.add(panel, BorderLayout.CENTER); + this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight())); } diff --git a/designer_chart/src/com/fr/plugin/chart/wordcloud/designer/data/WordCloudPlotReportDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/wordcloud/designer/data/WordCloudPlotReportDataContentPane.java index 1d54647ed5..c171e12b4d 100644 --- a/designer_chart/src/com/fr/plugin/chart/wordcloud/designer/data/WordCloudPlotReportDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/wordcloud/designer/data/WordCloudPlotReportDataContentPane.java @@ -34,12 +34,14 @@ public class WordCloudPlotReportDataContentPane extends AbstractReportDataConten wordValue = new TinyFormulaPane(); Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name"), SwingConstants.RIGHT), name}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Word_Name"), SwingConstants.RIGHT), wordName}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Word_Value"), SwingConstants.RIGHT), wordValue} + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name")), name}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Word_Name")), wordName}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Word_Value")), wordValue} }; - JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,24,6); + panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); + this.setLayout(new BorderLayout()); this.add(panel, BorderLayout.CENTER); diff --git a/designer_chart/src/com/fr/plugin/chart/wordcloud/designer/data/WordCloudPlotTableDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/wordcloud/designer/data/WordCloudPlotTableDataContentPane.java index 270f160186..0ff9535662 100644 --- a/designer_chart/src/com/fr/plugin/chart/wordcloud/designer/data/WordCloudPlotTableDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/wordcloud/designer/data/WordCloudPlotTableDataContentPane.java @@ -28,7 +28,8 @@ public class WordCloudPlotTableDataContentPane extends AbstractTableDataContentP public WordCloudPlotTableDataContentPane() { double p = TableLayout.PREFERRED; - double[] columnSize = { p, p }; + double f = TableLayout.FILL; + double[] columnSize = { p, f}; double[] rowSize = { p, p, p, p}; name = new UITextField(); @@ -37,22 +38,20 @@ public class WordCloudPlotTableDataContentPane extends AbstractTableDataContentP calculateCombox = new CalculateComboBox(); - name.setPreferredSize(new Dimension(100, 20)); - wordName.setPreferredSize(new Dimension(100, 20)); - wordValue.setPreferredSize(new Dimension(100, 20)); - calculateCombox.setPreferredSize(new Dimension(100, 20)); - Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name"), SwingConstants.RIGHT), name}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Word_Name"), SwingConstants.RIGHT), wordName}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Word_Value"), SwingConstants.RIGHT), wordValue}, - new Component[]{new UILabel(Inter.getLocText("Chart-Summary_Method"), SwingConstants.RIGHT), calculateCombox} + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name")), name}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Word_Name")), wordName}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Word_Value")), wordValue}, + new Component[]{new UILabel(Inter.getLocText("Chart-Summary_Method")), calculateCombox} }; - JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,24,6); this.setLayout(new BorderLayout()); + panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); this.add(panel, BorderLayout.CENTER); + this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight())); + } @Override From c6c494a28db7dc632912b748016d2eaae47edb36 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 21 Aug 2017 10:01:16 +0800 Subject: [PATCH 2/8] =?UTF-8?q?REPORT-3721=20=E5=8A=A0=E4=B8=AA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E7=82=B9=E6=A3=80=E6=B5=8B.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/errorinfo/ErrorInfoUploader.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java b/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java index 7865f6d525..a3033ee881 100644 --- a/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java +++ b/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.errorinfo; import com.fr.base.FRContext; +import com.fr.base.FRCoreContext; import com.fr.general.*; import com.fr.general.http.HttpClient; import com.fr.json.JSONException; @@ -27,6 +28,7 @@ public class ErrorInfoUploader { public static final String FOLDER_NAME = "errorInfo"; private static ErrorInfoUploader collector; + private static boolean licSupport = true; static { GeneralContext.addEnvChangedListener(new EnvChangedListener() { @@ -35,6 +37,9 @@ public class ErrorInfoUploader { FRLogger.getLogger().addLogAppender(new ErrorInfoLogAppender()); } }); + + // 这个控制没啥意义, 主要在于宣传功能. + licSupport = VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support(); } private ErrorInfoUploader() { @@ -51,6 +56,11 @@ public class ErrorInfoUploader { // 从云中心更新最新的解决方案文件 private void checkUpdateSolution(){ + if (!licSupport) { + return; + } + + Thread updateThread = new Thread(new Runnable() { @Override public void run() { From 66fc37a0f226eda2a3ca069a4889bbc055e4d781 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 21 Aug 2017 10:01:35 +0800 Subject: [PATCH 3/8] 1 --- build.dev.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.dev.gradle b/build.dev.gradle index 1efdd55cc8..4add13aff8 100644 --- a/build.dev.gradle +++ b/build.dev.gradle @@ -3,7 +3,7 @@ tasks.withType(JavaCompile){ options.encoding = "UTF-8" } -def basicDir="../../" +def basicDir="../../ " def libDir="${basicDir}/finereport-lib-stable" //获取什么分支名 FileTree files =fileTree(dir:"./",include:"build.*.gradle") From e7132750d64795050329e6a6e3db85f858e1d68c Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 21 Aug 2017 10:01:59 +0800 Subject: [PATCH 4/8] 1 --- build.dev.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.dev.gradle b/build.dev.gradle index 4add13aff8..1efdd55cc8 100644 --- a/build.dev.gradle +++ b/build.dev.gradle @@ -3,7 +3,7 @@ tasks.withType(JavaCompile){ options.encoding = "UTF-8" } -def basicDir="../../ " +def basicDir="../../" def libDir="${basicDir}/finereport-lib-stable" //获取什么分支名 FileTree files =fileTree(dir:"./",include:"build.*.gradle") From d4de2ea2c82c38a4bcc5266530c36121f8e40b8f Mon Sep 17 00:00:00 2001 From: hzzz Date: Mon, 21 Aug 2017 10:09:08 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=92=8C=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/gui/UIDefaultTheme.java | 4 ++-- .../com/fr/design/images/buttonicon/minus.png | Bin 148 -> 177 bytes .../com/fr/design/images/buttonicon/plus.png | Bin 172 -> 165 bytes .../src/com/fr/start/BaseDesigner.java | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/UIDefaultTheme.java b/designer_base/src/com/fr/design/gui/UIDefaultTheme.java index 7a9a523fc5..ae18ce654f 100644 --- a/designer_base/src/com/fr/design/gui/UIDefaultTheme.java +++ b/designer_base/src/com/fr/design/gui/UIDefaultTheme.java @@ -170,8 +170,8 @@ public class UIDefaultTheme extends DefaultMetalTheme { table.put("Tree.textForeground", ThemeUtils.NORMAL_FOREGROUND); table.put("Tree.selectionBackground", ThemeUtils.TEXT_SELECTED_BG_COLOR); table.put("Tree.selectionForeground", ThemeUtils.TEXT_SELECTED_TEXT_COLOR); - table.put("Tree.hash", new ColorUIResource(208, 205, 190)); - table.put("Tree.line", new ColorUIResource(208, 205, 190)); + table.put("Tree.hash", new ColorUIResource(240, 240,243)); + table.put("Tree.line", new ColorUIResource(240, 240,243)); } diff --git a/designer_base/src/com/fr/design/images/buttonicon/minus.png b/designer_base/src/com/fr/design/images/buttonicon/minus.png index 569e998491d9abb662bc63d42794b375b165e03d..4c428c07bc2b7f4aa2a7dbfa8a1ab7ded9ad0cbc 100644 GIT binary patch literal 177 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}*`6+rAsV8| z2@<~=1fR90o}MPkd~=_HozdA7Cw{cgoolP5q47eL+lNVG$G89g|L=6zXXC@una85Z z_VJ-vgT?9T`r!;&RtzbJOc{BzdU|?t7`hr6yVxdhY*H&ZDxe$TF+pv?e69^1yl#pN Ysu7Bk4i_)!01|%O$WD@{VjKx9jP7LeL$-D$|{5)M8LnI`V zZ7M(A31e&fAID?C_}EPC50``0|7u22K{gl7q{f+xmoGnh;NU^V$3}mCd~AMrX=!$X uU5ua)!#b``$0?;pw36<$r5Kq#3u7qM6zXqqktEO?%p6k4yeVmpRDq`3b)IL;&c~%!v+QhQc=tnTYhQZoa-dZV Mp00i_>zopr01vS{RsaA1 literal 172 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{VjKx9jP7LeL$-D$|(mY)pLnI`V zZ7M(A31e&fAID?C_}EPC50``0|7u3jg-o`#x*?1T{LX^x?CfnyVly~Su*_gGHdbzv zx34pZ*;T@;!yC>b%%Eve`bx$}f5x#5d?`#;2Lf1(1tS#$1RtBFFzUQn%TTjd+VN0G ROEb_$22WQ%mvv4FO#ttNE=T|X diff --git a/designer_base/src/com/fr/start/BaseDesigner.java b/designer_base/src/com/fr/start/BaseDesigner.java index c393237a77..e2c3a717d6 100644 --- a/designer_base/src/com/fr/start/BaseDesigner.java +++ b/designer_base/src/com/fr/start/BaseDesigner.java @@ -93,7 +93,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { initDefaultFont(); //PluginManager要在环境切换和模块启动之前初始化 - PluginManager.registerEnvListener(); +// PluginManager.registerEnvListener(); // 必须先初始化Env再去startModule, 不然会导致lic读取不到 ModuleContext.startModule(module2Start()); From 611702cb73a1663661dedf00f4e43d7da2efa36f Mon Sep 17 00:00:00 2001 From: hzzz Date: Mon, 21 Aug 2017 10:45:51 +0800 Subject: [PATCH 6/8] tmp --- designer_base/src/com/fr/start/BaseDesigner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/start/BaseDesigner.java b/designer_base/src/com/fr/start/BaseDesigner.java index e2c3a717d6..c393237a77 100644 --- a/designer_base/src/com/fr/start/BaseDesigner.java +++ b/designer_base/src/com/fr/start/BaseDesigner.java @@ -93,7 +93,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { initDefaultFont(); //PluginManager要在环境切换和模块启动之前初始化 -// PluginManager.registerEnvListener(); + PluginManager.registerEnvListener(); // 必须先初始化Env再去startModule, 不然会导致lic读取不到 ModuleContext.startModule(module2Start()); From cdeebddccd2ee44ba785598849d77befe4300cd3 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 21 Aug 2017 17:15:05 +0800 Subject: [PATCH 7/8] =?UTF-8?q?REPORT-2354=20=E5=B0=86=E5=8E=9F=E6=9D=A5?= =?UTF-8?q?=E5=AD=98=E5=9C=A8finereportEnv=E4=B8=AD=E7=9A=84=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E4=BF=A1=E6=81=AF=E7=A7=BB=E5=88=B0config.xml?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/ActiveKeyGenerator.java | 5 +- .../mainframe/InformationCollector.java | 5 +- .../alphafine/component/AlphaFineDialog.java | 3 +- .../design/mainframe/bbs/BBSLoginDialog.java | 8 ++- .../fr/design/mainframe/bbs/ExitLabel.java | 6 +- .../design/mainframe/bbs/UserInfoLabel.java | 26 +++---- .../fr/design/mainframe/bbs/UserInfoPane.java | 12 ++-- .../errorinfo/ErrorInfoLogAppender.java | 3 +- .../src/com/fr/design/DesignerEnvManager.java | 70 +------------------ .../src/com/fr/design/bbs/BBSLoginUtils.java | 31 ++++++++ .../com/fr/design/extra/LoginWebBridge.java | 60 ++++++++-------- .../fr/design/extra/PluginFromStorePane.java | 8 +-- .../fr/design/extra/PluginOperateUtils.java | 7 +- .../com/fr/design/extra/PluginUpdatePane.java | 7 +- .../com/fr/design/extra/PluginWebBridge.java | 20 +++--- .../templateinfo/TemplateInfoCollector.java | 3 +- 16 files changed, 114 insertions(+), 160 deletions(-) create mode 100644 designer_base/src/com/fr/design/bbs/BBSLoginUtils.java diff --git a/designer/src/com/fr/design/mainframe/ActiveKeyGenerator.java b/designer/src/com/fr/design/mainframe/ActiveKeyGenerator.java index 3a57b11ec5..a941660aa1 100644 --- a/designer/src/com/fr/design/mainframe/ActiveKeyGenerator.java +++ b/designer/src/com/fr/design/mainframe/ActiveKeyGenerator.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe; -import com.fr.base.BaseUtils; +import com.fr.base.ConfigManager; import com.fr.design.DesignerEnvManager; -import com.fr.design.mainframe.bbs.BBSConstants; import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.stable.StableUtils; @@ -102,7 +101,7 @@ public class ActiveKeyGenerator { HashMap para = new HashMap(); para.put("uuid", envManager.getUUID()); para.put("key", key); - para.put("username", envManager.getBBSName()); + para.put("username", ConfigManager.getProviderInstance().getBbsUsername()); HttpClient hc = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("verify.code"), para); if (timeout != -1) { hc.setTimeout(timeout); diff --git a/designer/src/com/fr/design/mainframe/InformationCollector.java b/designer/src/com/fr/design/mainframe/InformationCollector.java index 4bac9a15b0..a5912da56b 100644 --- a/designer/src/com/fr/design/mainframe/InformationCollector.java +++ b/designer/src/com/fr/design/mainframe/InformationCollector.java @@ -3,6 +3,7 @@ */ package com.fr.design.mainframe; +import com.fr.base.ConfigManager; import com.fr.base.FRContext; import com.fr.data.core.db.DBUtils; import com.fr.data.core.db.dialect.DialectFactory; @@ -134,7 +135,7 @@ public class InformationCollector implements XMLReadable, XMLWriter { content.put(XML_UUID, envManager.getUUID()); content.put(XML_JAR, GeneralUtils.readBuildNO()); content.put(XML_VERSION, ProductConstants.RELEASE_VERSION); - content.put(XML_USERNAME, envManager.getBBSName()); + content.put(XML_USERNAME, ConfigManager.getProviderInstance().getBbsUsername()); content.put(XML_KEY, envManager.getActivationKey()); content.put(XML_OS, System.getProperty("os.name")); @@ -254,7 +255,7 @@ public class InformationCollector implements XMLReadable, XMLWriter { } DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); - content.put("username", envManager.getBBSName()); + content.put("username", ConfigManager.getProviderInstance().getBbsUsername()); content.put("uuid", envManager.getUUID()); content.put("functions", functionArray); diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 83945d324e..ed0bc57316 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.alphafine.component; +import com.fr.base.ConfigManager; import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; import com.fr.design.dialog.UIDialog; @@ -776,7 +777,7 @@ public class AlphaFineDialog extends UIDialog { */ private void sendToServer(String searchKey, AlphaCellModel cellModel) { if (cellModel.isNeedToSendToServer()) { - String username = DesignerEnvManager.getEnvManager().getBBSName(); + String username = ConfigManager.getProviderInstance().getBbsUsername(); String uuid = DesignerEnvManager.getEnvManager().getUUID(); String activityKey = DesignerEnvManager.getEnvManager().getActivationKey(); String createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(Calendar.getInstance().getTime()); diff --git a/designer/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java b/designer/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java index 3946b73e5d..f5401c0282 100644 --- a/designer/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java +++ b/designer/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java @@ -1,6 +1,8 @@ package com.fr.design.mainframe.bbs; -import com.fr.design.DesignerEnvManager; +import com.fr.base.ConfigManager; +import com.fr.base.FRContext; +import com.fr.design.bbs.BBSLoginUtils; import com.fr.design.dialog.UIDialog; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.ActionLabel; @@ -207,8 +209,8 @@ public class BBSLoginDialog extends UIDialog { // 登录成功 private void loginSuccess() { - DesignerEnvManager.getEnvManager().setBBSPassword(String.valueOf(passField.getPassword())); - userInfoLabel.setUserName(nameField.getText()); + String password = String.valueOf(passField.getPassword()); + BBSLoginUtils.bbsLogin(nameField.getText(), password); userInfoLabel.getUserInfoPane().markSignIn(nameField.getText()); BBSLoginDialog.this.setVisible(false); } diff --git a/designer/src/com/fr/design/mainframe/bbs/ExitLabel.java b/designer/src/com/fr/design/mainframe/bbs/ExitLabel.java index c3436755a2..a830d3332d 100644 --- a/designer/src/com/fr/design/mainframe/bbs/ExitLabel.java +++ b/designer/src/com/fr/design/mainframe/bbs/ExitLabel.java @@ -9,14 +9,13 @@ import java.awt.event.MouseEvent; import com.fr.base.BaseUtils; -import com.fr.design.DesignerEnvManager; +import com.fr.design.bbs.BBSLoginUtils; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.mainframe.DesignerContext; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; -import com.fr.stable.StringUtils; /** * @author neil @@ -61,8 +60,7 @@ public class ExitLabel extends UILabel{ } private void clearLoingInformation(){ - DesignerEnvManager.getEnvManager().setBBSName(StringUtils.EMPTY); - DesignerEnvManager.getEnvManager().setBBSPassword(StringUtils.EMPTY); + BBSLoginUtils.bbsLogout(); } private void updateInfoPane(){ diff --git a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java index 4d58b3db67..b4ba82399d 100644 --- a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -3,8 +3,10 @@ */ package com.fr.design.mainframe.bbs; +import com.fr.base.ConfigManager; import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; +import com.fr.design.bbs.BBSLoginUtils; import com.fr.design.extra.*; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.imenu.UIMenuItem; @@ -16,12 +18,7 @@ import com.fr.general.DateUtils; import com.fr.general.Inter; import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; -import com.fr.plugin.manage.bbs.BBSPluginLogin; -import com.fr.plugin.manage.bbs.BBSUserInfo; -import com.fr.stable.EncodeConstants; -import com.fr.stable.OperatingSystem; -import com.fr.stable.StableUtils; -import com.fr.stable.StringUtils; +import com.fr.stable.*; import javax.swing.*; import java.awt.*; @@ -77,7 +74,7 @@ public class UserInfoLabel extends UILabel { public UserInfoLabel(UserInfoPane userInfoPane) { this.userInfoPane = userInfoPane; - String userName = DesignerEnvManager.getEnvManager().getBBSName(); + String userName = ConfigManager.getProviderInstance().getBbsUsername(); this.addMouseListener(userInfoAdapter); this.setHorizontalAlignment(SwingConstants.CENTER); this.setText(userName); @@ -117,10 +114,9 @@ public class UserInfoLabel extends UILabel { } private void clearLoginInformation() { - DesignerEnvManager.getEnvManager().setBBSName(StringUtils.EMPTY); - DesignerEnvManager.getEnvManager().setBBSPassword(StringUtils.EMPTY); - DesignerEnvManager.getEnvManager().setInShowBBsName(StringUtils.EMPTY); - DesignerEnvManager.getEnvManager().setBbsUid(DEFAULT_BBS_UID); + ConfigManager.getProviderInstance().setInShowBBsName(StringUtils.EMPTY); + ConfigManager.getProviderInstance().setBbsUid(DEFAULT_BBS_UID); + BBSLoginUtils.bbsLogout(); } private void updateInfoPane() { @@ -192,8 +188,6 @@ public class UserInfoLabel extends UILabel { return; } - //往designerenvmanger里写一下 - DesignerEnvManager.getEnvManager().setBBSName(userName); this.userName = userName; } @@ -238,8 +232,7 @@ public class UserInfoLabel extends UILabel { @Override public void mouseClicked(MouseEvent e) { - BBSUserInfo bbsUserInfo = BBSPluginLogin.getInstance().getUserInfo(); - userName = bbsUserInfo == null ? "" : bbsUserInfo.getUserName(); + userName = ConfigManager.getProviderInstance().getBbsUsername(); if (StringUtils.isNotEmpty(userName)) { UIPopupMenu menu = new UIPopupMenu(); menu.setOnlyText(true); @@ -265,10 +258,9 @@ public class UserInfoLabel extends UILabel { UIMenuItem closeOther = new UIMenuItem(Inter.getLocText("FR-Designer-BBSLogin_Switch-Account")); closeOther.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { - BBSPluginLogin.getInstance().logOut(); + BBSLoginUtils.bbsLogout(); UserLoginContext.fireLoginContextListener(); } - }); menu.add(priviteMessage); menu.add(closeOther); diff --git a/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java b/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java index a638ac3e42..711fd634dd 100644 --- a/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java +++ b/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java @@ -11,6 +11,7 @@ import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; +import com.fr.base.ConfigManager; import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; import com.fr.design.dialog.BasicPane; @@ -18,8 +19,6 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.general.DateUtils; import com.fr.general.FRLogger; import com.fr.general.Inter; -import com.fr.plugin.manage.bbs.BBSPluginLogin; -import com.fr.plugin.manage.bbs.BBSUserInfo; import com.fr.stable.StringUtils; @@ -77,9 +76,8 @@ public class UserInfoPane extends BasicPane{ @Override public void run() { - String username = DesignerEnvManager.getEnvManager().getBBSName(); - String inShowUsername = DesignerEnvManager.getEnvManager().getInShowBBsName(); - if (StringUtils.isEmpty(username) && StringUtils.isEmpty(inShowUsername)){ + String username = ConfigManager.getProviderInstance().getBbsUsername(); + if (StringUtils.isEmpty(username)){ markUnSignIn(); } else { markSignIn(username); @@ -133,7 +131,7 @@ public class UserInfoPane extends BasicPane{ FRContext.getLogger().error(e.getMessage()); } - String userName = DesignerEnvManager.getEnvManager().getBBSName(); + String userName = ConfigManager.getProviderInstance().getBbsUsername(); if(StringUtils.isNotEmpty(userName)){ return; } @@ -169,8 +167,6 @@ public class UserInfoPane extends BasicPane{ * */ public void markSignIn(String userName){ - String password = DesignerEnvManager.getEnvManager().getBBSPassword(); - BBSPluginLogin.getInstance().login(new BBSUserInfo(userName, password)); this.userInfoLabel.setText(userName); this.userInfoLabel.setUserName(userName); this.userInfoLabel.setOpaque(true); diff --git a/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java b/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java index f01bb669e6..26ae4d61fd 100644 --- a/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java +++ b/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.errorinfo; +import com.fr.base.ConfigManager; import com.fr.base.FRContext; import com.fr.base.io.IOFile; import com.fr.base.io.XMLReadHelper; @@ -38,7 +39,7 @@ public class ErrorInfoLogAppender extends AppenderSkeleton { this.layout = new org.apache.log4j.PatternLayout("%d{HH:mm:ss} %t %p [%c] %m%n"); DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); - this.username = envManager.getBBSName(); + this.username = ConfigManager.getProviderInstance().getBbsUsername(); this.uuid = envManager.getUUID(); this.activekey = envManager.getActivationKey(); } diff --git a/designer_base/src/com/fr/design/DesignerEnvManager.java b/designer_base/src/com/fr/design/DesignerEnvManager.java index d02d41abf4..0725f8e833 100644 --- a/designer_base/src/com/fr/design/DesignerEnvManager.java +++ b/designer_base/src/com/fr/design/DesignerEnvManager.java @@ -89,14 +89,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private int westRegionContainerWidth = 240; private String encryptionKey; private String jdkHome; - //当前设计器用户的论坛昵称 - private String bbsName; - //当前设计器用户的论坛密码 - private String bbsPassword; - //当前设计器用户的论坛ID - private int bbsUid; - //当前设计器用户的昵称显示(带消息) - private String inShowBBsName; + //上一次登录弹窗的时间, 为了控制一天只弹一次窗口 private String lastShowBBSTime; //上一次资讯弹窗时间, 为了控制一天只弹一次 @@ -1145,37 +1138,6 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { this.jdkHome = home; } - public String getBBSName() { - return bbsName; - } - - public void setBBSName(String bbsName) { - this.bbsName = bbsName; - } - - public String getBBSPassword() { - return bbsPassword; - } - - public void setBBSPassword(String bbsPassword) { - this.bbsPassword = bbsPassword; - } - - public int getBbsUid() { - return bbsUid; - } - - public void setBbsUid(int bbsUid) { - this.bbsUid = bbsUid; - } - - public void setInShowBBsName(String inShowBBsName) { - this.inShowBBsName = inShowBBsName; - } - - public String getInShowBBsName() { - return inShowBBsName; - } public String getLastShowBBSTime() { return lastShowBBSTime; @@ -1256,19 +1218,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } } - private void readBBSName(XMLableReader reader){ - String tmpVal; - if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) { - this.bbsName = tmpVal; - } - } - private void readBBSPassword(XMLableReader reader){ - String tmpVal; - if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) { - this.bbsPassword = CodeUtils.passwordDecode(tmpVal); - } - } private void readLastBBSTime(XMLableReader reader){ String tmpVal; @@ -1325,11 +1275,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { readEncrytionKey(reader); } else if ("jdkHome".equals(name)) { this.jdkHome = reader.getElementValue(); - } else if ("bbsName".equals(name)){ - readBBSName(reader); - } else if ("bbsPassword".equals(name)){ - readBBSPassword(reader); - } else if ("lastBBSTime".equals(name)){ + }else if ("lastBBSTime".equals(name)){ readLastBBSTime(reader); } else if ("lastBBSNewsTime".equals(name)){ readLastBBSNewsTime(reader); @@ -1736,18 +1682,6 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { //写论坛相关的两个属性 private void writeBBSRelated(XMLPrintWriter writer){ - if (StringUtils.isNotBlank(bbsName)) { - writer.startTAG("bbsName"); - writer.textNode(bbsName); - writer.end(); - } - - if (StringUtils.isNotBlank(bbsPassword)){ - writer.startTAG("bbsPassword"); - writer.textNode(CodeUtils.passwordEncode(bbsPassword)); - writer.end(); - } - if (StringUtils.isNotEmpty(this.lastShowBBSTime)){ writer.startTAG("lastBBSTime"); writer.textNode(lastShowBBSTime); diff --git a/designer_base/src/com/fr/design/bbs/BBSLoginUtils.java b/designer_base/src/com/fr/design/bbs/BBSLoginUtils.java new file mode 100644 index 0000000000..b767024727 --- /dev/null +++ b/designer_base/src/com/fr/design/bbs/BBSLoginUtils.java @@ -0,0 +1,31 @@ +package com.fr.design.bbs; + +import com.fr.base.ConfigManager; +import com.fr.base.FRContext; +import com.fr.stable.StringUtils; + +/** + * Created by ibm on 2017/8/21. + */ +public class BBSLoginUtils { + + public static void bbsLogin(String username, String password){ + try{ + ConfigManager.getProviderInstance().setBbsUsername(username); + ConfigManager.getProviderInstance().setBbsPassword(password); + FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance()); + }catch (Exception e){ + FRContext.getLogger().error(e.getMessage()); + } + } + + public static void bbsLogout(){ + try{ + ConfigManager.getProviderInstance().setBbsUsername(StringUtils.EMPTY); + ConfigManager.getProviderInstance().setBbsPassword(StringUtils.EMPTY); + FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance()); + }catch (Exception e){ + FRContext.getLogger().error(e.getMessage()); + } + } +} diff --git a/designer_base/src/com/fr/design/extra/LoginWebBridge.java b/designer_base/src/com/fr/design/extra/LoginWebBridge.java index 549cb17632..d7e53c0056 100644 --- a/designer_base/src/com/fr/design/extra/LoginWebBridge.java +++ b/designer_base/src/com/fr/design/extra/LoginWebBridge.java @@ -1,16 +1,15 @@ package com.fr.design.extra; +import com.fr.base.ConfigManager; import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; +import com.fr.design.bbs.BBSLoginUtils; import com.fr.design.dialog.UIDialog; import com.fr.design.extra.ucenter.Client; import com.fr.design.extra.ucenter.XMLHelper; import com.fr.design.gui.ilable.UILabel; import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; -import com.fr.json.JSONObject; -import com.fr.plugin.manage.bbs.BBSPluginLogin; -import com.fr.plugin.manage.bbs.BBSUserInfo; import com.fr.stable.EncodeConstants; import com.fr.stable.StringUtils; import javafx.scene.web.WebEngine; @@ -20,7 +19,6 @@ import java.awt.*; import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URLEncoder; -import java.util.HashMap; import java.util.LinkedList; public class LoginWebBridge { @@ -59,7 +57,7 @@ public class LoginWebBridge { private String userName; public LoginWebBridge() { - String username = DesignerEnvManager.getEnvManager().getBBSName(); + String username = ConfigManager.getProviderInstance().getBbsUsername(); setUserName(username, uiLabel); } @@ -130,16 +128,16 @@ public class LoginWebBridge { */ public void setMessageCount(int count) { if (count == MIN_MESSAGE_COUNT) { - uiLabel.setText(DesignerEnvManager.getEnvManager().getBBSName()); - DesignerEnvManager.getEnvManager().setInShowBBsName(DesignerEnvManager.getEnvManager().getBBSName()); + uiLabel.setText(ConfigManager.getProviderInstance().getBbsUsername()); + ConfigManager.getProviderInstance().setInShowBBsName(ConfigManager.getProviderInstance().getBbsUsername()); return; } this.messageCount = count; StringBuilder sb = new StringBuilder(); - sb.append(StringUtils.BLANK).append(DesignerEnvManager.getEnvManager().getBBSName()) + sb.append(StringUtils.BLANK).append(ConfigManager.getProviderInstance().getBbsUsername()) .append("(").append(this.messageCount) .append(")").append(StringUtils.BLANK); - DesignerEnvManager.getEnvManager().setInShowBBsName(sb.toString()); + ConfigManager.getProviderInstance().setInShowBBsName(sb.toString()); uiLabel.setText(sb.toString()); } @@ -278,11 +276,9 @@ public class LoginWebBridge { if (list.size() > 0) { int $uid = Integer.parseInt(list.get(0)); if ($uid > 0) { - DesignerEnvManager.getEnvManager().setBbsUid($uid); - DesignerEnvManager.getEnvManager().setBBSName(username); - DesignerEnvManager.getEnvManager().setInShowBBsName(username); - DesignerEnvManager.getEnvManager().setBBSPassword(password); - BBSPluginLogin.getInstance().login(new BBSUserInfo(username, password)); + ConfigManager.getProviderInstance().setBbsUid($uid); + ConfigManager.getProviderInstance().setInShowBBsName(username); + BBSLoginUtils.bbsLogin(username, password); return LOGININ;//登录成功,0 } else if ($uid == -1) { return USERNAME_NOT_EXSIT;//用户名不存在,-1 @@ -318,24 +314,28 @@ public class LoginWebBridge { public void getLoginInfo(String userInfo) { org.json.JSONObject jo = new org.json.JSONObject(userInfo); String status = jo.get("status").toString(); - if (status.equals(LOGIN_SUCCESS)) { - String username = jo.get("username").toString(); - int uid = Integer.parseInt(jo.get("uid") == null ? "" : jo.get("uid").toString()); - closeWindow(); - closeQQWindow(); - pluginuiLabel.setText(username); - DesignerEnvManager.getEnvManager().setBBSName(username); - DesignerEnvManager.getEnvManager().setBbsUid(uid); - DesignerEnvManager.getEnvManager().setInShowBBsName(username); - BBSPluginLogin.getInstance().login(new BBSUserInfo(username, "")); - } else if (status.equals(LOGIN_FAILED)) { - //账号没有QQ授权 - closeQQWindow(); - try { - Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("QQ_binding"))); - } catch (Exception exp) { + try{ + if (status.equals(LOGIN_SUCCESS)) { + String username = jo.get("username").toString(); + int uid = Integer.parseInt(jo.get("uid") == null ? "" : jo.get("uid").toString()); + closeWindow(); + closeQQWindow(); + pluginuiLabel.setText(username); + ConfigManager.getProviderInstance().setBbsUid(uid); + ConfigManager.getProviderInstance().setInShowBBsName(username); + BBSLoginUtils.bbsLogin(username, ""); + } else if (status.equals(LOGIN_FAILED)) { + //账号没有QQ授权 + closeQQWindow(); + try { + Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("QQ_binding"))); + } catch (Exception exp) { + } } + }catch (Exception e){ + FRContext.getLogger().error(e.getMessage()); } + } public void openUrlAtLocalWebBrowser(WebEngine eng, String url) { diff --git a/designer_base/src/com/fr/design/extra/PluginFromStorePane.java b/designer_base/src/com/fr/design/extra/PluginFromStorePane.java index f3e0de7992..20001cad3c 100644 --- a/designer_base/src/com/fr/design/extra/PluginFromStorePane.java +++ b/designer_base/src/com/fr/design/extra/PluginFromStorePane.java @@ -1,5 +1,6 @@ package com.fr.design.extra; +import com.fr.base.ConfigManager; import com.fr.base.FRContext; import com.fr.design.extra.tradition.callback.UpdateOnlineCallback; import com.fr.design.gui.frpane.UITabbedPane; @@ -9,11 +10,10 @@ import com.fr.general.Inter; import com.fr.json.JSONObject; import com.fr.plugin.context.PluginMarker; import com.fr.plugin.manage.PluginManager; -import com.fr.plugin.manage.bbs.BBSPluginLogin; import com.fr.plugin.manage.control.PluginTaskResult; import com.fr.plugin.manage.control.ProgressCallback; import com.fr.plugin.view.PluginView; - +import com.fr.stable.StringUtils; import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; import java.io.File; @@ -188,10 +188,10 @@ public class PluginFromStorePane extends PluginAbstractLoadingViewPane implements Serializable, XM private HashMap getNewConsumingMap(String templateID, long openTime, long timeConsume) { HashMap consumingMap = new HashMap<>(); - String username = DesignerEnvManager.getEnvManager().getBBSName(); + String username = ConfigManager.getProviderInstance().getBbsUsername(); String uuid = DesignerEnvManager.getEnvManager().getUUID(); String activitykey = DesignerEnvManager.getEnvManager().getActivationKey(); String createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(Calendar.getInstance().getTime()); From 33a102e7fe6e190dcb67d807176370eb7c9daaa6 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Tue, 22 Aug 2017 09:25:56 +0800 Subject: [PATCH 8/8] =?UTF-8?q?9.0=E6=96=B0=E5=9B=BE=E8=A1=A8=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=9D=A2=E6=9D=BF=E4=BF=AE=E6=94=B9=20=E7=89=B9?= =?UTF-8?q?=E6=95=88=E9=9D=A2=E6=9D=BF=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=85=B6?= =?UTF-8?q?=E4=B8=AD=E8=B6=85=E9=93=BE=E5=92=8C=E6=9D=A1=E4=BB=B6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E4=BB=A3=E7=A0=81=E9=9C=80=E8=A6=81=E5=86=8D?= =?UTF-8?q?=E6=95=B4=E7=90=86=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/foldablepane/UIExpandablePane.java | 10 +- .../design/gui/controlpane/UIControlPane.java | 12 +- .../gui/controlpane/UIListControlPane.java | 17 ++- .../gui/imenutable/UIMenuNameableCreator.java | 6 +- .../component/VanChartHyperLinkPane.java | 130 ++++++++++++++++-- .../other/VanChartCustomInteractivePane.java | 2 +- .../designer/TableLayout4VanChartHelper.java | 6 +- .../chart/designer/other/AutoRefreshPane.java | 37 ++--- .../other/AutoRefreshPaneWithoutTooltip.java | 1 - .../ChartConditionNameObjectCreator.java | 84 +++++++++++ .../ChartHyperlinkNameObjectCreartor.java | 84 +++++++++++ .../VanChartConditionAttrContentPane.java | 48 ++++--- .../other/VanChartConditionAttrPane.java | 8 +- .../other/VanChartInteractivePane.java | 74 +++++----- .../other/VanChartListControlPane.java | 102 ++++++++++++++ .../VanChartDrillMapInteractivePane.java | 44 ++++-- 16 files changed, 547 insertions(+), 118 deletions(-) create mode 100644 designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java create mode 100644 designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java create mode 100644 designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java diff --git a/designer_base/src/com/fr/design/foldablepane/UIExpandablePane.java b/designer_base/src/com/fr/design/foldablepane/UIExpandablePane.java index 2c4fa40563..924415aea3 100644 --- a/designer_base/src/com/fr/design/foldablepane/UIExpandablePane.java +++ b/designer_base/src/com/fr/design/foldablepane/UIExpandablePane.java @@ -20,6 +20,9 @@ public class UIExpandablePane extends JPanel { private int headWidth; private int headHeight; + public JPanel getContentPanel() { + return contentPanel; + } public UIExpandablePane(String title, int headWidth, int headHeight, JPanel contentPanel) { super(); @@ -43,12 +46,17 @@ public class UIExpandablePane extends JPanel { headerPanel = new HeaderPane(color, title, headHeight); headerPanel.addMouseListener(new PanelAction()); - contentPanel.setBorder(BorderFactory.createEmptyBorder(0 ,LEFT_BORDER, 0, 0)); + setcontentPanelontentPanelBorder (); this.add(headerPanel, BorderLayout.NORTH); this.add(contentPanel, BorderLayout.CENTER); setOpaque(false); } + protected void setcontentPanelontentPanelBorder (){ + contentPanel.setBorder(BorderFactory.createEmptyBorder(0 ,LEFT_BORDER, 0, 0)); + + } + class PanelAction extends MouseAdapter { public void mousePressed(MouseEvent e) { HeaderPane hp = (HeaderPane) e.getSource(); diff --git a/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java b/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java index 74c64de329..ba793a5968 100644 --- a/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.controlpane; +import com.fr.base.chart.BasePlot; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ilable.UILabel; @@ -16,7 +17,8 @@ import com.fr.stable.Nameable; import javax.swing.*; import java.awt.*; -import java.awt.event.*; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; /** * Created by plough on 2017/7/21. @@ -37,10 +39,18 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH protected JPanel cardPane; + protected BasePlot plot; + + public UIControlPane() { this.initComponentPane(); } + public UIControlPane(BasePlot plot) { + this.plot =plot; + this.initComponentPane(); + } + /** * 生成添加按钮的NameableCreator * diff --git a/designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java b/designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java index 986f296517..bc49691303 100644 --- a/designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java +++ b/designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java @@ -2,6 +2,7 @@ package com.fr.design.gui.controlpane; import com.fr.base.BaseUtils; import com.fr.base.FRContext; +import com.fr.base.chart.BasePlot; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.core.ActionFactory; import com.fr.design.beans.BasicBeanPane; @@ -12,9 +13,9 @@ import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icontainer.UIScrollPane; -import com.fr.design.gui.ilist.UINameEdList; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ModNameActionListener; +import com.fr.design.gui.ilist.UINameEdList; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; @@ -40,8 +41,6 @@ import java.awt.event.ActionEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.Arrays; @@ -61,10 +60,15 @@ public abstract class UIListControlPane extends UIControlPane { private boolean isNameRepeated = false; protected boolean isPopulating = false; + public UIListControlPane() { this.initComponentPane(); } + public UIListControlPane(BasePlot plot) { + super(plot); + } + @Override protected JPanel createControlUpdatePane() { return new JControlUpdatePane(); @@ -890,6 +894,11 @@ public abstract class UIListControlPane extends UIControlPane { } + + protected Object getob2Populate (Object ob2Populate) { + return ob2Populate; + } + private class JControlUpdatePane extends JPanel { private CardLayout card; private JPanel cardPane; @@ -926,6 +935,7 @@ public abstract class UIListControlPane extends UIControlPane { for (int i = 0, len = updatePanes.length; i < len; i++) { Object ob2Populate = creators[i].acceptObject2Populate(el.wrapper); + ob2Populate = getob2Populate(ob2Populate); if (ob2Populate != null) { if (updatePanes[i] == null) { if (isMulti(creators[i].getUpdatePane()) || isTree(creators[i].getUpdatePane())) { @@ -944,6 +954,7 @@ public abstract class UIListControlPane extends UIControlPane { } } + public boolean isMulti(Class _class) { return ComparatorUtils.equals(_class, GlobalMultiTDTableDataPane.class) || ComparatorUtils.equals(_class, MultiTDTableDataPane.class); } diff --git a/designer_base/src/com/fr/design/gui/imenutable/UIMenuNameableCreator.java b/designer_base/src/com/fr/design/gui/imenutable/UIMenuNameableCreator.java index 5b6f8606df..0638ce87ec 100644 --- a/designer_base/src/com/fr/design/gui/imenutable/UIMenuNameableCreator.java +++ b/designer_base/src/com/fr/design/gui/imenutable/UIMenuNameableCreator.java @@ -33,7 +33,11 @@ public class UIMenuNameableCreator implements Nameable{ public void setObj(Object obj) { this.obj = obj; } - + + public Class getPaneClazz() { + return paneClazz; + } + /** * 覆盖的clone方法 */ diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java index 9f41e7b86f..f533aa6a7c 100644 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java @@ -7,29 +7,117 @@ import com.fr.chart.web.ChartHyperRelateFloatLink; import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.BasicBeanPane; import com.fr.design.chart.javascript.ChartEmailPane; +import com.fr.design.designer.TargetComponent; import com.fr.design.fun.HyperlinkProvider; import com.fr.design.gui.controlpane.NameableCreator; -import com.fr.design.gui.frpane.UICorrelationComboBoxPane; +import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.imenutable.UIMenuNameableCreator; +import com.fr.design.module.DesignModuleFactory; import com.fr.general.Inter; -import com.fr.js.*; +import com.fr.general.NameObject; +import com.fr.js.EmailJavaScript; +import com.fr.js.FormHyperlinkProvider; +import com.fr.js.JavaScript; +import com.fr.js.JavaScriptImpl; +import com.fr.js.NameJavaScript; +import com.fr.js.NameJavaScriptGroup; +import com.fr.js.ParameterJavaScript; +import com.fr.js.ReportletHyperlink; +import com.fr.js.WebHyperlink; +import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.designer.other.ChartHyperlinkNameObjectCreartor; import com.fr.plugin.chart.designer.other.HyperlinkMapFactory; +import com.fr.stable.ListMap; +import com.fr.stable.Nameable; import com.fr.stable.bridge.StableFactory; import java.util.ArrayList; import java.util.HashMap; +import java.util.Map; import java.util.Set; /** * Created by Fangjie on 2016/4/28. */ -public class VanChartHyperLinkPane extends UICorrelationComboBoxPane { +public class VanChartHyperLinkPane extends UIListControlPane { public VanChartHyperLinkPane() { super(); } + @Override + public NameableCreator[] createNameableCreators() { + + //面板初始化,需要在populate的时候更新 + Map nameCreators = new ListMap<>(); + NameableCreator[] creators = DesignModuleFactory.getHyperlinkGroupType().getHyperlinkCreators(); + for (NameableCreator creator : creators) { + nameCreators.put(creator.menuName(), creator); + } + Set providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); + for (HyperlinkProvider provider : providers) { + NameableCreator nc = provider.createHyperlinkCreator(); + nameCreators.put(nc.menuName(), nc); + } + return nameCreators.values().toArray(new NameableCreator[nameCreators.size()]); + } + + + /** + * 弹出列表的标题. + * + * @return 返回标题字符串. + */ + public String title4PopupWindow() { + return Inter.getLocText("FR-Designer_Hyperlink"); + } + + @Override + protected String getAddItemText() { + return Inter.getLocText("FR-Designer_Add_Hyperlink"); + } + + public void populate(NameJavaScriptGroup nameHyperlink_array) { + java.util.List list = new ArrayList(); + if (nameHyperlink_array != null) { + for (int i = 0; i < nameHyperlink_array.size(); i++) { + list.add(new NameObject(nameHyperlink_array.getNameHyperlink(i).getName(), nameHyperlink_array.getNameHyperlink(i).getJavaScript())); + } + } + + this.populate(list.toArray(new NameObject[list.size()])); + } + + public void populate(TargetComponent elementCasePane) { +// hyperlinkGroupPaneActionProvider.populate(this, elementCasePane); + } + + /** + * updateJs的Group + * + * @return 返回NameJavaScriptGroup + */ + public NameJavaScriptGroup updateJSGroup() { + Nameable[] res = this.update(); + NameJavaScript[] res_array = new NameJavaScript[res.length]; + for (int i = 0; i < res.length; i++) { + NameObject no = (NameObject) res[i]; + res_array[i] = new NameJavaScript(no.getName(), (JavaScript) no.getObject()); + } + + return new NameJavaScriptGroup(res_array); + } + + @Override + public void saveSettings() { + if (isPopulating) { + return; + } + update((VanChartPlot)plot); + } + public void populate(Plot plot) { + this.plot = plot; HashMap paneMap = getHyperlinkMap(plot); //安装平台内打开插件时,添加相应按钮 @@ -40,20 +128,31 @@ public class VanChartHyperLinkPane extends UICorrelationComboBoxPane { // paneMap.put(nc.getHyperlink(), nc.getUpdatePane()); } + //todo@mengao 去掉UIMenuNameableCreator java.util.List list = refreshList(paneMap); - refreshMenuAndAddMenuAction(list); + ChartHyperlinkNameObjectCreartor[] creators= new ChartHyperlinkNameObjectCreartor[list.size()]; + for(int i = 0; list != null && i < list.size(); i++) { + UIMenuNameableCreator uiMenuNameableCreator = list.get(i); + creators[i] = new ChartHyperlinkNameObjectCreartor(uiMenuNameableCreator.getObj(),uiMenuNameableCreator.getName(), uiMenuNameableCreator.getClass(), uiMenuNameableCreator.getPaneClazz()); + + } + + refreshNameableCreator(creators); + + java.util.List nameObjects = new ArrayList(); - java.util.List hyperList = new ArrayList(); NameJavaScriptGroup nameGroup = populateHotHyperLink(plot); for(int i = 0; nameGroup != null && i < nameGroup.size(); i++) { NameJavaScript javaScript = nameGroup.getNameHyperlink(i); if(javaScript != null && javaScript.getJavaScript() != null) { JavaScript script = javaScript.getJavaScript(); - hyperList.add(new UIMenuNameableCreator(javaScript.getName(), script, getUseMap(paneMap, script.getClass()))); + UIMenuNameableCreator uiMenuNameableCreator= new UIMenuNameableCreator(javaScript.getName(), script, getUseMap(paneMap, script.getClass())); + nameObjects.add(new NameObject(uiMenuNameableCreator.getName(), uiMenuNameableCreator)); + } } - populateBean(hyperList); + this.populate(nameObjects.toArray(new NameObject[nameObjects.size()])); doLayout(); } @@ -77,14 +176,15 @@ public class VanChartHyperLinkPane extends UICorrelationComboBoxPane { } private NameJavaScriptGroup updateNameGroup() { + Nameable[] nameables = update(); + NameJavaScriptGroup nameGroup = new NameJavaScriptGroup(); nameGroup.clear(); - resetItemName(); - java.util.List list = updateBean(); - for(int i = 0; i < list.size(); i++) { - UIMenuNameableCreator menu = (UIMenuNameableCreator)list.get(i); + for(int i = 0; i < nameables.length; i++) { + UIMenuNameableCreator menu = (UIMenuNameableCreator)((NameObject)nameables[i]).getObject(); NameJavaScript nameJava = new NameJavaScript(menu.getName(), (JavaScript)menu.getObj()); + nameJava.setName(nameables[i].getName()); nameGroup.addNameHyperlink(nameJava); } @@ -130,4 +230,12 @@ public class VanChartHyperLinkPane extends UICorrelationComboBoxPane { } return null; } + + protected Object getob2Populate (Object ob2Populate) { + if (ob2Populate == null) { + return ob2Populate; + } + return ((UIMenuNameableCreator)ob2Populate).getObj(); + + } } diff --git a/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomInteractivePane.java b/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomInteractivePane.java index c4ed1ec2d3..0802d8196c 100644 --- a/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomInteractivePane.java +++ b/designer_chart/src/com/fr/plugin/chart/custom/other/VanChartCustomInteractivePane.java @@ -32,7 +32,7 @@ public class VanChartCustomInteractivePane extends VanChartInteractivePane { protected JPanel createHyperlinkPane() { hyperlinkPane = new VanChartCustomPlotHyperlinkPane(); - return TableLayout4VanChartHelper.createTitlePane(Inter.getLocText("M_Insert-Hyperlink"), hyperlinkPane, 0); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("M_Insert-Hyperlink"), hyperlinkPane); } @Override diff --git a/designer_chart/src/com/fr/plugin/chart/designer/TableLayout4VanChartHelper.java b/designer_chart/src/com/fr/plugin/chart/designer/TableLayout4VanChartHelper.java index cda309aaa8..e85ccdc6c3 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/TableLayout4VanChartHelper.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/TableLayout4VanChartHelper.java @@ -21,7 +21,11 @@ public class TableLayout4VanChartHelper { public static JPanel createExpandablePaneWithTitle(String title, JPanel panel) { - return new UIExpandablePane(title, EXPANDABLE_PANE_WIDTH, EXPANDABLE_PANE_HIGHT, panel); + return new UIExpandablePane(title, EXPANDABLE_PANE_WIDTH, EXPANDABLE_PANE_HIGHT, panel){ + protected void setcontentPanelontentPanelBorder (){ + getContentPanel().setBorder(BorderFactory.createEmptyBorder(0 ,10, 0, 15)); + } + }; } public static JPanel createGapTableLayoutPane(String title, Component component) { diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/AutoRefreshPane.java b/designer_chart/src/com/fr/plugin/chart/designer/other/AutoRefreshPane.java index c9fa3a3194..26772f45bf 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/other/AutoRefreshPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/other/AutoRefreshPane.java @@ -6,14 +6,16 @@ import com.fr.design.dialog.DialogActionListener; import com.fr.design.dialog.UIDialog; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.general.Inter; -import com.fr.plugin.chart.base.RefreshMoreLabel; import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.base.RefreshMoreLabel; import com.fr.plugin.chart.designer.PlotFactory; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.style.tooltip.VanChartPlotTooltipPane; import com.fr.plugin.chart.vanchart.VanChart; @@ -35,15 +37,12 @@ public class AutoRefreshPane extends BasicScrollPane { private VanChart chart; private UIButtonGroup moreLabel; private UISpinner autoRefreshTime; - private UIButtonGroup autoTooltip; + private UICheckBox autoTooltip; private UIButton tooltipSet; + private JPanel contentPane; private boolean isLargeModel; - public UIButtonGroup getMoreLabel() { - return moreLabel; - } - public UISpinner getAutoRefreshTime() { return autoRefreshTime; } @@ -66,7 +65,7 @@ public class AutoRefreshPane extends BasicScrollPane { autoRefreshTime = new UISpinner(0, Integer.MAX_VALUE, 1, 0); - autoTooltip = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Open"), Inter.getLocText("Plugin-ChartF_Close")}); + autoTooltip = new UICheckBox(Inter.getLocText("Plugin-ChartF_Auto_Tooltip")); autoTooltip.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { @@ -80,24 +79,26 @@ public class AutoRefreshPane extends BasicScrollPane { jPanel.add(autoTooltip, BorderLayout.CENTER); jPanel.add(tooltipSet, BorderLayout.EAST); + JPanel moreLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_More_Label"), moreLabel); + double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {p, f}; - double[] rowSize = {p, p, p}; + double[] rowSize = {p, p}; Component[][] components = initComponent(jPanel); - JPanel temp = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - - content.add(temp, BorderLayout.CENTER); + contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + contentPane.setBorder(BorderFactory.createEmptyBorder(0,15,0,0)); + content.add(moreLabelPane, BorderLayout.NORTH); + content.add(contentPane, BorderLayout.CENTER); return content; } protected Component[][] initComponent(JPanel autoTooltipPane){ return new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_More_Label")), moreLabel}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Time_Interval")), autoRefreshTime}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Auto_Tooltip")), autoTooltipPane}, + new Component[]{autoTooltip, tooltipSet}, }; } @@ -131,19 +132,19 @@ public class AutoRefreshPane extends BasicScrollPane { protected void layoutContentPane() { leftcontentPane = createContentPane(); - leftcontentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + leftcontentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 0)); this.add(leftcontentPane); } public void checkRefreshEnable() { Boolean enable = moreLabel.getSelectedIndex() == 0; - autoRefreshTime.setEnabled(enable); + contentPane.setVisible(enable); autoTooltip.setEnabled(enable && !isLargeModel); checkTooltipEnable(); } public void checkTooltipEnable() { - Boolean enable = moreLabel.getSelectedIndex() == 0 && autoTooltip.getSelectedIndex() == 0; + Boolean enable = moreLabel.getSelectedIndex() == 0 && autoTooltip.isSelected(); tooltipSet.setEnabled(enable && !isLargeModel); } @@ -152,7 +153,7 @@ public class AutoRefreshPane extends BasicScrollPane { public void populateBean(RefreshMoreLabel refreshMoreLabel) { moreLabel.setSelectedIndex(refreshMoreLabel.isMoreLabel() ? 0 : 1); populateAutoRefreshTime(); - autoTooltip.setSelectedIndex(refreshMoreLabel.isAutoTooltip() ? 0 : 1); + autoTooltip.setSelected(refreshMoreLabel.isAutoTooltip()); checkRefreshEnable(); @@ -173,7 +174,7 @@ public class AutoRefreshPane extends BasicScrollPane { } protected void updateAutoTooltip(RefreshMoreLabel refreshMoreLabel) { - refreshMoreLabel.setAutoTooltip(autoTooltip.getSelectedIndex() == 0); + refreshMoreLabel.setAutoTooltip(autoTooltip.isSelected()); } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/AutoRefreshPaneWithoutTooltip.java b/designer_chart/src/com/fr/plugin/chart/designer/other/AutoRefreshPaneWithoutTooltip.java index 0656bb3f7f..40d8e74c8e 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/other/AutoRefreshPaneWithoutTooltip.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/other/AutoRefreshPaneWithoutTooltip.java @@ -19,7 +19,6 @@ public class AutoRefreshPaneWithoutTooltip extends AutoRefreshPane { protected Component[][] initComponent(JPanel autoTooltipPane){ return new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_More_Label")), getMoreLabel()}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Time_Interval")), getAutoRefreshTime()} }; } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java new file mode 100644 index 0000000000..caa06d5961 --- /dev/null +++ b/designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java @@ -0,0 +1,84 @@ +package com.fr.plugin.chart.designer.other; + +import com.fr.base.chart.BasePlot; +import com.fr.chart.chartattr.Plot; +import com.fr.chart.chartglyph.ConditionAttr; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.controlpane.NameObjectCreator; +import com.fr.design.gui.controlpane.UnrepeatedNameHelper; +import com.fr.design.gui.ilist.ListModelElement; +import com.fr.general.Inter; +import com.fr.general.NameObject; +import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator; +import com.fr.stable.Nameable; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; + +/** + * Created by mengao on 2017/8/18. + */ +public class ChartConditionNameObjectCreator extends NameObjectCreator { + private BasePlot plot; + private ConditionUIMenuNameableCreator conditionUIMenuNameableCreator; + + public ChartConditionNameObjectCreator(BasePlot plot, String menuName, Class clazz, Class updatePane) { + super(menuName, clazz, updatePane); + this.plot = plot; + } + + /** + * create Nameable + * + * @param helper + * @return + */ + public Nameable createNameable(UnrepeatedNameHelper helper) { + Constructor constructor = null; + try { + constructor = clazzOfInitCase.getConstructor(Plot.class, String.class, Object.class, Class.class); + ConditionUIMenuNameableCreator conditionUIMenuNameableCreator = constructor.newInstance(plot, Inter.getLocText("Chart-Condition_Attributes"), new ConditionAttr(), getUpdatePane()); + return new NameObject(helper.createUnrepeatedName(this.menuName()), conditionUIMenuNameableCreator); + + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } + return null; + } + + /** + * @param ob + * @return + */ + public Object acceptObject2Populate(Object ob) { + if (ob instanceof NameObject) { + ob = ((NameObject) ob).getObject(); + } + if (clazzOfObject != null && clazzOfObject.isInstance(ob)) { + doSthChanged4Icon(ob); + conditionUIMenuNameableCreator = (ConditionUIMenuNameableCreator) ((ConditionUIMenuNameableCreator) ob).clone(); + return ob; + } + + return null; + } + + /** + * save update bean + * + * @param wrapper + * @param bean + */ + public void saveUpdatedBean(ListModelElement wrapper, Object bean) { + conditionUIMenuNameableCreator.setObj(bean); + ((NameObject) wrapper.wrapper).setObject(conditionUIMenuNameableCreator); + } + + +} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java b/designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java new file mode 100644 index 0000000000..bc8ea431e6 --- /dev/null +++ b/designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java @@ -0,0 +1,84 @@ +package com.fr.plugin.chart.designer.other; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.controlpane.NameObjectCreator; +import com.fr.design.gui.controlpane.UnrepeatedNameHelper; +import com.fr.design.gui.ilist.ListModelElement; +import com.fr.design.gui.imenutable.UIMenuNameableCreator; +import com.fr.general.NameObject; +import com.fr.stable.Nameable; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; + +/** + * Created by mengao on 2017/8/21. + */ +public class ChartHyperlinkNameObjectCreartor extends NameObjectCreator { + private Object object; + private UIMenuNameableCreator uIMenuNameableCreator; + + + public ChartHyperlinkNameObjectCreartor(Object object, String menuName, Class clazz, Class updatePane) { + super(menuName, clazz, updatePane); + this.object = object; + + } + + /** + * create Nameable + * + * @param helper + * @return + */ + public Nameable createNameable(UnrepeatedNameHelper helper) { + Constructor constructor = null; + try { + constructor = clazzOfInitCase.getConstructor(String.class, Object.class, Class.class); + UIMenuNameableCreator uIMenuNameableCreator = constructor.newInstance(menuName, object, getUpdatePane()); + return new NameObject(helper.createUnrepeatedName(this.menuName()), uIMenuNameableCreator); + + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } + return null; + } + + /** + * @param ob + * @return + */ + public Object acceptObject2Populate(Object ob) { + if (ob instanceof NameObject) { + ob = ((NameObject) ob).getObject(); + } + if (clazzOfObject != null && clazzOfObject.isInstance(ob)) { + doSthChanged4Icon(ob); + uIMenuNameableCreator = ((UIMenuNameableCreator) ob).clone(); + if (uIMenuNameableCreator.getObj() != null && object.getClass().isInstance(uIMenuNameableCreator.getObj())) { + return ob; + } + } + + return null; + } + + /** + * save update bean + * + * @param wrapper + * @param bean + */ + public void saveUpdatedBean(ListModelElement wrapper, Object bean) { + uIMenuNameableCreator.setObj(bean); + ((NameObject) wrapper.wrapper).setObject(uIMenuNameableCreator); + } + + +} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java index 1819c291dc..5f80ae17ed 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java @@ -4,10 +4,12 @@ import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionCollection; import com.fr.design.condition.ConditionAttributesPane; -import com.fr.design.gui.frpane.UICorrelationComboBoxPane; +import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.general.Inter; +import com.fr.general.NameObject; import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator; +import com.fr.stable.Nameable; import java.awt.*; import java.util.ArrayList; @@ -20,18 +22,8 @@ import java.util.List; public class VanChartConditionAttrContentPane extends AbstractConditionAttrContentPane{ private static final Dimension DIALOG_SIZE = new Dimension(500, 600); - private UICorrelationComboBoxPane conditionPane; + private UIListControlPane conditionPane; public VanChartConditionAttrContentPane() { - if (conditionPane == null) { - conditionPane = new UICorrelationComboBoxPane(){ - protected Dimension getDialogSize() { - return DIALOG_SIZE; - } - }; - } - - this.setLayout(new BorderLayout()); - this.add(conditionPane, BorderLayout.CENTER); } public void populateBean(Plot plot, Class showPane) { @@ -41,19 +33,28 @@ public class VanChartConditionAttrContentPane extends AbstractConditionAttrConte } public void populateBean(Plot plot, ConditionCollection collection, Class showPane){ + + if (conditionPane == null) { + conditionPane = new VanChartListControlPane(plot); + } + + this.setLayout(new BorderLayout()); + this.add(conditionPane, BorderLayout.CENTER); + + //todo@mango List list = new ArrayList(); list.add(new ConditionUIMenuNameableCreator(plot, Inter.getLocText("Chart-Condition_Attributes"), new ConditionAttr(), showPane)); - conditionPane.refreshMenuAndAddMenuAction(list); - List valueList = new ArrayList(); + NameObject[] nameables = new NameObject[collection.getConditionAttrSize()]; for(int i = 0; i < collection.getConditionAttrSize(); i++) { - valueList.add(new ConditionUIMenuNameableCreator(plot, collection.getConditionAttr(i).getName(), collection.getConditionAttr(i), showPane)); + ConditionUIMenuNameableCreator c =new ConditionUIMenuNameableCreator(plot, collection.getConditionAttr(i).getName(), collection.getConditionAttr(i), showPane); + nameables[i]=(new NameObject(c.getName(),c)); } - conditionPane.populateBean(valueList); + conditionPane.populate(nameables); conditionPane.doLayout(); } @@ -62,14 +63,17 @@ public class VanChartConditionAttrContentPane extends AbstractConditionAttrConte update(cc); } - public void update(ConditionCollection cc){ - List list = conditionPane.updateBean(); + public void update(ConditionCollection cc) { + Nameable[] nameables = conditionPane.update(); cc.clearConditionAttr(); - for(UIMenuNameableCreator creator : list){ - ConditionAttr ca = (ConditionAttr)creator.getObj(); - ca.setName(creator.getName()); - cc.addConditionAttr(ca); + for (int i = 0; i < nameables.length; i++) { + if (nameables[i] instanceof UIMenuNameableCreator) { + UIMenuNameableCreator uiMenuNameableCreator = (UIMenuNameableCreator) nameables[i]; + ConditionAttr ca = (ConditionAttr) uiMenuNameableCreator.getObj(); + ca.setName(uiMenuNameableCreator.getName()); + cc.addConditionAttr(ca); + } } } } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrPane.java b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrPane.java index 20ad534dee..97a2a5bcb2 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrPane.java @@ -4,15 +4,15 @@ import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.condition.ConditionAttributesPane; -import com.fr.design.dialog.BasicScrollPane; import com.fr.general.Inter; +import com.fr.plugin.chart.designer.AbstractVanChartScrollPane; import javax.swing.*; //条件属性 -public class VanChartConditionAttrPane extends BasicScrollPane { +public class VanChartConditionAttrPane extends AbstractVanChartScrollPane { private static final long serialVersionUID = 5725969986029470291L; - private AbstractConditionAttrContentPane conditionAttrContentPane; + private VanChartConditionAttrContentPane conditionAttrContentPane; public VanChartConditionAttrPane() { super(); @@ -27,7 +27,7 @@ public class VanChartConditionAttrPane extends BasicScrollPane { return conditionAttrContentPane; } - protected AbstractConditionAttrContentPane createConditionAttrContentPane() { + protected VanChartConditionAttrContentPane createConditionAttrContentPane() { return new VanChartConditionAttrContentPane(); } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartInteractivePane.java b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartInteractivePane.java index 130d26c0f8..2a11469963 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartInteractivePane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartInteractivePane.java @@ -4,7 +4,6 @@ import com.fr.base.Formula; import com.fr.base.Utils; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; -import com.fr.design.dialog.BasicScrollPane; import com.fr.design.formula.TinyFormulaPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIToggleButton; @@ -12,7 +11,6 @@ import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.plot.VanChartPlot; @@ -23,6 +21,7 @@ import com.fr.plugin.chart.base.VanChartConstants; import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartZoom; import com.fr.plugin.chart.custom.component.VanChartHyperLinkPane; +import com.fr.plugin.chart.designer.AbstractVanChartScrollPane; import com.fr.plugin.chart.designer.PlotFactory; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.vanchart.VanChart; @@ -33,7 +32,7 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -public class VanChartInteractivePane extends BasicScrollPane { +public class VanChartInteractivePane extends AbstractVanChartScrollPane { private static final long serialVersionUID = 8135452818502145597L; private static final int AUTO_REFRESH_LEFT_GAP = 18; @@ -43,7 +42,7 @@ public class VanChartInteractivePane extends BasicScrollPane { protected UICheckBox fullScreenDisplay; protected UIToggleButton collapse; - protected UIToggleButton isChartAnimation; + protected UIButtonGroup isChartAnimation; //坐标轴翻转属性 private UIButtonGroup axisRotation; @@ -56,6 +55,8 @@ public class VanChartInteractivePane extends BasicScrollPane { private TinyFormulaPane from; private TinyFormulaPane to; private UIButtonGroup zoomType; + private JPanel changeEnablePane; + private JPanel zoomTypePane; protected VanChartHyperLinkPane superLink; @@ -89,22 +90,15 @@ public class VanChartInteractivePane extends BasicScrollPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {p, f}; - double[] rowSize = {p,p,p,p,p,p,p,p,p,p,p}; + double[] rowSize = {p,p,p,p,p,p}; - JSeparator jSeparator4Zoom = plot.isSupportZoomDirection() ? new JSeparator() : null; - JSeparator jSeparator4AxisRotation = plot.getAxisPlotType() == AxisPlotType.RECTANGLE ? new JSeparator() : null; Component[][] components = new Component[][]{ new Component[]{createToolBarPane(new double[]{p,p,p,p,p}, columnSize),null}, - new Component[]{new JSeparator(),null}, new Component[]{createAnimationPane(),null}, - new Component[]{new JSeparator(),null}, - new Component[]{createAxisRotationPane(new double[]{p}, columnSize, plot),null}, - new Component[]{jSeparator4AxisRotation,null}, + new Component[]{createAxisRotationPane(new double[]{p,p}, columnSize, plot),null}, new Component[]{createZoomPane(new double[]{p,p,p}, columnSize, plot),null}, - new Component[]{jSeparator4Zoom,null}, new Component[]{createAutoRefreshPane(plot),null}, - new Component[]{new JSeparator(),null}, new Component[]{createHyperlinkPane(),null} }; @@ -122,18 +116,18 @@ public class VanChartInteractivePane extends BasicScrollPane { zoomType = new UIButtonGroup(getNameArray(), getValueArray()); zoomGesture = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Open"), Inter.getLocText("Plugin-ChartF_Close")}); - JPanel zoomWidgetPane = TableLayout4VanChartHelper.createTableLayoutPaneWithSmallTitle(Inter.getLocText("Plugin-ChartF_ZoomWidget"), zoomWidget); - JPanel zoomGesturePane = TableLayout4VanChartHelper.createTableLayoutPaneWithSmallTitle(Inter.getLocText("Plugin-ChartF_ZoomGesture"), zoomGesture); + JPanel zoomWidgetPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_ZoomWidget"), zoomWidget); + JPanel zoomGesturePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_ZoomGesture"), zoomGesture); Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Change")), zoomResize}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_WidgetBoundary")), zoomResize}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_From")), from}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_To")), to}, }; - JPanel temp = TableLayoutHelper.createTableLayoutPane(components, row, col); - JPanel changeEnablePane = TableLayout4VanChartHelper.createTableLayoutPaneWithSmallTitle(Inter.getLocText("Plugin-ChartF_WidgetBoundary"), temp); - - JPanel zoomTypePane = TableLayout4VanChartHelper.createTableLayoutPaneWithSmallTitle(Inter.getLocText("Plugin-ChartF_ZoomType"), zoomType); + changeEnablePane = TableLayoutHelper.createTableLayoutPane(components, row, col); + changeEnablePane.setBorder(BorderFactory.createEmptyBorder(10,15,0,0)); + zoomTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_ZoomType"), zoomType); + zoomTypePane.setBorder(BorderFactory.createEmptyBorder(0,15,0,0)); JPanel panel = createZoomPaneContent(zoomWidgetPane, zoomGesturePane, changeEnablePane, zoomTypePane, plot); zoomWidget.addActionListener(new ActionListener() { @Override @@ -141,7 +135,7 @@ public class VanChartInteractivePane extends BasicScrollPane { checkZoomPane(); } }); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Chart-Use_Zoom"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Chart-Use_Zoom"), panel); } protected JPanel createZoomPaneContent(JPanel zoomWidgetPane, JPanel zoomGesturePane, JPanel changeEnablePane, JPanel zoomTypePane, VanChartPlot plot) { @@ -161,10 +155,11 @@ public class VanChartInteractivePane extends BasicScrollPane { axisRotation = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Open"), Inter.getLocText("Plugin-ChartF_Close")}); Component[][] components = new Component[][]{ - new Component[]{new UILabel("", SwingConstants.RIGHT),axisRotation} + new Component[]{null,null}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Reversal")),axisRotation} }; - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Axis_Rotation") + ":", panel); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Axis"), panel); } protected String[] getNameArray() { @@ -186,16 +181,16 @@ public class VanChartInteractivePane extends BasicScrollPane { Component[][] components = createToolBarComponents(); - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_ToolBar"), panel); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_ToolBar"), panel); } protected Component[][] createToolBarComponents() { return new Component[][]{ - new Component[]{isSort, null}, - new Component[]{exportImages, null}, - new Component[]{fullScreenDisplay, null}, - new Component[]{collapse, null}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Content")),isSort}, + new Component[]{null, exportImages}, + new Component[]{null, fullScreenDisplay}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_layout")),collapse}, }; } @@ -209,15 +204,16 @@ public class VanChartInteractivePane extends BasicScrollPane { protected JPanel createAnimationPane(){ - isChartAnimation = new UIToggleButton(Inter.getLocText("Plugin-ChartF_OpenAnimation")); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Animation"), isChartAnimation); + isChartAnimation = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Open"), Inter.getLocText("Plugin-ChartF_Close")}); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_Animation_Effects"), isChartAnimation); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Animation"), panel); } protected JPanel createAutoRefreshPane(VanChartPlot plot){ autoRefreshPane = getMoreLabelPane(plot); - return TableLayout4VanChartHelper.createTitlePane(Inter.getLocText("Plugin-ChartF_Moniter_refresh"), autoRefreshPane, AUTO_REFRESH_LEFT_GAP); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Moniter_refresh"), autoRefreshPane); } protected AutoRefreshPane getMoreLabelPane(VanChartPlot plot) { @@ -227,16 +223,14 @@ public class VanChartInteractivePane extends BasicScrollPane { protected JPanel createHyperlinkPane() { superLink = new VanChartHyperLinkPane(); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("M_Insert-Hyperlink"), superLink); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("M_Insert-Hyperlink"), superLink); } private void checkZoomPane() { boolean zoomWidgetEnabled = zoomWidget.getSelectedIndex() == 0; - zoomResize.setEnabled(zoomWidgetEnabled); - GUICoreUtils.setEnabled(from, zoomWidgetEnabled); - GUICoreUtils.setEnabled(to, zoomWidgetEnabled); - zoomType.setEnabled(!zoomWidgetEnabled); + changeEnablePane.setVisible(zoomWidgetEnabled); + zoomTypePane.setVisible(!zoomWidgetEnabled); } @Override @@ -307,7 +301,7 @@ public class VanChartInteractivePane extends BasicScrollPane { private void populateChartAnimate(Chart chart, Plot plot) { if(plot.isSupportAnimate()) { - isChartAnimation.setSelected(chart.isJSDraw()); + isChartAnimation.setSelectedIndex(chart.isJSDraw() ? 0 : 1); isChartAnimation.setEnabled(!largeModel(plot)); } } @@ -410,7 +404,7 @@ public class VanChartInteractivePane extends BasicScrollPane { private void updateChartAnimate(Chart chart, Plot plot) { if(plot.isSupportAnimate()) { - chart.setJSDraw(isChartAnimation.isSelected()); + chart.setJSDraw(isChartAnimation.getSelectedIndex()==0); } } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java new file mode 100644 index 0000000000..6ab1078e5d --- /dev/null +++ b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java @@ -0,0 +1,102 @@ +package com.fr.plugin.chart.designer.other; + +import com.fr.base.chart.BasePlot; +import com.fr.chart.chartattr.Plot; +import com.fr.chart.chartglyph.ConditionAttr; +import com.fr.chart.chartglyph.ConditionCollection; +import com.fr.design.ChartTypeInterfaceManager; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.gui.controlpane.UIListControlPane; +import com.fr.design.gui.imenutable.UIMenuNameableCreator; +import com.fr.design.mainframe.DesignerContext; +import com.fr.general.Inter; +import com.fr.general.NameObject; +import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator; +import com.fr.stable.Nameable; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; + +/** + * Created by mengao on 2017/8/18. + */ +public class VanChartListControlPane extends UIListControlPane { + + public VanChartListControlPane(BasePlot plot) { + super(plot); + } + + @Override + public void populate(Nameable[] nameableArray) { + initComponentPane(); + super.populate(nameableArray); + } + + @Override + public NameableCreator[] createNameableCreators() { + return new ChartConditionNameObjectCreator[]{new ChartConditionNameObjectCreator(this.plot, Inter.getLocText("Condition_Attributes"), ConditionUIMenuNameableCreator.class, ChartTypeInterfaceManager.getInstance().getPlotConditionPane((Plot) plot).getClass())}; + } + + + protected BasicBeanPane createPaneByCreators(NameableCreator creator) { + Constructor constructor = null; + try { + constructor = creator.getUpdatePane().getConstructor(Plot.class); + return constructor.newInstance(plot); + + } catch (InstantiationException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } + return null; + } + + @Override + public void saveSettings() { + if (isPopulating) { + return; + } + updateConditionCollection(((VanChartPlot) plot).getConditionCollection()); + DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); + } + + @Override + public String getAddItemText() { + return Inter.getLocText("FR-Designer_Add_Condition"); + } + + @Override + public String title4PopupWindow() { + return Inter.getLocText("Condition_Attributes"); + } + + protected Object getob2Populate(Object ob2Populate) { + return ((ConditionUIMenuNameableCreator) ob2Populate).getObj(); + + } + + /** + * Update. + */ + public void updateConditionCollection(ConditionCollection cc) { + Nameable[] nameables = this.update(); + + cc.clearConditionAttr(); + + for (int i = 0; i < nameables.length; i++) { + UIMenuNameableCreator uiMenuNameableCreator = (UIMenuNameableCreator) ((NameObject) nameables[i]).getObject(); + ConditionAttr ca = (ConditionAttr) uiMenuNameableCreator.getObj(); + ca.setName(nameables[i].getName()); + cc.addConditionAttr(ca); + + } + } + +} diff --git a/designer_chart/src/com/fr/plugin/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java b/designer_chart/src/com/fr/plugin/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java index 1cab9bad2d..f5c214e9b4 100644 --- a/designer_chart/src/com/fr/plugin/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java +++ b/designer_chart/src/com/fr/plugin/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java @@ -1,5 +1,6 @@ package com.fr.plugin.chart.drillmap.designer.other; +import com.fr.chart.base.DrillMapTools; import com.fr.chart.chartattr.Chart; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.layout.TableLayout; @@ -11,7 +12,6 @@ import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.component.background.VanChartBackgroundPaneWithOutImageAndShadow; import com.fr.plugin.chart.designer.other.VanChartInteractivePaneWithMapZoom; -import com.fr.chart.base.DrillMapTools; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import javax.swing.*; @@ -36,16 +36,11 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith double[] columnSize = {p, f}; double[] rowSize = {p, p, p, p, p, p, p, p, p, p, p}; Component[][] components = new Component[][]{ - new Component[]{createToolBarPane(rowSize, columnSize),null}, - new Component[]{new JSeparator(),null}, + new Component[]{createToolBarPane(new double[]{p, p, p}, columnSize),null}, new Component[]{createAnimationPane(),null}, - new Component[]{new JSeparator(),null}, new Component[]{createZoomPane(new double[]{p,p,p}, columnSize, plot),null}, - new Component[]{new JSeparator(),null}, new Component[]{createDrillToolsPane(), null}, - new Component[]{new JSeparator(), null}, new Component[]{createAutoRefreshPane(plot),null}, - new Component[]{new JSeparator(),null}, new Component[]{createHyperlinkPane(),null} }; @@ -54,18 +49,27 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith private JPanel createDrillToolsPane() { openOrClose = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Open"), Inter.getLocText("Plugin-ChartF_Close")}); - textAttrPane = new ChartTextAttrPane(); - backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(); - selectBackgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(); + textAttrPane = new ChartTextAttrPane(){ + protected Component[][] getComponents(JPanel buttonPane) { + return new Component[][]{ + new Component[]{null}, + new Component[]{fontNameComboBox}, + new Component[]{buttonPane} + }; + } + }; + backgroundPane = new VanChartBackgroundPane4DrillMap(); + selectBackgroundPane = new VanChartBackgroundPane4DrillMap(); catalogSuperLink = new VanChartCatalogHyperLinkPane(); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {f}; - double[] rowSize = {p,p,p,p,p}; + double[] rowSize = {p,p,p,p,p,p}; Component[][] components = new Component[][]{ + new Component[]{null,null}, new Component[]{openOrClose}, - new Component[]{createTitlePane(Inter.getLocText("FR-Designer-Widget_Style"), textAttrPane)}, + new Component[]{createTitlePane(Inter.getLocText("Plugin-Chart_Character"), textAttrPane)}, new Component[]{createTitlePane(Inter.getLocText("Plugin-ChartF_Background"), backgroundPane)}, new Component[]{createTitlePane(Inter.getLocText("Plugin-ChartF_Select_Color"), selectBackgroundPane)}, new Component[]{createTitlePane(Inter.getLocText("M_Insert-Hyperlink"), catalogSuperLink)} @@ -79,11 +83,11 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith } }); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Drill_Dir"), drillPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Drill_Dir"), drillPane); } private JPanel createTitlePane(String title, Component component) { - return TableLayout4VanChartHelper.createTitlePane(title, component, 20); + return TableLayout4VanChartHelper.createGapTableLayoutPane(title, component); } private void checkEnable() { @@ -133,4 +137,16 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith catalogSuperLink.update(plot); } } + + public class VanChartBackgroundPane4DrillMap extends VanChartBackgroundPaneWithOutImageAndShadow{ + @Override + protected Component[][] getPaneComponents() { + return new Component[][]{ + new Component[]{null}, + new Component[]{typeComboBox}, + new Component[]{centerPane}, + new Component[]{transparent}, + }; + } + } } \ No newline at end of file