From fd9da4deefcc7c896e53dce1fd73f8d28e54af62 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Tue, 19 Sep 2017 23:32:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=95=B4=E7=90=86=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E4=B8=AD=E5=AD=98=E5=9C=A8=E7=9A=84=E5=A4=A7=E5=B0=8F=EF=BC=8C?= =?UTF-8?q?=E9=97=B4=E9=9A=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/controlpane/UIControlPane.java | 16 ++-- .../chart/gui/data/ChartDataFilterPane.java | 19 ++--- .../chart/gui/data/NormalChartDataPane.java | 2 +- .../chart/gui/style/ChartTextAttrPane.java | 9 ++- .../chart/gui/style/ThirdTabPane.java | 32 ++++---- .../gui/style/series/UIColorPickerPane.java | 7 +- .../bubble/VanChartBubbleInteractivePane.java | 12 +++ .../bubble/component/VanChartBubblePane.java | 17 +++-- ...anChartBubblePlotTableDataContentPane.java | 4 +- .../designer/AbstractVanChartScrollPane.java | 2 +- .../designer/TableLayout4VanChartHelper.java | 2 + .../component/VanChartMarkerPane.java | 8 +- .../component/VanChartUIListControlPane.java | 20 +++++ .../format/FormatPaneWithOutFont.java | 3 +- .../marker/VanChartCommonMarkerPane.java | 9 ++- .../VanChartConditionListControlPane.java | 1 + .../other/VanChartInteractivePane.java | 7 +- .../VanChartInteractivePaneWithOutSort.java | 9 +++ .../style/axis/VanChartBaseAxisPane.java | 26 ++++++- .../style/axis/VanChartTimeAxisPane.java | 4 +- .../style/axis/VanChartValueAxisPane.java | 4 +- .../gauge/VanChartGaugeDetailAxisPane.java | 3 +- .../axis/radar/VanChartRadarXAxisPane.java | 4 +- .../axis/radar/VanChartRadarYAxisPane.java | 4 +- .../background/BackgroundListControlPane.java | 2 +- .../style/background/VanChartAreaPane.java | 1 + .../background/VanChartAxisAreaPane.java | 4 +- ...hartGaugeCateOrPercentLabelDetailPane.java | 76 ++++++++++++++++--- .../label/VanChartGaugeLabelDetailPane.java | 9 ++- .../VanChartGaugeValueLabelDetailPane.java | 2 +- .../label/VanChartPlotLabelDetailPane.java | 24 ++++-- .../style/VanChartFunnelSeriesPane.java | 3 +- .../component/ComboBoxWithButtonPane.java | 4 +- .../chart/map/VanChartMapSeriesPane.java | 15 +++- .../data/component/report/AreaPane.java | 2 +- .../component/report/LongLatAreaPane.java | 4 +- .../data/component/table/AreaPane.java | 4 +- .../data/component/table/LongLatAreaPane.java | 4 +- .../series/VanChartMapScatterMarkerPane.java | 9 ++- .../type/VanChartMapSourceChoosePane.java | 9 ++- 40 files changed, 299 insertions(+), 97 deletions(-) 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 9a5bd6071a..e855cf54f1 100644 --- a/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java @@ -193,6 +193,16 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH topToolBar.setLayout(new BorderLayout()); ShortCut addItem = addItemShortCut().getShortCut(); addItem.intoJToolBar(topToolBar); + + JPanel leftTopPane = getLeftTopPane(topToolBar); + + leftTopPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0)); + leftPane.add(leftTopPane, BorderLayout.NORTH); + + return leftPane; + } + + protected JPanel getLeftTopPane (UIToolbar topToolBar) { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = { p, f}; @@ -200,11 +210,7 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH Component[][] components = new Component[][]{ new Component[]{new UILabel(getAddItemText()), topToolBar}, }; - JPanel leftTopPane = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); - leftTopPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0)); - leftPane.add(leftTopPane, BorderLayout.NORTH); - - return leftPane; + return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); } /** 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 37caea1684..9a4a67b16e 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 @@ -6,7 +6,6 @@ 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.UILabel; import com.fr.design.gui.itextfield.UITextField; @@ -48,15 +47,9 @@ public class ChartDataFilterPane extends ThirdTabPane { } 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(221, 20)); - } + super.initTabPane(); + tabPane.setPreferredSize(new Dimension(221, 25)); + } protected void initLayout() { @@ -126,7 +119,7 @@ public class ChartDataFilterPane extends ThirdTabPane { this.removeAll(); paneList = initPaneList4NoPresent(plot4Pane, parentPane); initAllPane(); - tabPane.setPreferredSize(new Dimension(221, 20)); + tabPane.setPreferredSize(new Dimension(221, 25)); centerPane.setPreferredSize(new Dimension(getContentPaneWidth(), 200)); this.validate(); } @@ -242,7 +235,7 @@ public class ChartDataFilterPane extends ThirdTabPane { }; preDataNumPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); - preDataNumPane.setBorder(BorderFactory.createEmptyBorder(0,15,0,0)); + preDataNumPane.setBorder(BorderFactory.createEmptyBorder(10,15,0,0)); //默认不显示 preDataNumPane.setVisible(false); panel1.add(preDataNumPane, BorderLayout.CENTER); @@ -417,7 +410,7 @@ public class ChartDataFilterPane extends ThirdTabPane { }; preDataNumPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); - preDataNumPane.setBorder(BorderFactory.createEmptyBorder(0,15,0,0)); + preDataNumPane.setBorder(BorderFactory.createEmptyBorder(10,15,0,0)); //默认不显示 preDataNumPane.setVisible(false); panel1.add(preDataNumPane, BorderLayout.CENTER); 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 8c464454a0..829bf13b3e 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 @@ -64,7 +64,7 @@ public class NormalChartDataPane extends DataContentsPane { 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)); + northPane.setBorder(BorderFactory.createEmptyBorder(0,5,0,8)); this.add(northPane, BorderLayout.NORTH); this.add(cardPane, BorderLayout.CENTER); diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index 44c3cf0d5a..e3068e347b 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -148,13 +148,16 @@ public class ChartTextAttrPane extends BasicPane { } protected JPanel getContentPane (JPanel buttonPane) { - double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double[] columnSize = {f,e}; - double[] rowSize = {p, p, p}; - return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), rowSize, columnSize); + return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), getRowSize(), columnSize); + } + + protected double[] getRowSize () { + double p = TableLayout.PREFERRED; + return new double[]{p, p, p}; } protected Component[][] getComponents(JPanel buttonPane) { 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 ad03f3c521..c73e97da4c 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 @@ -6,24 +6,26 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicScrollPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; -import com.fr.design.gui.ibutton.UIHeadGroup; +import com.fr.design.gui.ibutton.UIButtonGroup; import javax.swing.*; import javax.swing.border.Border; import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.util.List; public abstract class ThirdTabPane extends BasicBeanPane{ private static final long serialVersionUID = 2298609199400393886L; - protected UIHeadGroup tabPane; + protected UIButtonGroup tabPane; protected String[] nameArray; public JPanel centerPane; public CardLayout cardLayout; public List paneList; protected abstract List initPaneList(Plot plot, AbstractAttrNoScrollPane parent); - + public ThirdTabPane(Plot plot, AbstractAttrNoScrollPane parent) { paneList = initPaneList(plot, parent); initAllPane(); @@ -45,16 +47,20 @@ public abstract class ThirdTabPane extends BasicBeanPane{ protected void initTabPane() { if (!paneList.isEmpty()) { - tabPane = new UIHeadGroup(nameArray) { + tabPane = new UIButtonGroup(nameArray); + tabPane.setSelectedIndex(0); + tabPane.setPreferredSize(new Dimension(60 * nameArray.length, 25)); + tabPane.addActionListener(new ActionListener() { @Override - public void tabChanged(int index) { - cardLayout.show(centerPane, nameArray[index]); + public void actionPerformed(ActionEvent e) { + cardLayout.show(centerPane, nameArray[tabPane.getSelectedIndex()]); } - }; + }); + centerPane.setBorder(myBorder); } } - + @Override public void paint(Graphics g) { super.paint(g); @@ -64,7 +70,7 @@ public abstract class ThirdTabPane extends BasicBeanPane{ g2d.drawLine(getWidth() - 2, tabPane.getPreferredSize().height, getWidth() - 2, getHeight() - 1); } } - + protected void initLayout() { this.setLayout(new BorderLayout()); if (!paneList.isEmpty()) { @@ -97,19 +103,19 @@ public abstract class ThirdTabPane extends BasicBeanPane{ }; /** - * + * * @return 中间的内容面板的指定宽度 */ protected int getContentPaneWidth() { return centerPane.getPreferredSize().width; } - + @Override public T updateBean() { return null; } - + protected static class NamePane { private String name; private BasicScrollPane pane; @@ -129,6 +135,6 @@ public abstract class ThirdTabPane extends BasicBeanPane{ public void setPane(BasicScrollPane pane) { this.pane = pane; } - + } } \ No newline at end of file diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java index 75de4a9b43..945fd4d5e5 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java @@ -34,12 +34,12 @@ import java.util.List; public class UIColorPickerPane extends BasicPane implements UIObserver { private static final int MARGIN_TOP = 10; private static final int MARGIN_LEFT = 5; - private static final int COLORGROUP_MARGIN_LEFT = 40; + private static final int COLORGROUP_MARGIN_LEFT = 20; private static final int OFF_HEIGHT = 6; private static final int COLOR_REC_HEIGHT = 40; private static final int COLOR_REC_WIDTH = 30; protected static final int TEXTFIELD_HEIGHT = 20; - protected static final int TEXTFIELD_WIDTH = 120; + protected static final int TEXTFIELD_WIDTH = 140; protected static final int UPCONTROLPANE_WIDTH = 230; private static final int LAYOUR_DET = 6; private static final double VALUE = 100; @@ -115,7 +115,8 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { protected JPanel getUpControlPane (Component[][] components) { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = {p, f}; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double[] columnSize = {f, e}; return TableLayoutHelper.createTableLayoutPane(components, getRowSIze (), columnSize); } diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleInteractivePane.java b/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleInteractivePane.java index 62bcb60601..4e4c9edab8 100644 --- a/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleInteractivePane.java +++ b/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleInteractivePane.java @@ -1,10 +1,14 @@ package com.fr.plugin.chart.bubble; import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.general.Inter; import com.fr.plugin.chart.base.VanChartConstants; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.other.VanChartInteractivePaneWithOutSort; +import javax.swing.*; + /** * Created by Mitisky on 16/3/31. */ @@ -24,4 +28,12 @@ public class VanChartBubbleInteractivePane extends VanChartInteractivePaneWithOu } return super.getValueArray(); } + + @Override + protected JPanel getzoomTypePane(UIButtonGroup zoomType) { + if (((VanChartBubblePlot)chart.getPlot()).isForceBubble()) { + return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_ZoomType"), zoomType); + } + return super.getzoomTypePane(zoomType); + } } diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/component/VanChartBubblePane.java b/designer_chart/src/com/fr/plugin/chart/bubble/component/VanChartBubblePane.java index c4e8deba50..8d6d50d29b 100644 --- a/designer_chart/src/com/fr/plugin/chart/bubble/component/VanChartBubblePane.java +++ b/designer_chart/src/com/fr/plugin/chart/bubble/component/VanChartBubblePane.java @@ -30,12 +30,23 @@ public class VanChartBubblePane extends BasicBeanPane { displayNegative = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Open"), Inter.getLocText("Plugin-ChartF_Close")}); + + + this.setLayout(new BorderLayout()); + this.add(getContentPane(), BorderLayout.CENTER); + } + + protected JPanel getContentPane () { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] row = {p, p, p, p, p}; double[] col = {p, f}; - Component[][] components = new Component[][]{ + return TableLayoutHelper.createTableLayoutPane(getComponent(), row, col); + } + + protected Component[][] getComponent () { + return new Component[][]{ new Component[]{null, null}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MinDiameter")), minDiameter}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MaxDiameter")), maxDiameter}, @@ -43,10 +54,6 @@ public class VanChartBubblePane extends BasicBeanPane { new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_DisplayNegative")), displayNegative}, }; - JPanel content = TableLayoutHelper.createTableLayoutPane(components, row, col); - - this.setLayout(new BorderLayout()); - this.add(content, BorderLayout.CENTER); } public void populateBean(VanChartAttrBubble bubble) { 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 aa1a771d2f..3c055caae3 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 @@ -60,9 +60,9 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon }; JPanel north = TableLayout4VanChartHelper.createGapTableLayoutPane(components_north,rowSize_north,columnSize_north); - north.setBorder(BorderFactory.createEmptyBorder(10, 24, 10, 15)); + north.setBorder(BorderFactory.createEmptyBorder(6, 24, 10, 15)); JPanel filterPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),dataScreeningPane); - dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,5,0,5)); + dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(0,5,0,5)); filterPane.setBorder(BorderFactory.createEmptyBorder(0,5,0,5)); 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 e3358a84aa..6ddb55372f 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartScrollPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartScrollPane.java @@ -27,7 +27,7 @@ public abstract class AbstractVanChartScrollPane extends BasicScrollPane { } else { leftcontentPane.setBounds(0, 0, width, height); - leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 5, 0, 10, original)); + leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 4, 0, 10, original)); } } public void reloaPane(JPanel pane){ 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 18a1c94893..d78af94e88 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/TableLayout4VanChartHelper.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/TableLayout4VanChartHelper.java @@ -7,6 +7,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import javax.swing.*; +import javax.swing.border.Border; import java.awt.*; /** @@ -21,6 +22,7 @@ public class TableLayout4VanChartHelper { public static final double EDIT_AREA_WIDTH =155; public static final double SECOND_EDIT_AREA_WIDTH =143; public static final int COMPONENT_INTERVAL =12; + public static final Border SECOND_EDIT_AREA_Border = BorderFactory.createEmptyBorder(0,12,0,0); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartMarkerPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartMarkerPane.java index 278e76f7af..a6d0abf1a1 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartMarkerPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartMarkerPane.java @@ -74,7 +74,13 @@ public class VanChartMarkerPane extends BasicPane { } protected BasicBeanPane createCommonMarkerPane() { - return new VanChartCommonMarkerPane(); + return new VanChartCommonMarkerPane(){ + protected double[] getcolumnSize () { + double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; + double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; + return new double[] {d, s}; + } + }; } protected void layoutComponents() { diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartUIListControlPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartUIListControlPane.java index 5da2a04611..af9e13b35c 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartUIListControlPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartUIListControlPane.java @@ -4,10 +4,15 @@ import com.fr.base.chart.BasePlot; import com.fr.chart.chartattr.Plot; import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.DesignerContext; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.stable.Nameable; import javax.swing.*; @@ -23,10 +28,25 @@ public abstract class VanChartUIListControlPane extends UIListControlPane { public VanChartUIListControlPane() { super(); + this.setBorder(null); } public VanChartUIListControlPane(BasePlot plot) { super(plot); + this.setBorder(null); + } + + @Override + protected JPanel getLeftTopPane (UIToolbar topToolBar) { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double[] columnSize = {f, e}; + double[] rowSize = {p}; + Component[][] components = new Component[][]{ + new Component[]{new UILabel(getAddItemText()), topToolBar}, + }; + return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); } @Override diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/format/FormatPaneWithOutFont.java b/designer_chart/src/com/fr/plugin/chart/designer/component/format/FormatPaneWithOutFont.java index 228c22ae8f..0980a38075 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/format/FormatPaneWithOutFont.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/format/FormatPaneWithOutFont.java @@ -15,6 +15,7 @@ import java.awt.*; */ public class FormatPaneWithOutFont extends FormatPane { private static final int HEIGHT = 30; + private static final int FONT_HEIGHT = 20; protected JPanel createContentPane(Component[][] components) { double f = TableLayout.FILL; @@ -39,6 +40,6 @@ public class FormatPaneWithOutFont extends FormatPane { if (getTypeComboBox().getSelectedIndex() == 0) { return new Dimension((int)getTypeComboBox().getPreferredSize().getWidth(), HEIGHT); } - return super.getPreferredSize(); + return new Dimension((int)super.getPreferredSize().getWidth(), (int)super.getPreferredSize().getHeight()-FONT_HEIGHT); } } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/marker/VanChartCommonMarkerPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/marker/VanChartCommonMarkerPane.java index a8f3567117..226a6fb8e3 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/marker/VanChartCommonMarkerPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/marker/VanChartCommonMarkerPane.java @@ -110,15 +110,20 @@ public class VanChartCommonMarkerPane extends BasicBeanPane double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; double[] row = {p, p, p}; - double[] col = {d, e}; Component[][] components = getUseComponent(); - JPanel jPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); + JPanel jPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, getcolumnSize()); this.add(jPanel); } + protected double[] getcolumnSize () { + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; + return new double[] {d, e}; + } + protected Marker[] getMarkers() { return getNormalMarkers(); } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionListControlPane.java b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionListControlPane.java index b2945c4111..d61198552c 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionListControlPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionListControlPane.java @@ -29,6 +29,7 @@ public class VanChartConditionListControlPane extends VanChartUIListControlPane public void populate(Nameable[] nameableArray, Class showPane) { initComponentPane(); + this.setBorder(null); NameObjectCreator[] creators = new NameObjectCreator[]{new NameObjectCreator(Inter.getLocText("Condition_Attributes"), ConditionAttr.class, showPane)}; refreshNameableCreator(creators); super.populate(nameableArray); 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 41cd7aa025..9c5b07d511 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 @@ -95,7 +95,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { Component[][] components = new Component[][]{ - new Component[]{createToolBarPane(new double[]{p,p,p,p,p}, columnSize),null}, + new Component[]{createToolBarPane(getToolBarRowSize(), columnSize),null}, new Component[]{createAnimationPane(),null}, new Component[]{createAxisRotationPane(new double[]{p,p}, columnSize, plot),null}, new Component[]{createZoomPane(new double[]{p,p,p}, columnSize, plot),null}, @@ -195,6 +195,11 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_ToolBar"), panel); } + protected double[] getToolBarRowSize () { + double p = TableLayout.PREFERRED; + return new double[]{p,p,p,p,p}; + } + protected Component[][] createToolBarComponents() { return new Component[][]{ new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Content")),isSort}, diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartInteractivePaneWithOutSort.java b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartInteractivePaneWithOutSort.java index 777a4477f3..6b4c57a863 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartInteractivePaneWithOutSort.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartInteractivePaneWithOutSort.java @@ -1,5 +1,7 @@ package com.fr.plugin.chart.designer.other; +import com.fr.design.layout.TableLayout; + import java.awt.*; /** @@ -7,8 +9,15 @@ import java.awt.*; * 没有排序选择 */ public class VanChartInteractivePaneWithOutSort extends VanChartInteractivePane { + @Override protected Component[][] createToolBarComponents() { return super.createToolBarComponentsWithOutSort(); } + + @Override + protected double[] getToolBarRowSize() { + double p = TableLayout.PREFERRED; + return new double[]{p, p, p}; + } } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartBaseAxisPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartBaseAxisPane.java index dedeafd87c..2123588c72 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartBaseAxisPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartBaseAxisPane.java @@ -97,11 +97,13 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; double[] columnSize = {f, e}; + double[] column = {f, s}; double[] rowSize = {p, p, p, p, p, p, p,p}; Component[][] components = new Component[][]{ new Component[]{createTitlePane(new double[]{p, p, p, p, p, p}, columnSize, isXAxis), null}, - new Component[]{createLabelPane(new double[]{p, p}, columnSize), null}, + new Component[]{createLabelPane(new double[]{p, p}, column), null}, new Component[]{createLineStylePane(new double[]{p, p, p, p, p}, columnSize), null}, new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis), null}, new Component[]{createDisplayStrategy(new double[]{p, p, p}, columnSize), null}, @@ -155,7 +157,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected JPanel createLabelPane(double[] row, double[] col){ showLabel = new UIButtonGroup(new String[]{Inter.getLocText("Chart-Use_Show"), Inter.getLocText("Plugin-ChartF_Hidden")}); - labelTextAttrPane = new ChartTextAttrPane(); + labelTextAttrPane = getChartTextAttrPane(); labelTextRotation = new UINumberDragPane(-ROTATION_MAX,ROTATION_MAX); labelGapStyle = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Automatic"),Inter.getLocText("Plugin-ChartF_Fixed")}); @@ -164,8 +166,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_TextRotation")), labelTextRotation}, new Component[]{new UILabel(Inter.getLocText("ChartF-Label_Interval")), labelGapStyle}, }; - JPanel panel = TableLayoutHelper.createTableLayoutPane(gapComponents, row, col); - labelGapValuePane= TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText(" "),labelGapValue); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(gapComponents, row, col); + labelGapValuePane= TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText(""),labelGapValue, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); JPanel gapPanel = new JPanel(new BorderLayout()); gapPanel.add(panel, BorderLayout.CENTER); gapPanel.add(labelGapValuePane, BorderLayout.SOUTH); @@ -196,6 +198,22 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, jPanel); } + protected ChartTextAttrPane getChartTextAttrPane(){ + return new ChartTextAttrPane(){ + + @Override + protected JPanel getContentPane (JPanel buttonPane) { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; + double[] columnSize = {f, e}; + double[] rowSize = {p, p, p}; + + return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), rowSize, columnSize); + } + }; + } + protected JPanel createLineStylePane(double[] row, double[] col){ axisLineStyle = createLineComboBox(); axisLineColor = new ColorSelectBox(100); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartTimeAxisPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartTimeAxisPane.java index ed85071a6d..65b71bedcc 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartTimeAxisPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartTimeAxisPane.java @@ -59,11 +59,13 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; double[] columnSize = {f, e}; + double[] column = {f, s}; double[] rowSize = {p,p,p,p,p,p,p,p,p,p,p,p,p,p}; Component[][] components = new Component[][]{ new Component[]{createTitlePane(new double[]{p, p, p, p, p,p}, columnSize, isXAxis),null}, - new Component[]{createLabelPane(new double[]{p, p}, columnSize),null}, + new Component[]{createLabelPane(new double[]{p, p}, column),null}, new Component[]{createValueDefinition(),null}, new Component[]{createLineStylePane(new double[]{p, p,p,p,p}, columnSize),null}, new Component[]{createAxisPositionPane(new double[]{p, p}, columnSize, isXAxis),null}, diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartValueAxisPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartValueAxisPane.java index 6eb199983d..3749f77ac2 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartValueAxisPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartValueAxisPane.java @@ -42,11 +42,13 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; double[] columnSize = {f, e}; + double[] column = {f, s}; double[] rowSize = {p,p,p,p,p,p,p,p,p,p,p,p,p,p}; Component[][] components = new Component[][]{ new Component[]{createTitlePane(new double[]{p, p, p, p, p, p}, columnSize, isXAxis), null}, - new Component[]{createLabelPane(new double[]{p, p}, columnSize), null}, + new Component[]{createLabelPane(new double[]{p, p}, column), null}, new Component[]{createMinMaxValuePane(new double[]{p, p}, columnSize), null}, new Component[]{createLineStylePane(new double[]{p, p, p, p, p}, columnSize), null}, new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis), null}, diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java index d4ef127d41..48eb4c73d3 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java @@ -5,7 +5,6 @@ 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.PaneTitleConstants; -import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.style.color.ColorSelectBox; import com.fr.general.Inter; import com.fr.plugin.chart.attr.axis.VanChartAxis; @@ -77,7 +76,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane{ protected JPanel createLabelPane(double[] row, double[] col){ showLabel = new UIButtonGroup(new String[]{Inter.getLocText("Chart-Use_Show"), Inter.getLocText("Plugin-ChartF_Hidden")}); - labelTextAttrPane = new ChartTextAttrPane(); + labelTextAttrPane = getChartTextAttrPane(); labelPanel = new JPanel(new BorderLayout()); labelPanel.add(labelTextAttrPane); labelPanel.setBorder(BorderFactory.createEmptyBorder(0,15,0,0)); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java index eae979c829..cb7c47d770 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java @@ -24,10 +24,12 @@ public class VanChartRadarXAxisPane extends VanChartBaseAxisPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; double[] columnSize = {f, e}; + double[] column = {f, s}; double[] rowSize = {p,p,p,p,p,p}; Component[][] components = new Component[][]{ - new Component[]{createLabelPane(new double[]{p, p}, columnSize),null}, + new Component[]{createLabelPane(new double[]{p, p}, column),null}, new Component[]{createLineStylePane(new double[]{p, p, p, p}, columnSize),null}, new Component[]{createValueStylePane(),null}, }; diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java index 054b05f7b1..3da22d6c36 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java @@ -33,10 +33,12 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; double[] columnSize = {f, e}; + double[] column = {f, s}; double[] rowSize = {p, p, p, p, p, p, p, p}; Component[][] components = new Component[][]{ - new Component[]{createLabelPane(new double[]{p, p}, columnSize), null}, + new Component[]{createLabelPane(new double[]{p, p}, column), null}, new Component[]{createMinMaxValuePane(new double[]{p, p, p}, columnSize), null}, new Component[]{createLineStylePane(new double[]{p, p, p, p}, columnSize), null}, new Component[]{createValueStylePane(), null}, diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java index de8a35d53f..e514812499 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java @@ -36,7 +36,7 @@ public class BackgroundListControlPane extends VanChartUIListControlPane { @Override public String getAddItemText() { - return Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"); + return Inter.getLocText("Plugin-ChartF_Add_Interval"); } protected ShortCut4JControlPane[] createShortcuts() { diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAreaPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAreaPane.java index 3388596ff1..b30d1eb646 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAreaPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAreaPane.java @@ -36,6 +36,7 @@ public class VanChartAreaPane extends ThirdTabPane implements AutoSele JPanel pane = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0)); if (nameArray.length > 1) { pane.add(tabPane); + tabPane.setBorder(BorderFactory.createEmptyBorder(0,5,0,0)); this.add(pane, BorderLayout.NORTH); } } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java index 87e6062e97..1ac56791b9 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java @@ -44,13 +44,14 @@ public class VanChartAxisAreaPane extends BasicBeanPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; double[] columnSize = {f}; double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ new Component[]{createGridLinePane(new double[]{p, p, p}, new double[]{f, e})}, new Component[]{createAlertLinePane()}, - new Component[]{createIntervalPane(new double[]{p, p, p, p}, new double[]{f, e})}, + new Component[]{createIntervalPane(new double[]{p, p, p, p}, new double[]{f, s})}, }; JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); this.setLayout(new BorderLayout()); @@ -86,6 +87,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane { verticalColorBackground = new ColorSelectBox(100); Component[][] components = getIntervalPaneComponents(); JPanel defaultPane = TableLayoutHelper.createTableLayoutPane(components, row, col); + defaultPane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0)); customIntervalBackground = new BackgroundListControlPane(); cardLayout = new CardLayout(); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java index ee586c91f0..21d6521b9f 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java @@ -1,6 +1,10 @@ package com.fr.plugin.chart.designer.style.label; import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.TableLayout; +import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; +import com.fr.general.Inter; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.component.label.LabelContentPaneWithCate; import com.fr.plugin.chart.designer.component.label.LabelContentPaneWithPercent; @@ -15,6 +19,7 @@ import java.awt.*; * 仪表盘的分类(多指针时)或者百分比标签 */ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabelDetailPane { + //todo 重新整理这个面板 private static final long serialVersionUID = 5176535960949074945L; @@ -24,6 +29,10 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe super(plot, parent); } + protected double[] getLabelPaneRowSize(Plot plot, double p) { + return hasLabelPosition(plot) ? new double[]{p,p,p} : new double[]{p,p}; + } + private void initGaugeStyle(Plot plot) { if(gaugeStyle == null){ gaugeStyle = ((VanChartGaugePlot)plot).getGaugeStyle(); @@ -45,6 +54,8 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe } } + + protected boolean hasLabelPosition(Plot plot) { initGaugeStyle(plot); switch (gaugeStyle){ @@ -57,21 +68,68 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe } } + protected double[] getLabelStyleRowSize(double p) { + switch (gaugeStyle){ + case RING: + return new double[] {p, p}; + case SLOT: + return new double[] {p, p}; + default: + return new double[] {p}; + } + } + protected JPanel createTableLayoutPaneWithTitle(String title, Component component) { return TableLayout4VanChartHelper.createTableLayoutPaneWithSmallTitle(title, component); } + protected Component[][] getLabelStyleComponents(Plot plot) { initGaugeStyle(plot); - switch (gaugeStyle){ - case RING: - return super.getLabelStyleComponents(plot); - case SLOT: - return super.getLabelStyleComponents(plot); - default: - return new Component[][]{ - new Component[]{textFontPane,null}, - }; + if (gaugeStyle == GaugeStyle.RING || gaugeStyle == GaugeStyle.SLOT) { + UILabel text = new UILabel(Inter.getLocText("Plugin-Chart_Character"), SwingConstants.LEFT); + return new Component[][]{ + new Component[]{text,style}, + new Component[]{textFontPane,null}, + }; + } else { + return new Component[][]{ + new Component[]{textFontPane, null}, + }; + } + } + + protected ChartTextAttrPane initTextFontPane () { + //todo 需要再整理下 + if (gaugeStyle == GaugeStyle.RING || gaugeStyle == GaugeStyle.SLOT){ + return new ChartTextAttrPane(){ + protected double[] getRowSize () { + double p = TableLayout.PREFERRED; + return new double[]{p, p}; + } + + protected Component[][] getComponents(JPanel buttonPane) { + return new Component[][]{ + new Component[]{null, fontNameComboBox}, + new Component[]{null, buttonPane} + }; + } + }; + } else { + return new ChartTextAttrPane(){ + protected double[] getRowSize () { + double p = TableLayout.PREFERRED; + return new double[]{p, p}; + } + + protected Component[][] getComponents(JPanel buttonPane) { + UILabel text = new UILabel(Inter.getLocText("Plugin-Chart_Character"), SwingConstants.LEFT); + return new Component[][]{ + new Component[]{text, fontNameComboBox}, + new Component[]{null, buttonPane} + }; + } + }; } } } \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeLabelDetailPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeLabelDetailPane.java index c83ad98e5a..2c45558d50 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeLabelDetailPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeLabelDetailPane.java @@ -23,11 +23,16 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { protected JPanel createLabelStylePane(double[] row, double[] col, Plot plot) { style = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Automatic"), Inter.getLocText("Plugin-ChartF_Custom")}); - textFontPane = new ChartTextAttrPane(); + textFontPane = initTextFontPane(); initStyleListener(); - return TableLayoutHelper.createTableLayoutPane(getLabelStyleComponents(plot),row,col); + return TableLayoutHelper.createTableLayoutPane(getLabelStyleComponents(plot), row, col); + } + + + protected ChartTextAttrPane initTextFontPane () { + return new ChartTextAttrPane(); } protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){ diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java index 2dcb96dab2..72e3effa9f 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java @@ -59,7 +59,7 @@ public class VanChartGaugeValueLabelDetailPane extends VanChartGaugeLabelDetailP private Component[][] getLabelPaneComponentsWithBackground(Plot plot, double p, double[] columnSize) { return new Component[][]{ new Component[]{dataLabelContentPane,null}, - new Component[]{createLabelStylePane(new double[]{p,p,p}, columnSize, plot),null}, + new Component[]{createLabelStylePane(new double[]{p}, columnSize, plot),null}, new Component[]{createBackgroundColorPane(),null}, }; } 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 ba2f84dbb9..25e1f8c37e 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 @@ -76,16 +76,20 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return new Component[][]{ new Component[]{dataLabelContentPane,null}, new Component[]{createLabelPositionPane(new double[]{p,p,p}, columnSize, plot),null}, - new Component[]{createLabelStylePane(new double[]{p,p,p}, columnSize, plot),null}, + new Component[]{createLabelStylePane(getLabelStyleRowSize(p), columnSize, plot),null}, }; } else { return new Component[][]{ new Component[]{dataLabelContentPane,null}, - new Component[]{createLabelStylePane(new double[]{p,p,p}, columnSize, plot),null}, + new Component[]{createLabelStylePane(getLabelStyleRowSize(p), columnSize, plot),null}, }; } } + protected double[] getLabelStyleRowSize(double p) { + return new double[]{p, p, p}; + } + protected double[] getLabelPaneRowSize(Plot plot, double p) { return hasLabelPosition(plot) ? new double[]{p,p,p,p,p} : new double[]{p,p,p}; } @@ -152,7 +156,16 @@ public class VanChartPlotLabelDetailPane extends BasicPane { protected JPanel createLabelStylePane(double[] row, double[] col, Plot plot) { style = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Automatic"), Inter.getLocText("Plugin-ChartF_Custom")}); - textFontPane = new ChartTextAttrPane(){ + textFontPane =initTextFontPane(); + + initStyleListener(); + + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(getLabelStyleComponents(plot),row,col); + return createTableLayoutPaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), panel); + } + + protected ChartTextAttrPane initTextFontPane () { + return new ChartTextAttrPane(){ protected Component[][] getComponents(JPanel buttonPane) { return new Component[][]{ new Component[]{null, null}, @@ -161,11 +174,6 @@ public class VanChartPlotLabelDetailPane extends BasicPane { }; } }; - - initStyleListener(); - - JPanel panel = TableLayoutHelper.createTableLayoutPane(getLabelStyleComponents(plot),row,col); - return createTableLayoutPaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), panel); } protected Component[][] getLabelStyleComponents(Plot plot) { diff --git a/designer_chart/src/com/fr/plugin/chart/funnel/designer/style/VanChartFunnelSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/funnel/designer/style/VanChartFunnelSeriesPane.java index 13b93daba1..9c7ba2ec99 100644 --- a/designer_chart/src/com/fr/plugin/chart/funnel/designer/style/VanChartFunnelSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/funnel/designer/style/VanChartFunnelSeriesPane.java @@ -54,7 +54,8 @@ public class VanChartFunnelSeriesPane extends VanChartAbstractPlotSeriesPane { 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}; Component[][] components = new Component[][]{ new Component[]{null, null}, 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 54bb8cb826..fb13a94527 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 @@ -27,14 +27,14 @@ public abstract class ComboBoxWithButtonPane extends JPanel { public ComboBoxWithButtonPane(int index) { this.index = index; comboBoxName = new UIComboBox(); - comboBoxName.setPreferredSize(new Dimension(100,20)); + comboBoxName.setPreferredSize(new Dimension(80,20)); button = new UIButton(getButtonIcon()); button.setPreferredSize(new Dimension(20, 20)); button.addActionListener(getButtonListener()); UILabel title = new UILabel(getTitleText()); - title.setPreferredSize(new Dimension(60, 20)); + title.setPreferredSize(new Dimension(80, 20)); this.setLayout(new BorderLayout(H_GAP, 0)); this.add(comboBoxName, BorderLayout.CENTER); diff --git a/designer_chart/src/com/fr/plugin/chart/map/VanChartMapSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/map/VanChartMapSeriesPane.java index cb0be77135..f8e95b66de 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/VanChartMapSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/VanChartMapSeriesPane.java @@ -252,7 +252,20 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane { markerTypeCom = new UIComboBox(MARKER_TYPES); commonMarkerPane = new VanChartMapScatterMarkerPane(); - bubblePane = new VanChartBubblePane(); + commonMarkerPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_Border); + bubblePane = new VanChartBubblePane(){ + protected JPanel getContentPane () { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; + double[] row = {p, p, p, p, p}; + double[] col = {f, e}; + + JPanel panel = TableLayoutHelper.createTableLayoutPane(getComponent(), row, col); + panel.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_Border); + return panel; + } + }; imageMarkerPane = new VanChartImageMarkerPane(); final JPanel[] panes = new JPanel[]{new JPanel(), commonMarkerPane, bubblePane, imageMarkerPane}; 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 bb9f68398c..cb3efc9a32 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 @@ -28,7 +28,7 @@ public class AreaPane extends AbstractReportDataContentPane { areaName = new TinyFormulaPane(); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = {p, f}; + double[] columnSize = {f, COMPONENT_WIDTH}; double[] rowSize = {p}; Component[][] components = getComponent (); return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); 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 dac5fc3014..40084fec4d 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 @@ -31,10 +31,10 @@ public class LongLatAreaPane extends AreaPane { latitude = new TinyFormulaPane(); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = {p, f}; + double[] columnSize = {f, COMPONENT_WIDTH}; double[] rowSize = {p, p, p}; Component[][] components = getComponent(); - return TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,50,6); + return TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,12,6); } protected Component[][] getComponent () { 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 0ef1b35536..eb51aae81f 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 @@ -43,10 +43,10 @@ public class AreaPane extends AbstractTableDataContentPane { initAreaNameCom(); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = {p, f}; + double[] columnSize = {f, COMPONENT_WIDTH}; double[] rowSize = {p}; Component[][] components = getComponent(); - return TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,50,6); + return TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,12,6); } protected Component[][] getComponent () { 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 4f07c52874..83a0006488 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 @@ -33,11 +33,11 @@ public class LongLatAreaPane extends AreaPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = {p, f}; + double[] columnSize = {f, COMPONENT_WIDTH}; double[] rowSize = {p, p, p}; Component[][] components = getComponent(); - return TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,50,6); + return TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,12,6); } protected Component[][] getComponent () { diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java index e0a55f2942..334139bbd0 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java @@ -1,7 +1,7 @@ package com.fr.plugin.chart.map.designer.style.series; import com.fr.chart.chartglyph.Marker; -import com.fr.plugin.chart.marker.type.MarkerType; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.component.marker.VanChartCommonMarkerPane; import java.awt.*; @@ -20,4 +20,11 @@ public class VanChartMapScatterMarkerPane extends VanChartCommonMarkerPane { protected Marker[] getMarkers() { return getMapScatterMarkers(); } + + @Override + protected double[] getcolumnSize () { + double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; + double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; + return new double[] {d, s}; + } } 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 3314b180ad..77bc8020e9 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 @@ -428,20 +428,25 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { latitude = new UISpinner(-Double.MAX_VALUE,Double.MAX_VALUE,1,0.0); double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; double[] rowSize = {p,p,p}; + double[] columnSize = {f, e}; + double[] column = {f, s}; Component[][] comps = new Component[][]{ 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 = TableLayout4VanChartHelper.createGapTableLayoutPane(comps,rowSize,COLUMN_SIZE); + final JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps,rowSize,columnSize); Component[][] longAndLatComps = new Component[][]{ new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Longitude")), longitude}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Latitude")), latitude} }; - longAndLatPane =TableLayout4VanChartHelper.createGapTableLayoutPane(longAndLatComps,rowSize,COLUMN_SIZE); + longAndLatPane =TableLayout4VanChartHelper.createGapTableLayoutPane(longAndLatComps,rowSize,column); longAndLatPane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0)); longAndLatPane.setVisible(false); From e4d72a09aa91d5c64142bd9a57a0a194190b83e1 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Wed, 20 Sep 2017 08:53:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=97=B4=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/plugin/chart/designer/TableLayout4VanChartHelper.java | 2 +- .../src/com/fr/plugin/chart/map/VanChartMapSeriesPane.java | 4 ++-- 2 files changed, 3 insertions(+), 3 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 d78af94e88..1120d92de3 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/TableLayout4VanChartHelper.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/TableLayout4VanChartHelper.java @@ -22,7 +22,7 @@ public class TableLayout4VanChartHelper { public static final double EDIT_AREA_WIDTH =155; public static final double SECOND_EDIT_AREA_WIDTH =143; public static final int COMPONENT_INTERVAL =12; - public static final Border SECOND_EDIT_AREA_Border = BorderFactory.createEmptyBorder(0,12,0,0); + public static final Border SECOND_EDIT_AREA_BORDER = BorderFactory.createEmptyBorder(0,12,0,0); diff --git a/designer_chart/src/com/fr/plugin/chart/map/VanChartMapSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/map/VanChartMapSeriesPane.java index f8e95b66de..4b5189f6a4 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/VanChartMapSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/VanChartMapSeriesPane.java @@ -252,7 +252,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane { markerTypeCom = new UIComboBox(MARKER_TYPES); commonMarkerPane = new VanChartMapScatterMarkerPane(); - commonMarkerPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_Border); + commonMarkerPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER); bubblePane = new VanChartBubblePane(){ protected JPanel getContentPane () { double p = TableLayout.PREFERRED; @@ -262,7 +262,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane { double[] col = {f, e}; JPanel panel = TableLayoutHelper.createTableLayoutPane(getComponent(), row, col); - panel.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_Border); + panel.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER); return panel; } };