From 090581d5ea21afc00e2df8055d0aeee59606a4fe Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Tue, 12 Sep 2017 19:11:41 +0800 Subject: [PATCH 01/23] =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=8A=A0=E8=BD=BDPlugi?= =?UTF-8?q?nManager=E5=92=8CPluginContexts=EF=BC=8C=E4=BF=9D=E6=8A=A4Plugi?= =?UTF-8?q?nContext=E5=AF=B9=E8=B1=A1=E4=B8=8D=E8=A2=AB=E4=BB=A3=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/start/BaseDesigner.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/designer_base/src/com/fr/start/BaseDesigner.java b/designer_base/src/com/fr/start/BaseDesigner.java index cd8b3f3b0..7e746251b 100644 --- a/designer_base/src/com/fr/start/BaseDesigner.java +++ b/designer_base/src/com/fr/start/BaseDesigner.java @@ -22,10 +22,19 @@ import com.fr.env.SignIn; import com.fr.file.FILE; import com.fr.file.FILEFactory; import com.fr.file.FileFILE; -import com.fr.general.*; +import com.fr.general.ComparatorUtils; +import com.fr.general.FRLogger; +import com.fr.general.GeneralContext; +import com.fr.general.Inter; +import com.fr.general.ModuleContext; import com.fr.plugin.PluginCollector; import com.fr.plugin.manage.PluginManager; -import com.fr.stable.*; +import com.fr.plugin.manage.PluginStartup; +import com.fr.stable.ArrayUtils; +import com.fr.stable.BuildContext; +import com.fr.stable.OperatingSystem; +import com.fr.stable.ProductConstants; +import com.fr.stable.StableUtils; import javax.swing.*; import java.awt.*; @@ -84,7 +93,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { DesignUtils.creatListeningServer(getStartPort(), startFileSuffix()); //初始化插件引擎 - PluginManager.init(); + PluginStartup.start(); // 初始化Log Handler DesignerEnvManager.loadLogSetting(); DesignerFrame df = createDesignerFrame(); From bf8e3e3342edc711870f11d23d37a206ed311827 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Tue, 12 Sep 2017 20:08:37 +0800 Subject: [PATCH 02/23] =?UTF-8?q?=E4=BF=AE=E6=94=B99.0bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/TableLayout4VanChartHelper.java | 5 +- .../component/VanChartHtmlLabelPane.java | 2 - ...rtBackgroundPaneWithOutImageAndShadow.java | 24 ++++---- .../label/VanChartPlotLabelDetailPane.java | 1 + .../VanChartAbstractPlotSeriesPane.java | 10 ++-- .../designer/data/comp/DrillMapLayerPane.java | 56 +++++++++++-------- .../VanChartDrillMapInteractivePane.java | 44 ++++++++------- .../chart/gauge/VanChartGaugeSeriesPane.java | 15 ++--- .../chart/pie/VanChartPieSeriesPane.java | 9 +-- .../component/LegendLabelFormatPane.java | 2 + 10 files changed, 84 insertions(+), 84 deletions(-) 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 0c95ca6fe..18a1c9489 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/TableLayout4VanChartHelper.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/TableLayout4VanChartHelper.java @@ -5,7 +5,6 @@ import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.general.Inter; import javax.swing.*; import java.awt.*; @@ -42,9 +41,11 @@ public class TableLayout4VanChartHelper { double f = TableLayout.FILL; double[] columnSize = {f, componentWidth}; double[] rowSize = {p, p}; + UILabel label = new UILabel(title); + label.setVerticalAlignment(SwingConstants.TOP); Component[][] components = new Component[][]{ new Component[]{null, null}, - new Component[]{new UILabel(Inter.getLocText(title)), component}, + new Component[]{label, component}, }; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, COMPONENT_INTERVAL, LayoutConstants.VGAP_LARGE); } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartHtmlLabelPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartHtmlLabelPane.java index 435bfe62c..107ec5b66 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartHtmlLabelPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartHtmlLabelPane.java @@ -15,7 +15,6 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.general.Inter; import com.fr.plugin.chart.base.VanChartHtmlLabel; -import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.style.VanChartStylePane; import javax.swing.*; @@ -66,7 +65,6 @@ public class VanChartHtmlLabelPane extends JPanel{ }; JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - contentPane.setBorder(BorderFactory.createEmptyBorder(0, (int)TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH + TableLayout4VanChartHelper.COMPONENT_INTERVAL,0,0)); this.setLayout(new BorderLayout()); this.add(contentPane, BorderLayout.CENTER); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java index f36456216..14765d058 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java @@ -16,23 +16,20 @@ import java.awt.*; */ public class VanChartBackgroundPaneWithOutImageAndShadow extends VanChartBackgroundPane { - public VanChartBackgroundPaneWithOutImageAndShadow() { - initComponents(); - + @Override + protected JPanel initContentPanel() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {p, f}; - double[] rowSize = { p,p,p,p,p}; + double[] rowSize = { p,p,p}; - JPanel panel = TableLayoutHelper.createTableLayoutPane(getPaneComponents(),rowSize,columnSize); - this.setLayout(new BorderLayout()); - this.add(panel,BorderLayout.CENTER); + return TableLayoutHelper.createTableLayoutPane(getPaneComponents(),rowSize,columnSize); } @Override protected void initList() { - paneList.add(new NullBackgroundQuickPane(){ + paneList.add(new NullBackgroundQuickPane() { /** * 名称 * @@ -46,14 +43,15 @@ public class VanChartBackgroundPaneWithOutImageAndShadow extends VanChartBackgro paneList.add(new ColorBackgroundQuickPane()); } + @Override protected Component[][] getPaneComponents() { - return new Component[][]{ - new Component[]{null, null}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Shape_Fill")), typeComboBox}, - new Component[]{null, centerPane}, - new Component[]{new UILabel(Inter.getLocText("Plugin-Chart_Alpha")), transparent}, + return new Component[][]{ + new Component[]{typeComboBox, null}, + new Component[]{centerPane, null}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Alpha")), transparent}, }; } + } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartPlotLabelDetailPane.java index 1e507415c..ba2f84dbb 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -205,6 +205,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { private void checkStyleUse() { textFontPane.setVisible(style.getSelectedIndex() == 1); + textFontPane.setPreferredSize(style.getSelectedIndex() == 1 ? new Dimension(0, 60) : new Dimension(0, 0)); } private void checkPosition() { diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java index c5f5b19cf..88ee11763 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java @@ -68,6 +68,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP protected JPanel stackAndAxisEditExpandablePane;//堆積和坐標軸展开面板 private RadiusCardLayoutPane radiusPane;//半径设置界面 + private JPanel radiusPaneWithTitle; private UIButtonGroup largeDataModelGroup;//大数据模式 @@ -158,9 +159,10 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP } //半径界面 - protected RadiusCardLayoutPane createRadiusPane() { + protected JPanel createRadiusPane() { radiusPane = initRadiusPane(); - return radiusPane; + radiusPaneWithTitle = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_Radius_Set"), radiusPane); + return ((VanChartPlot)plot).isInCustom() ? null : radiusPaneWithTitle; } protected JPanel createLargeDataModelPane() { @@ -309,10 +311,10 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP * @param plot */ private void checkRadiusPane(Plot plot) { - radiusPane.setVisible(true); + radiusPaneWithTitle.setVisible(true); if (plot instanceof VanChartPlot){ if (((VanChartPlot) plot).isInCustom()){ - radiusPane.setVisible(false); + radiusPaneWithTitle.setVisible(false); } } } diff --git a/designer_chart/src/com/fr/plugin/chart/drillmap/designer/data/comp/DrillMapLayerPane.java b/designer_chart/src/com/fr/plugin/chart/drillmap/designer/data/comp/DrillMapLayerPane.java index fa62f7f56..81e1b9ebe 100644 --- a/designer_chart/src/com/fr/plugin/chart/drillmap/designer/data/comp/DrillMapLayerPane.java +++ b/designer_chart/src/com/fr/plugin/chart/drillmap/designer/data/comp/DrillMapLayerPane.java @@ -8,12 +8,13 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.drillmap.DrillMapHelper; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; -import com.fr.plugin.chart.type.MapType; -import com.fr.plugin.chart.type.ZoomLevel; import com.fr.plugin.chart.map.designer.type.VanChartMapSourceChoosePane; import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper; +import com.fr.plugin.chart.type.MapType; +import com.fr.plugin.chart.type.ZoomLevel; import javax.swing.*; import javax.swing.tree.DefaultMutableTreeNode; @@ -48,29 +49,28 @@ public class DrillMapLayerPane extends BasicScrollPane { @Override protected void layoutContentPane() { leftcontentPane = createContentPane(); - leftcontentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); + leftcontentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); this.add(leftcontentPane); } @Override protected JPanel createContentPane() { - if(mapDataTree == null){ + if (mapDataTree == null) { mapDataTree = new MapDataTree(CompatibleGeoJSONTreeHelper.getRootNodeWithoutPara(oldGeoUrl)); mapDataTree.setRootVisible(true); } + JPanel mapDataTreePanel = new JPanel(new BorderLayout()); + mapDataTreePanel.add(mapDataTree); + double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {f}; - double[] rowSize = {p,p,p,p,p,p}; + double[] rowSize = {p, p}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Layer_Tree"))}, - new Component[]{new JSeparator()}, - new Component[]{mapDataTree}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Layer_Detail"))}, - new Component[]{new JSeparator()}, - new Component[]{createLayerDetailPane()} + new Component[]{createTitlePane(Inter.getLocText("Plugin-ChartF_Layer_Tree"), mapDataTreePanel)}, + new Component[]{createTitlePane(Inter.getLocText("Plugin-ChartF_Layer_Detail"), createLayerDetailPane())} }; JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); @@ -79,21 +79,29 @@ public class DrillMapLayerPane extends BasicScrollPane { return panel; } + private JPanel createTitlePane (String title, JPanel panel) { + JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel); + panel.setBorder(BorderFactory.createEmptyBorder(10,5,0,0)); + jPanel.setBorder(BorderFactory.createEmptyBorder(0,5,0,0)); + return jPanel; + } + private JPanel createLayerDetailPane() { double p = TableLayout.PREFERRED; - double[] columnSize = {p,p,p}; + double f = TableLayout.FILL; + double[] columnSize = {f, p, p}; double[] rowSize = new double[depth + 1]; detailComps = new Component[depth + 1][3]; rowSize[0] = p; detailComps[0] = new Component[]{ new UILabel(Inter.getLocText("Plugin-Chart_Descriptor")), - new UILabel(Inter.getLocText("Plugin-ChartF_Layer_Zoom_Level")), + new UILabel(Inter.getLocText("Plugin-ChartF_Zoom_Layer")), new UILabel(Inter.getLocText("Plugin-ChartF_Layer_Map_Type")) }; - for(int i = 0; i < depth; i++){ + for (int i = 0; i < depth; i++) { rowSize[i + 1] = p; int d = i + 1; - UILabel label = new UILabel(String.format("%s%d%s",Inter.getLocText("Plugin-ChartF_Index1"), d, Inter.getLocText("Plugin-ChartF_Index3"))); + UILabel label = new UILabel(String.format("%s%d%s", Inter.getLocText("Plugin-ChartF_Index1"), d, Inter.getLocText("Plugin-ChartF_Index3"))); UIComboBox level = new UIComboBox(VanChartMapSourceChoosePane.ZOOM_LEVELS); level.setEnabled(i != 0); UIComboBox type = new UIComboBox(TEMP.get(oldMapType)); @@ -112,16 +120,16 @@ public class DrillMapLayerPane extends BasicScrollPane { public void populateBean(ChartCollection ob) { VanChartDrillMapPlot drillMapPlot = DrillMapHelper.getDrillMapPlot(ob); - if(drillMapPlot != null) { + if (drillMapPlot != null) { java.util.List levelList = drillMapPlot.getLayerLevelList(); java.util.List mapTypeList = drillMapPlot.getLayerMapTypeList(); - if(detailComps == null || drillMapPlot.getMapType() != oldMapType || !ComparatorUtils.equals(drillMapPlot.getGeoUrl(), oldGeoUrl)){ + if (detailComps == null || drillMapPlot.getMapType() != oldMapType || !ComparatorUtils.equals(drillMapPlot.getGeoUrl(), oldGeoUrl)) { oldMapType = drillMapPlot.getMapType(); oldGeoUrl = drillMapPlot.getGeoUrl(); DefaultMutableTreeNode root = CompatibleGeoJSONTreeHelper.getNodeByJSONPath(oldGeoUrl); - if(root != null){ + if (root != null) { mapDataTree.changeRootNode(root); depth = root.getDepth() + 1;//根节点也算一层 } @@ -132,18 +140,18 @@ public class DrillMapLayerPane extends BasicScrollPane { //根据层级初始属性,一切以json那边读到的层级为准 int levelSize = levelList.size(); - for(int i = levelSize; i < depth; i++){ + for (int i = levelSize; i < depth; i++) { levelList.add(ZoomLevel.AUTO); } MapType mapType = drillMapPlot.getMapType() == MapType.POINT ? MapType.POINT : MapType.AREA; int typeSize = mapTypeList.size(); - for(int j = typeSize; j < depth; j++){ + for (int j = typeSize; j < depth; j++) { mapTypeList.add(mapType); } - for(int i = 0; i < depth; i++){ + for (int i = 0; i < depth; i++) { Component[] components = detailComps[i + 1]; - if(components != null) { + if (components != null) { UIComboBox level = (UIComboBox) components[1]; UIComboBox type = (UIComboBox) components[2]; if (level != null) { @@ -168,11 +176,11 @@ public class DrillMapLayerPane extends BasicScrollPane { @Override public void updateBean(ChartCollection ob) { VanChartDrillMapPlot drillMapPlot = DrillMapHelper.getDrillMapPlot(ob); - if(drillMapPlot != null && detailComps != null) { + if (drillMapPlot != null && detailComps != null) { java.util.List levelList = new ArrayList(); java.util.List mapTypeList = new ArrayList(); for (Component[] com : detailComps) { - if(com[1] instanceof UIComboBox && com[2] instanceof UIComboBox) { + if (com[1] instanceof UIComboBox && com[2] instanceof UIComboBox) { UIComboBox level = (UIComboBox) com[1]; UIComboBox type = (UIComboBox) com[2]; levelList.add((ZoomLevel) level.getSelectedItem()); 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 83de6eeac..855f4bcbc 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 @@ -33,7 +33,8 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith protected JPanel getInteractivePane(VanChartPlot plot){ double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = {p, f}; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double[] columnSize = {f, e}; double[] rowSize = {p, p, p, p, p, p, p, p, p, p, p}; Component[][] components = new Component[][]{ new Component[]{createToolBarPane(new double[]{p, p, p}, columnSize),null}, @@ -49,16 +50,29 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith private JPanel createDrillToolsPane() { openOrClose = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Open"), Inter.getLocText("Plugin-ChartF_Close")}); + JPanel openOrClosePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_Drill_Dir"), openOrClose); textAttrPane = new ChartTextAttrPane(){ + + @Override + protected JPanel getContentPane (JPanel buttonPane) { + double p = TableLayout.PREFERRED; + double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; + double[] columnSize = {e}; + double[] rowSize = {p, p}; + + return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), rowSize, columnSize); + } + + @Override protected Component[][] getComponents(JPanel buttonPane) { return new Component[][]{ - new Component[]{fontNameComboBox, null}, - new Component[]{buttonPane, null} + new Component[]{fontNameComboBox}, + new Component[]{buttonPane} }; } }; - backgroundPane = new VanChartBackgroundPane4DrillMap(); - selectBackgroundPane = new VanChartBackgroundPane4DrillMap(); + backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(); + selectBackgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(); catalogSuperLink = new VanChartCatalogHyperLinkPane(); double p = TableLayout.PREFERRED; @@ -75,7 +89,7 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith drillPane = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); JPanel panel = new JPanel(new BorderLayout()); - panel.add(openOrClose, BorderLayout.NORTH); + panel.add(openOrClosePane, BorderLayout.NORTH); panel.add(drillPane, BorderLayout.CENTER); openOrClose.addChangeListener(new ChangeListener() { @@ -85,13 +99,15 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith } }); - JPanel panel1 = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Drill_Dir"), panel); + JPanel panel1 = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Drill"), panel); panel.setBorder(BorderFactory.createEmptyBorder(10,5,0,0)); return panel1; } private JPanel createTitlePane(String title, Component component) { - return TableLayout4VanChartHelper.createGapTableLayoutPane(title, component); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(title, component, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); + panel.setBorder(BorderFactory.createEmptyBorder(0,12,0,0)); + return panel; } private void checkEnable() { @@ -138,16 +154,4 @@ 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 diff --git a/designer_chart/src/com/fr/plugin/chart/gauge/VanChartGaugeSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/gauge/VanChartGaugeSeriesPane.java index 9e5238d89..a919931df 100644 --- a/designer_chart/src/com/fr/plugin/chart/gauge/VanChartGaugeSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/gauge/VanChartGaugeSeriesPane.java @@ -13,11 +13,9 @@ import com.fr.design.style.color.ColorSelectBox; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.plugin.chart.attr.GaugeDetailStyle; -import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.AttrLabel; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.style.series.VanChartAbstractPlotSeriesPane; -import com.fr.plugin.chart.pie.RadiusCardLayoutPane; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.stable.Constants; @@ -119,21 +117,21 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { new Component[]{null, null}, getPaneBackgroundColor(), getInnerPaneBackgroundColor(), - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Radius_Set")),createRadiusPane()} + new Component[]{createRadiusPane(), null} }; case SLOT: return new Component[][]{ new Component[]{null, null}, getNeedleColor(), getSlotBackgroundColor(), - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Radius_Set")),createRadiusPane()} + new Component[]{createRadiusPane(), null} }; case THERMOMETER: return new Component[][]{ new Component[]{null, null}, getNeedleColor(), getSlotBackgroundColor(), - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Radius_Set")),createRadiusPane()} + new Component[]{createRadiusPane(), null} }; default: return new Component[][]{ @@ -142,16 +140,11 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { getHingeBackgroundColor(), getNeedleColor(), getPaneBackgroundColor(), - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Radius_Set")),createRadiusPane()} + new Component[]{createRadiusPane(), null} }; } } - //半径界面 - protected RadiusCardLayoutPane initRadiusPane() { - return ((VanChartPlot)plot).isInCustom() ? null : new RadiusCardLayoutPane(); - } - private Component[] getHingeColor() { hingeColor = new ColorSelectBox(120); return new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Hinge")),hingeColor}; diff --git a/designer_chart/src/com/fr/plugin/chart/pie/VanChartPieSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/pie/VanChartPieSeriesPane.java index c0377baa3..f3e3ca634 100644 --- a/designer_chart/src/com/fr/plugin/chart/pie/VanChartPieSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/pie/VanChartPieSeriesPane.java @@ -10,7 +10,6 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.general.Inter; import com.fr.plugin.chart.PiePlot4VanChart; -import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.style.series.VanChartAbstractPlotSeriesPane; @@ -62,7 +61,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane { new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_StartAngle")),startAngle}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_EndAngle")),endAngle}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_InnerRadius")),innerRadius}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Radius_Set")), createRadiusPane()}, + new Component[]{createRadiusPane(),null}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Rotation")),supportRotation} }; @@ -71,12 +70,6 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane { return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), panel); } - //半径界面 - protected RadiusCardLayoutPane initRadiusPane() { - return ((VanChartPlot)plot).isInCustom() ? null : new RadiusCardLayoutPane(); - } - - public void populateBean(Plot plot) { if(plot == null) { return; diff --git a/designer_chart/src/com/fr/plugin/chart/range/component/LegendLabelFormatPane.java b/designer_chart/src/com/fr/plugin/chart/range/component/LegendLabelFormatPane.java index a3e10efb2..dafcd7e6b 100644 --- a/designer_chart/src/com/fr/plugin/chart/range/component/LegendLabelFormatPane.java +++ b/designer_chart/src/com/fr/plugin/chart/range/component/LegendLabelFormatPane.java @@ -33,6 +33,8 @@ public class LegendLabelFormatPane extends JPanel{ Inter.getLocText("Plugin-ChartF_Custom")}); labelFormat = new FormatPaneWithOutFont(); htmlLabelPane = new VanChartHtmlLabelPaneWithOutWidthAndHeight(); + htmlLabelPane.setBorder(BorderFactory.createEmptyBorder(0, (int)TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH + TableLayout4VanChartHelper.COMPONENT_INTERVAL,0,0)); + centerPane = new JPanel(new CardLayout()){ @Override From 917be5028b962ff00d657d003a78ae9ac0d5b582 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 13 Sep 2017 09:27:43 +0800 Subject: [PATCH 03/23] =?UTF-8?q?REPORT-4372=20&&=20REPORT-4358=20&&=20REP?= =?UTF-8?q?ORT-4369=209.0=E4=B8=80=E8=BD=AE=E5=9B=9E=E5=BD=92=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/ui/ParameterTreeComboBox.java | 4 +- .../design/locale/designer_zh_CN.properties | 2 +- .../accessibles/AccessibleIconEditor.java | 5 -- .../accessibles/BaseAccessibleEditor.java | 13 +--- .../widget/component/DateValuePane.java | 15 +++- .../component/NumberEditorValidatePane.java | 74 ++++++++----------- .../AccessibleWLayoutBorderStyleEditor.java | 4 - .../widget/ui/designer/LabelDefinePane.java | 4 +- 8 files changed, 52 insertions(+), 69 deletions(-) diff --git a/designer/src/com/fr/design/widget/ui/ParameterTreeComboBox.java b/designer/src/com/fr/design/widget/ui/ParameterTreeComboBox.java index b6806a992..4bbdc301f 100644 --- a/designer/src/com/fr/design/widget/ui/ParameterTreeComboBox.java +++ b/designer/src/com/fr/design/widget/ui/ParameterTreeComboBox.java @@ -15,6 +15,7 @@ import com.fr.general.Inter; import com.fr.script.Calculator; import com.fr.stable.ArrayUtils; import com.fr.stable.ParameterProvider; +import com.fr.stable.StringUtils; import javax.swing.*; import javax.swing.tree.DefaultMutableTreeNode; @@ -76,7 +77,8 @@ public class ParameterTreeComboBox extends FRTreeComboBox { if (obj instanceof TreePath) { return ((Parameter)((ExpandMutableTreeNode)((TreePath)obj).getLastPathComponent()).getUserObject()).getName(); } - return (String)obj; + Object item = this.getEditor().getItem(); + return item == null ? StringUtils.EMPTY : item.toString(); } @Override diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index edbfda3cb..da5090740 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -951,7 +951,7 @@ zeroMarginWarn=\u7531\u4E8E\u6253\u5370\u673A\u5B58\u5728\u7269\u7406\u8FB9\u8DD Widget-Date_Selector_Return_Type=\u8FD4\u56DE\u503C\u7C7B\u578B Utils-Switch_To_Template_Reportlet=\u5207\u6362\u5230\u6A21\u677F\u7F51\u7EDC\u62A5\u8868 satisfy=\u6EE1\u8DB3\u6761\u4EF6 -FR-Designer_WidgetDisplyPosition=\u63A7\u4EF6\u663E\u793A\u4F4D\u7F6E +FR-Designer_WidgetDisplyPosition=\u663E\u793A\u4F4D\u7F6E FR-Base_Top=\u4E0A FR-Designer_Form-CheckBox=\u590D\u9009\u6846 Reportlet-Parameter_Type=\u53C2\u6570\u4F20\u9012\u65B9\u5F0F diff --git a/designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleIconEditor.java b/designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleIconEditor.java index d79c489e7..594b11e90 100644 --- a/designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleIconEditor.java +++ b/designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleIconEditor.java @@ -27,11 +27,6 @@ public class AccessibleIconEditor extends UneditableAccessibleEditor { return new RendererField(new IconCellRenderer()); } - protected void setBorderVisible(){ - this.setBorder(BorderFactory.createLineBorder(Color.lightGray)); - } - - @Override protected void showEditorPane() { if (customIconPane == null) { diff --git a/designer_base/src/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java b/designer_base/src/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java index 10840d300..c71cd8ad1 100644 --- a/designer_base/src/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java +++ b/designer_base/src/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java @@ -1,9 +1,6 @@ package com.fr.design.mainframe.widget.accessibles; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Insets; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; @@ -45,11 +42,9 @@ public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor this.decoder = dec; initComponents(); txtValue.setEditable(dec != null); - setBorderVisible(); - } - - protected void setBorderVisible(){ - ((JComponent) txtValue).setBorder(null); + ((JComponent) txtValue).setOpaque(true); + ((JComponent) txtValue).setBorder(BorderFactory.createLineBorder(Color.lightGray)); + ((JComponent) txtValue).setBackground(Color.WHITE); } @Override diff --git a/designer_base/src/com/fr/design/widget/component/DateValuePane.java b/designer_base/src/com/fr/design/widget/component/DateValuePane.java index 6ea7d056e..b6f59ec6e 100644 --- a/designer_base/src/com/fr/design/widget/component/DateValuePane.java +++ b/designer_base/src/com/fr/design/widget/component/DateValuePane.java @@ -1,11 +1,12 @@ package com.fr.design.widget.component; +import com.fr.base.Formula; import com.fr.design.constants.LayoutConstants; import com.fr.design.editor.editor.*; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; - +import com.fr.stable.StringUtils; import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; @@ -17,13 +18,16 @@ import java.awt.*; public class DateValuePane extends JPanel { private UIButtonGroup widgetValueHead; private Editor[] editor; + private static final String NONE_EDITOR_NAME = Inter.getLocText("None"); + private static final String DATE_EDITOR_NAME = Inter.getLocText("Date"); + private static final String FORMULA_EDITOR_NAME = Inter.getLocText("Parameter-Formula"); public DateValuePane() { editor = new Editor[]{ - new NoneEditor(null, Inter.getLocText("None")), - new DateEditor(true, Inter.getLocText("Date")), - new FormulaEditor(Inter.getLocText("Parameter-Formula")) + new NoneEditor(null, NONE_EDITOR_NAME), + new DateEditor(true, DATE_EDITOR_NAME), + new FormulaEditor(FORMULA_EDITOR_NAME) }; this.setLayout(new BorderLayout(0, LayoutConstants.VGAP_SMALL)); final CardLayout cardLayout = new CardLayout(); @@ -56,6 +60,9 @@ public class DateValuePane extends JPanel { int index = widgetValueHead.getSelectedIndex(); Editor e = editor[index]; Object value = e.getValue(); + if(value == null && ComparatorUtils.equals(FORMULA_EDITOR_NAME, e.getName())){ + value = new Formula(StringUtils.EMPTY); + } return value; } diff --git a/designer_base/src/com/fr/design/widget/component/NumberEditorValidatePane.java b/designer_base/src/com/fr/design/widget/component/NumberEditorValidatePane.java index 63b297925..68ca5ae1e 100644 --- a/designer_base/src/com/fr/design/widget/component/NumberEditorValidatePane.java +++ b/designer_base/src/com/fr/design/widget/component/NumberEditorValidatePane.java @@ -1,7 +1,6 @@ package com.fr.design.widget.component; import com.fr.design.designer.IntervalConstants; -import com.fr.design.dialog.BasicPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UIBasicSpinner; @@ -12,6 +11,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.NumberEditor; import com.fr.general.Inter; +import com.fr.stable.StringUtils; import javax.swing.*; import javax.swing.event.ChangeEvent; @@ -35,10 +35,8 @@ public class NumberEditorValidatePane extends JPanel { private SpinnerNumberModel minValueModel; private UISpinner decimalLength; private JPanel limitNumberPane; - private UITextField maxValueErrorTextField; - private UITextField minValueErrorTextField; - private JPanel maxValueFieldPane; - private JPanel minValueFieldPane; + private UITextField errorMsgTextField; + private JPanel errorMsgTextFieldPane; private ActionListener allowDecimalsListener; @@ -79,13 +77,10 @@ public class NumberEditorValidatePane extends JPanel { this.setMinValueCheckBox.addActionListener(setMinListener); this.minValueSpinner.addChangeListener(minValueChangeListener); setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - initMaxMinValueFieldPane(); - JPanel maxValueBorderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - maxValueBorderPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0)); - maxValueBorderPane.add(maxValueFieldPane, BorderLayout.CENTER); - JPanel minValueBorderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - minValueBorderPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, IntervalConstants.INTERVAL_L1, 0)); - minValueBorderPane.add(minValueFieldPane, BorderLayout.CENTER); + initErrorMsgPane(); + JPanel errorMsgBorderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + errorMsgBorderPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, IntervalConstants.INTERVAL_L1, 0)); + errorMsgBorderPane.add(errorMsgTextFieldPane, BorderLayout.CENTER); UILabel numberLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Double", "Numbers"})); limitNumberPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{numberLabel, decimalLength}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); limitNumberPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0)); @@ -96,37 +91,20 @@ public class NumberEditorValidatePane extends JPanel { new Component[]{limitNumberPane, null}, new Component[]{allowNegativeCheckBox, null}, new Component[]{setMaxValueCheckBox, maxValueSpinner}, - new Component[]{maxValueBorderPane, null}, new Component[]{setMinValueCheckBox, minValueSpinner}, - new Component[]{minValueBorderPane, null}, + new Component[]{errorMsgBorderPane, null}, }; - double[] rowSize = {p, p, p, p, p, p, p}; + double[] rowSize = {p, p, p, p, p, p}; double[] columnSize = {p, f}; - int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1); this.add(panel); } - private void initMaxMinValueFieldPane() { - maxValueErrorTextField = new UITextField(); - minValueErrorTextField = new UITextField(); - - maxValueFieldPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")), maxValueErrorTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); - setMaxValueCheckBox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - maxValueFieldPane.setVisible(setMaxValueCheckBox.isSelected()); - } - }); - - minValueFieldPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")), minValueErrorTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); - setMinValueCheckBox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - minValueFieldPane.setVisible(setMinValueCheckBox.isSelected()); - } - }); - + private void initErrorMsgPane() { + errorMsgTextField = new UITextField(); + errorMsgTextFieldPane = TableLayoutHelper.createGapTableLayoutPane( + new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")), errorMsgTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1); } @@ -257,28 +235,31 @@ public class NumberEditorValidatePane extends JPanel { allowNegativeCheckBox.setSelected(e.isAllowNegative()); if (e.getMaxValue() == Double.MAX_VALUE) { setMaxValueCheckBox.setSelected(false); - maxValueFieldPane.setVisible(false); +// maxValueFieldPane.setVisible(false); maxValueSpinner.setValue(new Double(Double.MAX_VALUE)); maxValueSpinner.setEnabled(false); } else { setMaxValueCheckBox.setSelected(true); maxValueSpinner.setEnabled(true); - maxValueFieldPane.setVisible(true); maxValueSpinner.setValue(new Double(e.getMaxValue())); } if (e.getMinValue() == -Double.MAX_VALUE) { setMinValueCheckBox.setSelected(false); - minValueFieldPane.setVisible(false); minValueSpinner.setValue(new Double(-Double.MAX_VALUE)); minValueSpinner.setEnabled(false); } else { setMinValueCheckBox.setSelected(true); - minValueFieldPane.setVisible(true); minValueSpinner.setEnabled(true); minValueSpinner.setValue(new Double(e.getMinValue())); } + errorMsgTextField.setText(e.getRegErrorMessage()); + if(e.getMaxValue() == Double.MAX_VALUE || e.getMinValue() == -Double.MAX_VALUE){ + errorMsgTextFieldPane.setVisible(true); + }else{ + errorMsgTextFieldPane.setVisible(false); + } } public void update(NumberEditor ob) { @@ -289,15 +270,22 @@ public class NumberEditorValidatePane extends JPanel { ob.setAllowNegative(allowNegativeCheckBox.isSelected()); if (setMaxValueCheckBox.isSelected()) { - ob.setMaxValue(Double.parseDouble("" + maxValueSpinner.getValue())); + ob.setMaxValue(Double.parseDouble(StringUtils.EMPTY + maxValueSpinner.getValue())); } else { ob.setMaxValue(Double.MAX_VALUE); } if (setMinValueCheckBox.isSelected()) { - ob.setMinValue(Double.parseDouble("" + minValueSpinner.getValue())); + ob.setMinValue(Double.parseDouble(StringUtils.EMPTY + minValueSpinner.getValue())); } else { ob.setMinValue(-Double.MAX_VALUE); } + if(setMinValueCheckBox.isSelected() || setMaxValueCheckBox.isSelected()){ + errorMsgTextFieldPane.setVisible(true); + }else{ + errorMsgTextFieldPane.setVisible(false); + errorMsgTextField.setText(StringUtils.EMPTY); + } + ob.setRegErrorMessage(errorMsgTextField.getText()); } } diff --git a/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleWLayoutBorderStyleEditor.java b/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleWLayoutBorderStyleEditor.java index c2345cd83..8ec7cc417 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleWLayoutBorderStyleEditor.java +++ b/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleWLayoutBorderStyleEditor.java @@ -27,10 +27,6 @@ public class AccessibleWLayoutBorderStyleEditor extends UneditableAccessibleEdit return new RendererField(new LayoutBorderStyleRenderer()); } - protected void setBorderVisible(){ - this.setBorder(BorderFactory.createLineBorder(Color.lightGray)); - } - @Override protected void showEditorPane() { if (borderPane == null) { diff --git a/designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java index cb988f24f..30d703aee 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java @@ -82,7 +82,7 @@ public class LabelDefinePane extends AbstractDataModify