Browse Source

9.0图表样式修改:

1、整体布局调整
2、属性切换图标换为文字
3、样式:标题面板调整
4、样式:图例面板调整
master
mengao 7 years ago
parent
commit
e7213e85ab
  1. 26
      designer_base/src/com/fr/design/dialog/BasicScrollPane.java
  2. 4
      designer_base/src/com/fr/design/gui/frpane/AbstractAttrNoScrollPane.java
  3. 28
      designer_base/src/com/fr/design/layout/TableLayoutHelper.java
  4. 5
      designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java
  5. 44
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java
  6. 38
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java
  7. 47
      designer_chart/src/com/fr/plugin/chart/designer/TableLayout4VanChartHelper.java
  8. 78
      designer_chart/src/com/fr/plugin/chart/designer/style/VanChartPlotLegendPane.java
  9. 5
      designer_chart/src/com/fr/plugin/chart/designer/style/VanChartRangeLegendPane.java
  10. 77
      designer_chart/src/com/fr/plugin/chart/designer/style/VanChartTitlePane.java
  11. 2
      designer_chart/src/com/fr/plugin/chart/range/component/GradualIntervalConfigPane.java
  12. 5
      designer_chart/src/com/fr/plugin/chart/range/component/GradualLegendPane.java
  13. 19
      designer_chart/src/com/fr/plugin/chart/range/component/LegendLabelFormatPane.java
  14. 10
      designer_chart/src/com/fr/plugin/chart/range/component/SectionIntervalConfigPane.java
  15. 5
      designer_chart/src/com/fr/plugin/chart/range/component/SectionLegendPane.java

26
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<T> extends BasicBeanPane<T>{
private static final long serialVersionUID = -4293765343535336275L;
private static final int MAXVALUE = 100;
@ -112,14 +104,14 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
protected void layoutContentPane() {
leftcontentPane = createContentPane();
leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 5, original));
leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, original));
this.add(leftcontentPane);
}
/**
* august:不容易啊 还要用笔画图立个方程才计算出来
*
* @param e
* @param
*/
protected void ajustValues() {
doLayout();
@ -173,10 +165,10 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
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);
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 - DET_WIDTH, height);
leftcontentPane.setBounds(0, 0, width, height);
}
leftcontentPane.validate();
}

4
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.*;
@ -45,7 +45,7 @@ public abstract class AbstractAttrNoScrollPane extends BasicPane {
protected void initContentPane() {
leftContentPane = createContentPane();
leftContentPane.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 0, original));
leftContentPane.setBorder(BorderFactory.createMatteBorder(10, 0, 0, 0, original));
this.add(leftContentPane, BorderLayout.CENTER);
}

28
designer_base/src/com/fr/design/layout/TableLayoutHelper.java

@ -2,13 +2,13 @@ package com.fr.design.layout;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane;
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 +19,8 @@ public class TableLayoutHelper {
public static final int FILL_LASTCOL_AND_ROW = 3;
private static final int FIVE = 5;
private static final int TEN = 10;
public static final int EXPANDABLE_PANE_WIDTH =290;
public static final int EXPANDABLE_PANE_HIGHT =24;
private TableLayoutHelper() {
}
@ -262,6 +264,28 @@ public class TableLayoutHelper {
return createTableLayoutPane(comp, row, column);
}
public static JPanel createTableLayoutPane4ChartWithoutTitle(Component[][] components, double[] rowSize, double[] columnSize){
JPanel secondMenu = createTableLayoutPane(components, rowSize, columnSize);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] column = {LayoutConstants.CHART_ATTR_TOMARGIN, f};
double[] row = { p,p};
Component[][] comp = new Component[][]{
new Component[]{null, secondMenu},
};
return createTableLayoutPane(comp, row, column);
}
public static JPanel createExpandablePaneWithTitle(String title, Component[][] components, double[] rowSize, double[] columnSize){
JPanel jPanel = new JPanel();
JPanel contentPane = createTableLayoutPane4ChartWithoutTitle(components, rowSize, columnSize);
contentPane.setBorder(BorderFactory.createEmptyBorder(10 ,0, 0, 0));
jPanel.add(contentPane);
return new UIExpandablePane(title, EXPANDABLE_PANE_WIDTH, EXPANDABLE_PANE_HIGHT, jPanel);
}
public static void main (String[] args) {
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

5
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());
}

44
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<ChartCollection> {
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<ChartCollection> {
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<ChartCollection> {
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<ChartCollection> {
double[] rowSize = {p,p,p};
Component[][] components = new Component[][]{
new Component[]{createTitleStylePane(),null},
new Component[]{new JSeparator(),null},
new Component[]{createButtonBackgroundColorPane(),null},
};

38
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}
};
}
}

47
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.*;
@ -13,7 +15,52 @@ import java.awt.*;
*/
public class TableLayout4VanChartHelper {
private static final int DEFAULT_GAP = 0;
private static final int SMALL_GAP = 20;
public static JPanel createExpandablePaneWithTitle(String title, JPanel panel) {
return new UIExpandablePane(title, TableLayoutHelper.EXPANDABLE_PANE_WIDTH, TableLayoutHelper.EXPANDABLE_PANE_HIGHT, panel);
}
public static JPanel createExpandablePaneWithTitle(String title, Component component) {
JPanel panel = (JPanel) component;
return new UIExpandablePane(title, TableLayoutHelper.EXPANDABLE_PANE_WIDTH, TableLayoutHelper.EXPANDABLE_PANE_HIGHT, panel);
}
public static JPanel createGapTableLayoutPane(Component[][] components) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, SMALL_GAP, LayoutConstants.VGAP_LARGE);
}
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 标题

78
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<Integer> limitSize;
protected UISpinner maxProportion;
private UILabel limitSizeTitle;
//高亮显示的按钮
protected UIButtonGroup<Boolean> 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<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_LimitAreaSize"),Inter.getLocText("Plugin-ChartF_NotLimitAreaSize")});
limitSize = new UIButtonGroup<Integer>(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<Boolean>(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() {

5
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<LegendType> 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}
};

77
designer_chart/src/com/fr/plugin/chart/designer/style/VanChartTitlePane.java

@ -1,22 +1,11 @@
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;
import com.fr.base.Utils;
import com.fr.chart.base.TextAttr;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.frpane.UIBubbleFloatPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
@ -28,17 +17,25 @@ 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.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<VanChart> {
private static final long serialVersionUID = -2438898431228882682L;
@ -59,6 +56,7 @@ public class VanChartTitlePane extends BasicScrollPane<VanChart> {
private VanChartFloatPositionPane customFloatPositionPane;
private UIButtonGroup<Integer> limitSize;
private UISpinner maxProportion;
private UILabel limitSizeTitle;
protected VanChartStylePane parent;
@ -87,7 +85,6 @@ public class VanChartTitlePane extends BasicScrollPane<VanChart> {
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<VanChart> {
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<VanChart> {
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<VanChart> {
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<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_LimitAreaSize"),Inter.getLocText("Plugin-ChartF_NotLimitAreaSize")});
limitSize = new UIButtonGroup<Integer>(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<VanChart> {
}
});
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<VanChart> {
//检查最大显示占比是否可用
private void checkMaxProPortionUse() {
maxProportion.setEnabled(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
limitSizeTitle.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
}
/**

2
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},
};
}

5
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);

19
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);
}

10
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()},
};
}
}

5
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);

Loading…
Cancel
Save