diff --git a/designer_base/src/com/fr/design/dialog/BasicScrollPane.java b/designer_base/src/com/fr/design/dialog/BasicScrollPane.java index bdb5a012f1..eebf16f649 100644 --- a/designer_base/src/com/fr/design/dialog/BasicScrollPane.java +++ b/designer_base/src/com/fr/design/dialog/BasicScrollPane.java @@ -1,23 +1,15 @@ package com.fr.design.dialog; -import java.awt.AWTEvent; -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.LayoutManager; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.iscrollbar.UIScrollBar; + +import javax.swing.*; +import java.awt.*; import java.awt.event.AdjustmentEvent; import java.awt.event.AdjustmentListener; import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; -import javax.swing.BorderFactory; -import javax.swing.JPanel; -import javax.swing.JScrollBar; - -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.iscrollbar.UIScrollBar; - public abstract class BasicScrollPane extends BasicBeanPane{ private static final long serialVersionUID = -4293765343535336275L; private static final int MAXVALUE = 100; @@ -119,7 +111,7 @@ public abstract class BasicScrollPane extends BasicBeanPane{ /** * august:不容易啊 还要用笔画图立个方程才计算出来 * - * @param e + * @param */ protected void ajustValues() { doLayout(); @@ -163,26 +155,30 @@ public abstract class BasicScrollPane extends BasicBeanPane{ } else { int preferheight = leftcontentPane.getPreferredSize().height; int value = scrollBar.getValue(); - + int baseValue = MAXVALUE - scrollBar.getVisibleAmount(); beginY = baseValue == 0 ? 0 : value * (preferheight - maxheight) / baseValue; if(MAXVALUE - scrollBar.getVisibleAmount() != 0) { beginY = value * (preferheight - maxheight) / (MAXVALUE - scrollBar.getVisibleAmount()); } } - int width = parent.getWidth(); - int height = parent.getHeight(); - if (leftcontentPane.getPreferredSize().height > maxheight) { - leftcontentPane.setBounds(0, -beginY, width - scrollBar.getWidth() - DET_WIDTH_OVER_HEIGHT, height + beginY); - scrollBar.setBounds(width - scrollBar.getWidth() - 1, 0, scrollBar.getWidth(), height); - } else { - leftcontentPane.setBounds(0, 0, width - DET_WIDTH, height); - } + setLeftContentPaneBounds(parent, scrollBar, beginY, maxheight); leftcontentPane.validate(); } } + protected void setLeftContentPaneBounds(Container parent, UIScrollBar scrollBar, int beginY, int maxheight) { + int width = parent.getWidth(); + int height = parent.getHeight(); + if (leftcontentPane.getPreferredSize().height > maxheight) { + leftcontentPane.setBounds(0, -beginY, width - scrollBar.getWidth() - DET_WIDTH_OVER_HEIGHT, height + beginY); + scrollBar.setBounds(width - scrollBar.getWidth() - 1, 0, scrollBar.getWidth(), height); + } else { + leftcontentPane.setBounds(0, 0, width - DET_WIDTH, height); + } + } + protected boolean isShowScrollBar() { return true; } @@ -191,7 +187,7 @@ public abstract class BasicScrollPane extends BasicBeanPane{ public T updateBean() { return null; } - + /** * 用于在调用removeAll以后恢复原来pane的结构,放在这边是因为BarLayout是内部类 * @param pane diff --git a/designer_base/src/com/fr/design/gui/frpane/AbstractAttrNoScrollPane.java b/designer_base/src/com/fr/design/gui/frpane/AbstractAttrNoScrollPane.java index 00c1f07952..755d9cfaea 100644 --- a/designer_base/src/com/fr/design/gui/frpane/AbstractAttrNoScrollPane.java +++ b/designer_base/src/com/fr/design/gui/frpane/AbstractAttrNoScrollPane.java @@ -1,10 +1,10 @@ package com.fr.design.gui.frpane; +import com.fr.design.dialog.BasicPane; import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameObserver; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; -import com.fr.design.dialog.BasicPane; import javax.swing.*; import java.awt.*; diff --git a/designer_base/src/com/fr/design/layout/TableLayoutHelper.java b/designer_base/src/com/fr/design/layout/TableLayoutHelper.java index b15aa99ba7..36c3a93b54 100644 --- a/designer_base/src/com/fr/design/layout/TableLayoutHelper.java +++ b/designer_base/src/com/fr/design/layout/TableLayoutHelper.java @@ -4,11 +4,10 @@ package com.fr.design.layout; import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; -import com.fr.general.Inter; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.Inter; import javax.swing.*; - import java.awt.*; @@ -19,6 +18,7 @@ public class TableLayoutHelper { public static final int FILL_LASTCOL_AND_ROW = 3; private static final int FIVE = 5; private static final int TEN = 10; + private TableLayoutHelper() { } @@ -249,7 +249,7 @@ public class TableLayoutHelper { * @param columnSize 二级菜单的列数 * @return */ - public static JPanel createTableLayoutPane4Chart(String[] title, Component[][] components, double[] rowSize, double[] columnSize){ + public static JPanel createTableLayoutPane4Chart(String[] title, Component[][] components, double[] rowSize, double[] columnSize){ JPanel secondMenu = createTableLayoutPane(components, rowSize, columnSize); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; diff --git a/designer_chart/src/com/fr/design/mainframe/chart/AbstractChartAttrPane.java b/designer_chart/src/com/fr/design/mainframe/chart/AbstractChartAttrPane.java index 8c4a21c814..183fb78417 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/AbstractChartAttrPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/AbstractChartAttrPane.java @@ -4,6 +4,9 @@ package com.fr.design.mainframe.chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; +import javax.swing.*; +import java.awt.*; + public abstract class AbstractChartAttrPane extends AbstractAttrNoScrollPane { public abstract void populate(ChartCollection collection); @@ -25,6 +28,12 @@ public abstract class AbstractChartAttrPane extends AbstractAttrNoScrollPane { } + protected void initContentPane() { + leftContentPane = createContentPane(); + leftContentPane.setBorder(BorderFactory.createMatteBorder(10, 0, 0, 0, original)); + this.add(leftContentPane, BorderLayout.CENTER); + } + /** * 刷新图表数据界面 * @param collection 图表收集器 diff --git a/designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java b/designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java index fc3b70108e..22b9db8e37 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe.chart; -import com.fr.base.BaseUtils; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.ChartTypeInterfaceManager; @@ -74,12 +73,12 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 //构建主面板 protected void createTabsPane() { - Icon[] iconArray = new Icon[paneList.size()]; + String[] iconArray = new String[paneList.size()]; card = new CardLayout(); center = new JPanel(card); for (int i = 0; i < paneList.size(); i++) { AbstractChartAttrPane pane = paneList.get(i); - iconArray[i] = BaseUtils.readIcon(pane.getIconPath()); + iconArray[i] = pane.title4PopupWindow(); center.add(pane, pane.title4PopupWindow()); } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java index 3ee84ceb7c..1f1f5a9f94 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java @@ -4,9 +4,9 @@ package com.fr.design.mainframe.chart.gui; * Created by hufan on 2016/10/20. */ -import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.base.AttrChangeConfig; import com.fr.chart.base.AttrChangeType; +import com.fr.chart.chartattr.ChartCollection; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; @@ -15,6 +15,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.general.Inter; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import javax.swing.*; import java.awt.*; @@ -55,11 +56,9 @@ public class ChangeConfigPane extends BasicBeanPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {p, f}; - double[] rowSize = {p,p,p,p}; + double[] rowSize = {p,p}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Change_Style") + ":"),configStyleButton}, - new Component[]{null, null}, - new Component[]{new JSeparator(), null}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Change_Style")),configStyleButton}, new Component[]{configPane, null}, }; return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); @@ -84,6 +83,8 @@ public class ChangeConfigPane extends BasicBeanPane { panel.add(buttonConfigPane, "button"); panel.add(carouselConfigPane, "carousel"); + panel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0)); + return panel; } @@ -92,35 +93,33 @@ public class ChangeConfigPane extends BasicBeanPane { double f = TableLayout.FILL; double[] columnSize = {p, f}; double[] rowSize = {p,p,p}; + timeInterval = new UISpinner(MIN_TIME, MAX_TIME, 1, 0); + colorSelectBox4carousel = new ColorSelectBoxWithOutTransparent(WIDTH); Component[][] components = new Component[][]{ - new Component[]{createTimeIntervalPane(),null}, - new Component[]{new JSeparator(),null}, - new Component[]{createCarouseBackgroundColorPane(),null}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Time_Interval")), timeInterval}, + new Component[]{new UILabel(Inter.getLocText("Background")),colorSelectBox4carousel}, }; - return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); - } - - private Component createTimeIntervalPane() { - timeInterval = new UISpinner(MIN_TIME, MAX_TIME, 1, 0); - return TableLayoutHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Time_Interval") + ":", timeInterval); - } - - private JPanel createCarouseBackgroundColorPane() { - colorSelectBox4carousel = new ColorSelectBoxWithOutTransparent(WIDTH); - return TableLayoutHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Background") + ":", colorSelectBox4carousel); + return TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); } private JPanel createTitleStylePane(){ - styleAttrPane = new ChartTextAttrPane(); + styleAttrPane = new ChartTextAttrPane(){ + protected Component[][] getComponents(JPanel buttonPane) { + return new Component[][]{ + new Component[]{fontNameComboBox, null}, + new Component[]{buttonPane, null} + }; + } + }; styleAttrPane.setPreferredSize(new Dimension(WIDTH, (int) styleAttrPane.getPreferredSize().getHeight())); - return TableLayoutHelper.createTableLayoutPaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style")+":", styleAttrPane); + return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-Chart_Character")+":", styleAttrPane); } private JPanel createButtonBackgroundColorPane(){ colorSelectBox4button = new ColorSelectBoxWithOutTransparent(WIDTH); - return TableLayoutHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Background") + ":", colorSelectBox4button); + return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Background") + ":", colorSelectBox4button); } private JPanel createButtonConfigPane() { @@ -130,7 +129,6 @@ public class ChangeConfigPane extends BasicBeanPane { double[] rowSize = {p,p,p}; Component[][] components = new Component[][]{ new Component[]{createTitleStylePane(),null}, - new Component[]{new JSeparator(),null}, new Component[]{createButtonBackgroundColorPane(),null}, }; 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 1146d404d5..e53a505345 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 @@ -1,25 +1,23 @@ package com.fr.design.mainframe.chart.gui.style; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.FlowLayout; -import java.awt.Font; - -import javax.swing.JPanel; - import com.fr.base.BaseUtils; import com.fr.base.Utils; import com.fr.chart.base.TextAttr; import com.fr.design.constants.LayoutConstants; +import com.fr.design.dialog.BasicPane; import com.fr.design.event.UIObserverListener; import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.dialog.BasicPane; -import com.fr.general.FRFont; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.FRFont; +import com.fr.general.Inter; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; + +import javax.swing.*; +import java.awt.*; public class ChartTextAttrPane extends BasicPane { private static final long serialVersionUID = 6731679928019436869L; @@ -147,17 +145,23 @@ public class ChartTextAttrPane extends BasicPane { buttonPane.add(GUICoreUtils.createFlowPane(components1, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE), BorderLayout.EAST); - double[] columnSize = {f}; - double[] rowSize = {p, p}; - Component[][] components = new Component[][]{ - new Component[]{fontNameComboBox}, - new Component[]{buttonPane} - }; + double[] columnSize = {p,f}; + double[] rowSize = {p, p, p}; + - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), rowSize, columnSize); this.setLayout(new BorderLayout()); this.add(panel, BorderLayout.CENTER); populate(FRFont.getInstance()); } + + protected Component[][] getComponents(JPanel buttonPane) { + UILabel text = new UILabel(Inter.getLocText("Plugin-Chart_Character"), SwingConstants.LEFT); + return new Component[][]{ + new Component[]{null, null}, + 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/AbstractVanChartScrollPane.java b/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartScrollPane.java new file mode 100644 index 0000000000..7d9eae143f --- /dev/null +++ b/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartScrollPane.java @@ -0,0 +1,30 @@ +package com.fr.plugin.chart.designer; + +import com.fr.design.dialog.BasicScrollPane; +import com.fr.design.gui.iscrollbar.UIScrollBar; + +import javax.swing.*; +import java.awt.*; + +/** + * Created by mengao on 2017/8/11. + */ +public abstract class AbstractVanChartScrollPane extends BasicScrollPane { + + protected void layoutContentPane() { + leftcontentPane = createContentPane(); + leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, original)); + this.add(leftcontentPane); + } + + protected void setLeftContentPaneBounds(Container parent, UIScrollBar scrollBar, int beginY, int maxheight) { + int width = parent.getWidth(); + int height = parent.getHeight(); + if (leftcontentPane.getPreferredSize().height > maxheight) { + leftcontentPane.setBounds(0, -beginY, width - scrollBar.getWidth(), height + beginY); + scrollBar.setBounds(width - scrollBar.getWidth() - 1, 0, scrollBar.getWidth(), height); + } else { + leftcontentPane.setBounds(0, 0, width, height); + } + } +} 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 8a16a472ca..cda309aaa8 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/TableLayout4VanChartHelper.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/TableLayout4VanChartHelper.java @@ -1,9 +1,11 @@ package com.fr.plugin.chart.designer; import com.fr.design.constants.LayoutConstants; +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.*; @@ -14,6 +16,39 @@ import java.awt.*; public class TableLayout4VanChartHelper { private static final int SMALL_GAP = 20; + public static final int EXPANDABLE_PANE_WIDTH =290; + public static final int EXPANDABLE_PANE_HIGHT =24; + + + public static JPanel createExpandablePaneWithTitle(String title, JPanel panel) { + return new UIExpandablePane(title, EXPANDABLE_PANE_WIDTH, EXPANDABLE_PANE_HIGHT, panel); + } + + public static JPanel createGapTableLayoutPane(String title, Component component) { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {p, f}; + double[] rowSize = {p, p}; + Component[][] components = new Component[][]{ + new Component[]{null, null}, + new Component[]{new UILabel(Inter.getLocText(title)), component}, + }; + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, SMALL_GAP, LayoutConstants.VGAP_LARGE); + } + + public static JPanel createGapTableLayoutPane(Component[][] components, + double[] rowSize, double[] columnSize) { + + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, SMALL_GAP, LayoutConstants.VGAP_LARGE); + } + + public static JPanel createGapTableLayoutPane(Component[][] components, + double[] rowSize, double[] columnSize, int[][] rowCount) { + + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, + SMALL_GAP, LayoutConstants.VGAP_LARGE); + } + /** * 标题布局(二级菜单距左边框46) * @param title 标题 diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPane.java index 9fa866a0de..09d72d413a 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPane.java @@ -4,17 +4,17 @@ import com.fr.base.background.ImageBackground; import com.fr.chart.chartglyph.GeneralInfo; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.UINumberDragPane; -import com.fr.design.gui.ibutton.UIToggleButton; +import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.backgroundpane.BackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane; import com.fr.general.Background; import com.fr.general.Inter; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.stable.Constants; import javax.swing.*; @@ -37,7 +37,7 @@ public class VanChartBackgroundPane extends BasicPane { protected UIComboBox typeComboBox; protected UINumberDragPane transparent; - protected UIToggleButton shadow; + protected UIButtonGroup shadow; protected JPanel centerPane; @@ -48,12 +48,10 @@ public class VanChartBackgroundPane extends BasicPane { double f = TableLayout.FILL; double[] columnSize = {p, f}; - double[] rowSize = { p,p,p,p,p}; - - JPanel panel = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Background"}, getPaneComponents(), rowSize, columnSize); + double[] rowSize = { p,p,p,p,p,p}; + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(getPaneComponents(), rowSize, columnSize); this.setLayout(new BorderLayout()); this.add(panel,BorderLayout.CENTER); - this.add(new JSeparator(), BorderLayout.SOUTH); } protected void initComponents() { @@ -90,12 +88,14 @@ public class VanChartBackgroundPane extends BasicPane { } protected Component[][] getPaneComponents() { - shadow = new UIToggleButton(Inter.getLocText("plugin-ChartF_OpenShadow")); + shadow = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_On"), Inter.getLocText("Plugin-ChartF_Off")}, new Boolean[]{true, false}); + return new Component[][]{ - new Component[]{typeComboBox, null}, - new Component[]{centerPane, null}, + 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}, - new Component[]{shadow, null}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Shadow")), shadow}, }; } @@ -137,7 +137,7 @@ public class VanChartBackgroundPane extends BasicPane { double alpha = attr.getAlpha() * ALPHA_V; transparent.populateBean(alpha); if(shadow != null){ - shadow.setSelected(attr.isShadow()); + shadow.setSelectedIndex(attr.isShadow() == true ? 0 : 1); } for (int i = 0; i < paneList.size(); i++) { BackgroundQuickPane pane = paneList.get(i); @@ -159,7 +159,7 @@ public class VanChartBackgroundPane extends BasicPane { } attr.setAlpha((float) (transparent.updateBean() / ALPHA_V)); if(shadow != null){ - attr.setShadow(shadow.isSelected()); + attr.setShadow(shadow.getSelectedIndex() == 0); } } } \ No newline at end of file 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 99c853edf0..f364562164 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 @@ -49,8 +49,9 @@ public class VanChartBackgroundPaneWithOutImageAndShadow extends VanChartBackgro @Override protected Component[][] getPaneComponents() { return new Component[][]{ - new Component[]{typeComboBox, null}, - new Component[]{centerPane, null}, + 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}, }; } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java index 46b9a283e3..f1d1c9ca48 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java @@ -22,8 +22,9 @@ public class VanChartBackgroundWithOutShadowWithRadiusPane extends VanChartBackg protected Component[][] getPaneComponents() { radius = new UISpinner(0,1000,1,0); return new Component[][]{ - new Component[]{typeComboBox, null}, - new Component[]{centerPane, null}, + 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}, new Component[]{new UILabel(Inter.getLocText("plugin-ChartF_Radius")+":"),radius} }; diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartMarkerBackgroundPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartMarkerBackgroundPane.java index 9bd5c773ee..67ea1c9d4b 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartMarkerBackgroundPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartMarkerBackgroundPane.java @@ -1,6 +1,7 @@ package com.fr.plugin.chart.designer.component.background; import com.fr.base.background.ColorBackground; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.backgroundpane.BackgroundQuickPane; @@ -33,8 +34,9 @@ public class VanChartMarkerBackgroundPane extends VanChartBackgroundPane { protected Component[][] getPaneComponents() { return new Component[][]{ - new Component[]{typeComboBox, null}, - new Component[]{centerPane, null} + new Component[]{null, null}, + new Component[]{new UILabel(Inter.getLocText("FR-Chart-Shape_Fill")), typeComboBox}, + new Component[]{null, centerPane}, }; } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/border/VanChartBorderPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/border/VanChartBorderPane.java index c706892870..2c79f63161 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/border/VanChartBorderPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/border/VanChartBorderPane.java @@ -7,9 +7,9 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.style.color.ColorSelectBox; import com.fr.general.Inter; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.stable.CoreConstants; import javax.swing.*; @@ -31,17 +31,18 @@ public class VanChartBorderPane extends BasicPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = { p,f }; - double[] rowSize = {p, p, p}; + double[] rowSize = {p, p, p, p}; Component[][] components = getUseComponent(); - JPanel panel = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Border"}, components, rowSize, columnSize); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); this.setLayout(new BorderLayout()); this.add(panel,BorderLayout.CENTER); } protected Component[][] getUseComponent() { return new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_LineStyle")+":"),currentLineCombo}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Color_Color")+":"),currentLineColorPane}, + new Component[]{null,null}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_LineStyle")),currentLineCombo}, + new Component[]{new UILabel(Inter.getLocText("FR-Chart-Color_Color")),currentLineColorPane}, }; } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/border/VanChartBorderWithRadiusPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/border/VanChartBorderWithRadiusPane.java index 9f6fa8ee2b..f7c330be24 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/border/VanChartBorderWithRadiusPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/border/VanChartBorderWithRadiusPane.java @@ -26,9 +26,10 @@ public class VanChartBorderWithRadiusPane extends VanChartBorderPane { @Override protected Component[][] getUseComponent() { return new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_LineStyle")+":"),currentLineCombo}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Color_Color")+":"),currentLineColorPane}, - new Component[]{new UILabel(Inter.getLocText("plugin-ChartF_Radius")+":"),radius} + new Component[]{null,null}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_LineStyle")),currentLineCombo}, + new Component[]{new UILabel(Inter.getLocText("FR-Chart-Color_Color")),currentLineColorPane}, + new Component[]{new UILabel(Inter.getLocText("plugin-ChartF_Radius")),radius} } ; } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartLegendPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartLegendPane.java index 25c26a95f5..12f5cb4dc9 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartLegendPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartLegendPane.java @@ -3,8 +3,8 @@ package com.fr.plugin.chart.designer.style; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.design.mainframe.chart.PaneTitleConstants; -import com.fr.design.dialog.BasicScrollPane; import com.fr.plugin.chart.attr.VanChartLegend; +import com.fr.plugin.chart.designer.AbstractVanChartScrollPane; import com.fr.plugin.chart.designer.PlotFactory; import com.fr.plugin.chart.vanchart.VanChart; @@ -14,7 +14,7 @@ import java.awt.*; /** * 属性表, 图表样式-图例 界面. */ -public class VanChartLegendPane extends BasicScrollPane { +public class VanChartLegendPane extends AbstractVanChartScrollPane { private static final long serialVersionUID = 7553135492053931171L; private VanChartPlotLegendPane legendContent; diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartPlotLegendPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartPlotLegendPane.java index dd77e29c73..3edee0a8a3 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartPlotLegendPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartPlotLegendPane.java @@ -12,12 +12,12 @@ import com.fr.design.gui.ispinner.UISpinner; 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.*; +import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.general.Inter; import com.fr.plugin.chart.attr.VanChartLegend; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.plugin.chart.designer.component.background.VanChartBackgroundWithOutImagePane; import com.fr.plugin.chart.designer.component.VanChartFloatPositionPane; +import com.fr.plugin.chart.designer.component.background.VanChartBackgroundWithOutImagePane; import com.fr.plugin.chart.designer.component.border.VanChartBorderWithRadiusPane; import com.fr.stable.Constants; @@ -52,6 +52,8 @@ public class VanChartPlotLegendPane extends BasicPane { protected VanChartFloatPositionPane customFloatPositionPane; protected UIButtonGroup limitSize; protected UISpinner maxProportion; + private UILabel limitSizeTitle; + //高亮显示的按钮 protected UIButtonGroup highlightButton; @@ -77,10 +79,9 @@ public class VanChartPlotLegendPane extends BasicPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] col = {f}; - double[] row = {p, p, p}; + double[] row = {p, p}; Component[][] components = new Component[][]{ new Component[]{isLegendVisible}, - new Component[]{new JSeparator()}, new Component[]{legendPane}, }; @@ -109,13 +110,11 @@ public class VanChartPlotLegendPane extends BasicPane { double[] rowSize = { p,p,p,p,p,p,p}; Component[][] components = new Component[][]{ - new Component[]{createTitlePositionPane(new double[]{p,p},columnSize),null}, - new Component[]{new JSeparator(),null}, + new Component[]{createTitlePositionPane(new double[]{p,p,p},columnSize),null}, new Component[]{createTitleStylePane(),null} , - new Component[]{new JSeparator(),null}, - new Component[]{borderPane,null}, - new Component[]{backgroundPane,null}, - new Component[]{createDisplayStrategy(),null} + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Border"),borderPane),null}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Background"), backgroundPane),null}, + new Component[]{TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_DisplayStrategy"), createDisplayStrategy()),null} }; return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); } @@ -124,6 +123,10 @@ public class VanChartPlotLegendPane extends BasicPane { borderPane = new VanChartBorderWithRadiusPane(); backgroundPane = new VanChartBackgroundWithOutImagePane(); highlightPane = createHighlightPane(); + JPanel panel = new JPanel(); + panel.setLayout(new BorderLayout()); + panel.add(createDisplayStrategy(), BorderLayout.CENTER); + panel.add(highlightPane, BorderLayout.SOUTH); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; @@ -131,14 +134,11 @@ public class VanChartPlotLegendPane extends BasicPane { double[] rowSize = { p,p,p,p,p,p,p,p}; Component[][] components = new Component[][]{ - new Component[]{createTitlePositionPane(new double[]{p,p},columnSize),null}, - new Component[]{new JSeparator(),null}, + new Component[]{createTitlePositionPane(new double[]{p,p,p},columnSize),null}, new Component[]{createTitleStylePane(),null} , - new Component[]{new JSeparator(),null}, - new Component[]{borderPane,null}, - new Component[]{backgroundPane,null}, - new Component[]{createDisplayStrategy(),null}, - new Component[]{highlightPane, null} + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Border"),borderPane),null}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Background"), backgroundPane),null}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_DisplayStrategy"), panel),null}, }; return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); } @@ -161,16 +161,17 @@ public class VanChartPlotLegendPane extends BasicPane { customFloatPositionButton.setEventBannded(true); Component[][] components = new Component[][]{ - new Component[]{location,null}, - new Component[]{customFloatPositionButton,null} + new Component[]{null,null}, + new Component[]{new UILabel(Inter.getLocText("Chart-Layout_Position")),location}, + new Component[]{null,customFloatPositionButton} }; customFloatPositionPane = new VanChartFloatPositionPane(); initPositionListener(); - JPanel panel = TableLayoutHelper.createTableLayoutPane(components,row,col); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Chart-Layout_Position"), panel); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,row,col); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart_Layout"), panel); } private void initPositionListener(){ @@ -218,21 +219,26 @@ public class VanChartPlotLegendPane extends BasicPane { protected JPanel createTitleStylePane(){ textAttrPane = new ChartTextAttrPane(); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), textAttrPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), textAttrPane); } protected JPanel createDisplayStrategy(){ maxProportion = new UISpinner(0,100,1,30); - limitSize = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_LimitAreaSize"),Inter.getLocText("Plugin-ChartF_NotLimitAreaSize")}); + limitSize = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Limit"),Inter.getLocText("Plugin-ChartF_NotLimit")}); + limitSizeTitle = new UILabel(Inter.getLocText("Plugin-ChartF_MaxProportion")); + + double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = {f,p}; - double[] rowSize = {p,p}; + double[] columnSize = {p,f}; + double[] rowSize = {p,p,p}; Component[][] components = new Component[][]{ - new Component[]{limitSize,null}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_LegendMaxProportion")+":"),maxProportion}, + new Component[]{null,null}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_AreaSize"), SwingConstants.LEFT), limitSize}, + new Component[]{limitSizeTitle,maxProportion}, + }; - JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); limitSize.addActionListener(new ActionListener() { @Override @@ -240,23 +246,21 @@ public class VanChartPlotLegendPane extends BasicPane { checkMaxProPortionUse(); } }); - - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_DisplayStrategy"), panel); + return panel; } private JPanel createHighlightPane(){ highlightButton = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_On"), Inter.getLocText("Plugin-ChartF_Off")}, new Boolean[]{true, false}); - JPanel highlightPane = TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Highlight"), highlightButton); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = {f}; + double[] columnSize = {p,f}; double[] rowSize = {p,p}; Component[][] components = new Component[][]{ - new Component[]{new JSeparator()}, - new Component[]{highlightPane} + new Component[]{null,null}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Highlight")),highlightButton} }; - return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); + return TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); } protected void checkAllUse() { @@ -273,7 +277,9 @@ public class VanChartPlotLegendPane extends BasicPane { //检查最大显示占比是否可用 private void checkMaxProPortionUse() { - maxProportion.setEnabled(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); + maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); + limitSizeTitle.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); + } protected void checkBoxUse() { diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartRangeLegendPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartRangeLegendPane.java index fefd272fa4..0c8fd37037 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartRangeLegendPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartRangeLegendPane.java @@ -7,10 +7,10 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.general.Inter; import com.fr.plugin.chart.attr.VanChartLegend; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.plugin.chart.type.LegendType; import com.fr.plugin.chart.range.VanChartRangeLegend; import com.fr.plugin.chart.range.component.GradualLegendPane; import com.fr.plugin.chart.range.component.SectionLegendPane; +import com.fr.plugin.chart.type.LegendType; import javax.swing.*; import java.awt.*; @@ -80,7 +80,7 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane { } private JPanel createTableLayoutPaneWithTitle(String title, Component component) { - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(title, component); + return TableLayout4VanChartHelper.createGapTableLayoutPane(title, component); } protected UIButtonGroup createLegendTypeButton(){ @@ -114,7 +114,6 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane { double[] row = {p, p, p, p}; Component[][] components = new Component[][]{ new Component[]{legendTypeButtonWithTilePane}, - new Component[]{new JSeparator()}, new Component[]{rangeLegendPane}, new Component[]{commonLegendPane} }; diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartTitlePane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartTitlePane.java index f766fd6fd1..299beeee82 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartTitlePane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartTitlePane.java @@ -1,17 +1,5 @@ package com.fr.plugin.chart.designer.style; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; - -import javax.swing.Icon; -import javax.swing.JPanel; -import javax.swing.JSeparator; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - import com.fr.base.BaseUtils; import com.fr.base.Formula; import com.fr.base.Style; @@ -28,19 +16,28 @@ 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.dialog.BasicScrollPane; import com.fr.general.Inter; import com.fr.plugin.chart.attr.VanChartTitle; +import com.fr.plugin.chart.designer.AbstractVanChartScrollPane; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.plugin.chart.designer.component.background.VanChartBackgroundWithOutShadowWithRadiusPane; import com.fr.plugin.chart.designer.component.VanChartFloatPositionPane; +import com.fr.plugin.chart.designer.component.background.VanChartBackgroundWithOutShadowWithRadiusPane; import com.fr.plugin.chart.vanchart.VanChart; import com.fr.stable.Constants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + // 属性表-样式 标题界面 -public class VanChartTitlePane extends BasicScrollPane { +public class VanChartTitlePane extends AbstractVanChartScrollPane { private static final long serialVersionUID = -2438898431228882682L; private static final int WIDTH = 165; @@ -59,6 +56,7 @@ public class VanChartTitlePane extends BasicScrollPane { private VanChartFloatPositionPane customFloatPositionPane; private UIButtonGroup limitSize; private UISpinner maxProportion; + private UILabel limitSizeTitle; protected VanChartStylePane parent; @@ -87,7 +85,6 @@ public class VanChartTitlePane extends BasicScrollPane { double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ new Component[]{isTitleVisible}, - new Component[]{new JSeparator()}, new Component[]{titlePane} }; @@ -106,18 +103,16 @@ public class VanChartTitlePane extends BasicScrollPane { private JPanel createTitlePane(){ backgroundPane = new VanChartBackgroundWithOutShadowWithRadiusPane(); + double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {p, f}; double[] rowSize = {p,p,p,p,p,p,p,p}; Component[][] components = new Component[][]{ - new Component[]{createTitleContentPane(new double[]{p,p},columnSize),null}, - new Component[]{new JSeparator(),null}, - new Component[]{createTitlePositionPane(new double[]{p,p},columnSize),null}, - new Component[]{new JSeparator(),null}, + new Component[]{createTitleContentPane(new double[]{p,p,p},columnSize),null}, + new Component[]{createTitlePositionPane(new double[]{p,p,p},columnSize),null}, new Component[]{createTitleStylePane(),null}, - new Component[]{new JSeparator(),null}, - new Component[]{backgroundPane,null}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Background"), backgroundPane),null}, new Component[]{createDisplayStrategy(),null} }; @@ -128,12 +123,12 @@ public class VanChartTitlePane extends BasicScrollPane { titleContent = new TinyFormulaPane(); useHtml = new UIToggleButton(Inter.getLocText("Plugin-ChartF_Html")); Component[][] components = new Component[][]{ - new Component[]{titleContent,null}, - new Component[]{useHtml,null}, + new Component[]{null ,null}, + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Text"), SwingConstants.LEFT), titleContent}, + new Component[]{null ,useHtml}, }; - - JPanel panel = TableLayoutHelper.createTableLayoutPane(components,row,col); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Content"), panel); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,row,col); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Content"), panel); } private JPanel createTitlePositionPane(double[] row, double[] col){ @@ -147,35 +142,38 @@ public class VanChartTitlePane extends BasicScrollPane { customFloatPositionButton.setEventBannded(true); Component[][] components = new Component[][]{ - new Component[]{alignmentPane,null}, - new Component[]{customFloatPositionButton,null} + new Component[]{null,null}, + new Component[]{new UILabel(Inter.getLocText("BorderLayout-Constraints"), SwingConstants.LEFT),alignmentPane}, + new Component[]{null,customFloatPositionButton} }; customFloatPositionPane = new VanChartFloatPositionPane(); initPositionListener(); - JPanel panel = TableLayoutHelper.createTableLayoutPane(components,row,col); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Chart-Layout_Position"), panel); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,row,col); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart_Layout"), panel); } private JPanel createTitleStylePane(){ textAttrPane = new ChartTextAttrPane(); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), textAttrPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), textAttrPane); } private JPanel createDisplayStrategy(){ maxProportion = new UISpinner(0,100,1,30); - limitSize = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_LimitAreaSize"),Inter.getLocText("Plugin-ChartF_NotLimitAreaSize")}); + limitSize = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Limit"),Inter.getLocText("Plugin-ChartF_NotLimit")}); + limitSizeTitle = new UILabel(Inter.getLocText("Plugin-ChartF_MaxProportion")); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = {f,p}; - double[] rowSize = {p,p}; + double[] columnSize = {p,f}; + double[] rowSize = {p,p,p}; Component[][] components = new Component[][]{ - new Component[]{limitSize,null}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_TitleMaxProportion")+":"),maxProportion}, + new Component[]{null,null}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_AreaSize"), SwingConstants.LEFT), limitSize}, + new Component[]{limitSizeTitle,maxProportion}, }; - JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); limitSize.addActionListener(new ActionListener() { @Override @@ -184,7 +182,7 @@ public class VanChartTitlePane extends BasicScrollPane { } }); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_DisplayStrategy"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_DisplayStrategy"), panel); } private void initPositionListener(){ @@ -252,7 +250,8 @@ public class VanChartTitlePane extends BasicScrollPane { //检查最大显示占比是否可用 private void checkMaxProPortionUse() { - maxProportion.setEnabled(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); + maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); + limitSizeTitle.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); } /** diff --git a/designer_chart/src/com/fr/plugin/chart/range/component/GradualIntervalConfigPane.java b/designer_chart/src/com/fr/plugin/chart/range/component/GradualIntervalConfigPane.java index da1e7eaf02..d6951fd24c 100644 --- a/designer_chart/src/com/fr/plugin/chart/range/component/GradualIntervalConfigPane.java +++ b/designer_chart/src/com/fr/plugin/chart/range/component/GradualIntervalConfigPane.java @@ -69,7 +69,7 @@ public class GradualIntervalConfigPane extends JPanel{ new Component[]{minMaxValuePane, null}, new Component[]{new BoldFontTextLabel(Inter.getLocText(new String[]{"FR-Chart-Color_Subject", "FR-Chart-Color_Color"})), colorSelectBox}, new Component[]{new BoldFontTextLabel(Inter.getLocText("FR-Chart-Value_Divided_stage")), numberDragPane}, - new Component[]{legendGradientBar, null}, + new Component[]{null, legendGradientBar}, }; } diff --git a/designer_chart/src/com/fr/plugin/chart/range/component/GradualLegendPane.java b/designer_chart/src/com/fr/plugin/chart/range/component/GradualLegendPane.java index 37a4850249..3815693289 100644 --- a/designer_chart/src/com/fr/plugin/chart/range/component/GradualLegendPane.java +++ b/designer_chart/src/com/fr/plugin/chart/range/component/GradualLegendPane.java @@ -26,7 +26,7 @@ public class GradualLegendPane extends JPanel{ } private void initComponents() { intervalConfigPane = createGradualIntervalConfigPane(); - JPanel intervalConfigPaneWithTitle = TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Section_Config"),intervalConfigPane); + JPanel intervalConfigPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Section_Config"),intervalConfigPane); labelFormPane = new LegendLabelFormatPane(); double p = TableLayout.PREFERRED; @@ -34,10 +34,9 @@ public class GradualLegendPane extends JPanel{ double[] col = {f}; double[] row = {p, p, p, p}; Component[][] components = new Component[][]{ + new Component[]{null}, new Component[]{intervalConfigPaneWithTitle}, - new Component[]{new JSeparator()}, new Component[]{labelFormPane}, - new Component[]{new JSeparator()} }; JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); 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 9205691e35..a6e292784c 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 @@ -1,12 +1,14 @@ package com.fr.plugin.chart.range.component; +import com.fr.chart.base.LegendLabelFormat; import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.style.FormatPane; +import com.fr.design.layout.TableLayout; import com.fr.general.Inter; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.component.VanChartHtmlLabelPaneWithOutWidthAndHeight; import com.fr.plugin.chart.designer.style.VanChartStylePane; -import com.fr.chart.base.LegendLabelFormat; import javax.swing.*; import java.awt.*; @@ -44,10 +46,17 @@ public class LegendLabelFormatPane extends JPanel{ centerPane.add(labelFormat,Inter.getLocText("Plugin-ChartF_Common")); centerPane.add(htmlLabelPane, Inter.getLocText("Plugin-ChartF_Custom")); - JPanel contentPane = new JPanel(new BorderLayout(0, 4)); - contentPane.add(labelFormatStyle, BorderLayout.NORTH); - contentPane.add(centerPane, BorderLayout.CENTER); + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {p,f}; + double[] rowSize = {p,p,p}; + Component[][] components = new Component[][]{ + new Component[]{null,null}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Label_Format"), SwingConstants.LEFT), labelFormatStyle}, + new Component[]{centerPane,null}, + }; + JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); labelFormatStyle.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -56,7 +65,7 @@ public class LegendLabelFormatPane extends JPanel{ }); labelFormatStyle.setSelectedIndex(0); - JPanel panel = TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Label_Format"), contentPane); + JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Chart-Use_Format"), contentPane); this.setLayout(new BorderLayout()); this.add(panel,BorderLayout.CENTER); } diff --git a/designer_chart/src/com/fr/plugin/chart/range/component/SectionIntervalConfigPane.java b/designer_chart/src/com/fr/plugin/chart/range/component/SectionIntervalConfigPane.java index 13738deb8c..780392e1d1 100644 --- a/designer_chart/src/com/fr/plugin/chart/range/component/SectionIntervalConfigPane.java +++ b/designer_chart/src/com/fr/plugin/chart/range/component/SectionIntervalConfigPane.java @@ -1,6 +1,7 @@ package com.fr.plugin.chart.range.component; import com.fr.design.gui.ilable.BoldFontTextLabel; +import com.fr.design.layout.TableLayout; import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula; import com.fr.general.Inter; @@ -13,12 +14,19 @@ import java.awt.*; */ public class SectionIntervalConfigPane extends MapColorPickerPaneWithFormula { + protected double[] getRowSIze () { + double p = TableLayout.PREFERRED; + return new double[]{p, p, p, p}; + } + @Override protected Component[][] createComponents(){ return new Component[][]{ - new Component[]{new BoldFontTextLabel(""),getDesignTypeButtonGroup()}, + new Component[]{null,null}, new Component[]{new BoldFontTextLabel(Inter.getLocText(new String[]{"FR-Chart-Color_Subject", "FR-Chart-Color_Color"})), getFillStyleCombox()}, new Component[]{new BoldFontTextLabel(Inter.getLocText("FR-Chart-Value_Divided_stage")), getRegionNumPane()}, + new Component[]{new BoldFontTextLabel("Plugin-ChartF_RangeNum"),getDesignTypeButtonGroup()}, + }; } } \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/range/component/SectionLegendPane.java b/designer_chart/src/com/fr/plugin/chart/range/component/SectionLegendPane.java index 0198cd8323..416f2e414f 100644 --- a/designer_chart/src/com/fr/plugin/chart/range/component/SectionLegendPane.java +++ b/designer_chart/src/com/fr/plugin/chart/range/component/SectionLegendPane.java @@ -22,7 +22,7 @@ public class SectionLegendPane extends JPanel{ private void initComponents() { intervalConfigPane = createSectionIntervalConfigPane(); - JPanel intervalConfigPaneWithTitle = TableLayout4VanChartHelper.createTitlePane(Inter.getLocText("Plugin-ChartF_Section_Config"), intervalConfigPane, 16); + JPanel intervalConfigPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Section_Config"), intervalConfigPane); labelFormPane = new LegendLabelFormatPane(){ @Override protected void checkCustomLabelText() { @@ -35,10 +35,9 @@ public class SectionLegendPane extends JPanel{ double[] col = {f}; double[] row = {p, p, p, p}; Component[][] components = new Component[][]{ + new Component[]{null}, new Component[]{intervalConfigPaneWithTitle}, - new Component[]{new JSeparator()}, new Component[]{labelFormPane}, - new Component[]{new JSeparator()} }; JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col);