Browse Source

Merge pull request #21 in CHART/design from ~MANGO/m_design:release/9.0 to release/9.0

* commit '68b02f1c051f538535f636152c166fbaf374f6cd':
  坐标轴系列等面板
master
superman 7 years ago
parent
commit
be3c8aa594
  1. 2
      designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java
  2. 18
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java
  3. 28
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java
  4. 71
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java
  5. 4
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java
  6. 40
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java
  7. 13
      designer_chart/src/com/fr/plugin/chart/designer/PlotFactory.java
  8. 17
      designer_chart/src/com/fr/plugin/chart/designer/component/VanChartBeautyPane.java
  9. 3
      designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartGradientPane.java
  10. 4
      designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartAxisScrollPaneWithOutTypeSelect.java
  11. 9
      designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java
  12. 121
      designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartBaseAxisPane.java
  13. 97
      designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartTimeAxisPane.java
  14. 44
      designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartValueAxisPane.java
  15. 18
      designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/MinMaxValuePaneWithOutSecTick.java
  16. 21
      designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/MinMaxValuePaneWithOutTick.java
  17. 92
      designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/VanChartMinMaxValuePane.java
  18. 24
      designer_chart/src/com/fr/plugin/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java
  19. 4
      designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java
  20. 11
      designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java
  21. 14
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAreaBackgroundPane.java
  22. 20
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java
  23. 47
      designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java
  24. 10
      designer_chart/src/com/fr/plugin/chart/gauge/VanChartGaugeSeriesPane.java
  25. 7
      designer_chart/src/com/fr/plugin/chart/pie/RadiusCardLayoutPane.java
  26. 31
      designer_chart/src/com/fr/plugin/chart/pie/VanChartPieSeriesPane.java

2
designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java

@ -81,7 +81,7 @@ public class MinMaxValuePane extends JPanel {
}; };
} }
private void checkBoxUse() { protected void checkBoxUse() {
minValueField.setEnabled(minCheckBox.isSelected()); minValueField.setEnabled(minCheckBox.isSelected());
maxValueField.setEnabled(maxCheckBox.isSelected()); maxValueField.setEnabled(maxCheckBox.isSelected());

18
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java

@ -97,17 +97,21 @@ public class ChartFillStylePane extends BasicBeanPane<AttrFillStyle>{
customPane.setPreferredSize(new Dimension(200, 130)); customPane.setPreferredSize(new Dimension(200, 130));
colorGradient.setPreferredSize(new Dimension(120, 30)); colorGradient.setPreferredSize(new Dimension(120, 30));
this.setLayout(new BorderLayout());
this.add(getContentPane(),BorderLayout.CENTER);
}
protected JPanel getContentPane () {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = { f }; double[] columnSize = { f };
double[] rowSize = { p, p}; double[] rowSize = { p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{styleSelectBox}, new Component[]{styleSelectBox},
new Component[]{customPane} new Component[]{customPane}
} ; } ;
JPanel panel = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ColorMatch"},components,rowSize,columnSize); return TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ColorMatch"},components,rowSize,columnSize);
this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER);
} }
@Override @Override

28
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java

@ -1,24 +1,18 @@
package com.fr.design.mainframe.chart.gui.style; package com.fr.design.mainframe.chart.gui.style;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.util.List;
import javax.swing.JPanel;
import javax.swing.border.Border;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.constants.UIConstants;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ibutton.UIHeadGroup;
import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*;
import java.util.List;
public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{ public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{
private static final long serialVersionUID = 2298609199400393886L; private static final long serialVersionUID = 2298609199400393886L;
@ -114,8 +108,8 @@ public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{
protected static class NamePane { protected static class NamePane {
private String name; private String name;
private AbstractChartTabPane pane; private BasicScrollPane pane;
public NamePane(String name, AbstractChartTabPane pane) { public NamePane(String name, BasicScrollPane pane) {
this.name = name; this.name = name;
this.pane = pane; this.pane = pane;
} }
@ -125,10 +119,10 @@ public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public AbstractChartTabPane getPane() { public BasicScrollPane getPane() {
return pane; return pane;
} }
public void setPane(AbstractChartTabPane pane) { public void setPane(BasicScrollPane pane) {
this.pane = pane; this.pane = pane;
} }

71
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java

@ -27,50 +27,55 @@ public abstract class AbstractPlotSeriesPane extends BasicBeanPane<Plot>{
this(parent, plot, false); this(parent, plot, false);
} }
public AbstractPlotSeriesPane(ChartStylePane parent, Plot plot, boolean custom) { public AbstractPlotSeriesPane(ChartStylePane parent, Plot plot, boolean custom) {
this.plot = plot; this.plot = plot;
this.parentPane = parent; this.parentPane = parent;
fillStylePane = getFillStylePane(); fillStylePane = getFillStylePane();
double p = TableLayout.PREFERRED; this.setLayout(new BorderLayout());
double f = TableLayout.FILL; this.add(getContentPane(custom), BorderLayout.CENTER);
double[] columnSize = { f }; }
double[] rowSize = { p,p,p};
protected JPanel getContentPane(boolean custom) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[3][1]; Component[][] components = new Component[3][1];
if(custom) { JPanel panel;
if(!(plot instanceof Bar2DPlot)) {
components[0] = new Component[]{getContentInPlotType()};
components[1] = new Component[]{new JSeparator()};
}
JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); if (custom) {
if (!(plot instanceof Bar2DPlot)) {
components[0] = new Component[]{getContentInPlotType()};
components[1] = new Component[]{new JSeparator()};
}
JScrollPane scrollPane = new JScrollPane(); panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
scrollPane.setViewportView(panel);
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
this.setLayout(new BorderLayout()); JScrollPane scrollPane = new JScrollPane();
this.add(scrollPane, BorderLayout.CENTER); scrollPane.setViewportView(panel);
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
} else { } else {
if(fillStylePane != null) { if (fillStylePane != null) {
components[0] = new Component[]{fillStylePane}; components[0] = new Component[]{fillStylePane};
components[1] = new Component[]{new JSeparator()}; components[1] = new Component[]{new JSeparator()};
} }
JPanel contentPane = getContentInPlotType(); JPanel contentPane = getContentInPlotType();
if(contentPane != null) { if (contentPane != null) {
components[2] = new Component[]{contentPane}; components[2] = new Component[]{contentPane};
} }
JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER);
} }
} panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
return panel;
/** }
/**
* 在每个不同类型Plot, 得到不同类型的属性. 比如: 柱形的风格, 折线的线型曲线. * 在每个不同类型Plot, 得到不同类型的属性. 比如: 柱形的风格, 折线的线型曲线.
*/ */
protected abstract JPanel getContentInPlotType(); protected abstract JPanel getContentInPlotType();

4
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java

@ -3,9 +3,9 @@ package com.fr.design.mainframe.chart.gui.style.series;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.plugin.chart.designer.AbstractVanChartScrollPane;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -15,7 +15,7 @@ import java.awt.*;
* @author kunsnat E-mail:kunsnat@gmail.com * @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2013-1-5 上午10:31:50 * @version 创建时间2013-1-5 上午10:31:50
*/ */
public class ChartSeriesPane extends BasicScrollPane<Chart>{ public class ChartSeriesPane extends AbstractVanChartScrollPane<Chart> {
protected AbstractPlotSeriesPane seriesStyleContentPane; protected AbstractPlotSeriesPane seriesStyleContentPane;
protected Chart chart; protected Chart chart;

40
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java

@ -1,27 +1,11 @@
package com.fr.design.mainframe.chart.gui.style.series; package com.fr.design.mainframe.chart.gui.style.series;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.LayoutManager;
import java.awt.Point;
import java.awt.event.*;
import java.util.ArrayList;
import java.util.List;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.chart.base.AreaColor; import com.fr.chart.base.AreaColor;
import com.fr.chart.base.ChartBaseUtils; import com.fr.chart.base.ChartBaseUtils;
import com.fr.chart.chartglyph.MapHotAreaColor; import com.fr.chart.chartglyph.MapHotAreaColor;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.frpane.UINumberDragPane;
@ -31,12 +15,20 @@ import com.fr.design.gui.ipoppane.PopupHider;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import com.fr.design.style.color.ColorControlWindow; import com.fr.design.style.color.ColorControlWindow;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
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.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;
public class UIColorPickerPane extends BasicPane implements UIObserver { public class UIColorPickerPane extends BasicPane implements UIObserver {
private static final int MARGIN_TOP = 10; private static final int MARGIN_TOP = 10;
@ -105,11 +97,10 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p, p, p};
Component[][] components = createComponents(); Component[][] components = createComponents();
upControlPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); upControlPane = TableLayoutHelper.createTableLayoutPane(components, getRowSIze (), columnSize);
this.textFieldList = this.getTextFieldList(); this.textFieldList = this.getTextFieldList();
this.textGroup = new TextFieldGroupPane(); this.textGroup = new TextFieldGroupPane();
@ -122,6 +113,11 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
refreshGroupPane(colors, getValueArray(number)); refreshGroupPane(colors, getValueArray(number));
} }
protected double[] getRowSIze () {
double p = TableLayout.PREFERRED;
return new double[]{p, p, p};
}
protected UIButtonGroup<Integer> getDesignTypeButtonGroup(){ protected UIButtonGroup<Integer> getDesignTypeButtonGroup(){
return designTypeButtonGroup; return designTypeButtonGroup;
} }

13
designer_chart/src/com/fr/plugin/chart/designer/PlotFactory.java

@ -15,7 +15,11 @@ import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.plugin.chart.designer.component.VanChartLabelContentPane; import com.fr.plugin.chart.designer.component.VanChartLabelContentPane;
import com.fr.plugin.chart.designer.component.VanChartRefreshTooltipContentPane; import com.fr.plugin.chart.designer.component.VanChartRefreshTooltipContentPane;
import com.fr.plugin.chart.designer.component.VanChartTooltipContentPane; import com.fr.plugin.chart.designer.component.VanChartTooltipContentPane;
import com.fr.plugin.chart.designer.style.*; import com.fr.plugin.chart.designer.style.HeatMapRangeLegendPane;
import com.fr.plugin.chart.designer.style.VanChartPlotLegendPane;
import com.fr.plugin.chart.designer.style.VanChartRangeLegendPane;
import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.designer.style.VanLegendPaneWidthOutHighlight;
import com.fr.plugin.chart.designer.style.label.VanChartGaugePlotLabelPane; import com.fr.plugin.chart.designer.style.label.VanChartGaugePlotLabelPane;
import com.fr.plugin.chart.designer.style.label.VanChartPlotLabelPane; import com.fr.plugin.chart.designer.style.label.VanChartPlotLabelPane;
import com.fr.plugin.chart.designer.style.tooltip.VanChartPlotRefreshTooltipPane; import com.fr.plugin.chart.designer.style.tooltip.VanChartPlotRefreshTooltipPane;
@ -322,7 +326,12 @@ public class PlotFactory {
public static FormatPane createAutoFormatPane(){ public static FormatPane createAutoFormatPane(){
FormatPane formatPane = new FormatPane(){ FormatPane formatPane = new FormatPane(){
protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) {
return new Component[][]{
new Component[]{typePane,null},
new Component[]{centerPane, null},
};
}
protected UIComboBoxRenderer createComBoxRender(){ protected UIComboBoxRenderer createComBoxRender(){
return new UIComboBoxRenderer() { return new UIComboBoxRenderer() {
@Override @Override

17
designer_chart/src/com/fr/plugin/chart/designer/component/VanChartBeautyPane.java

@ -2,10 +2,11 @@ package com.fr.plugin.chart.designer.component;
import com.fr.chart.base.ChartConstants; import com.fr.chart.base.ChartConstants;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -15,19 +16,19 @@ import java.awt.*;
*/ */
//系列-风格 //系列-风格
public class VanChartBeautyPane extends BasicBeanPane<Integer> { public class VanChartBeautyPane extends BasicBeanPane<Integer> {
private UIComboBox styleBox; private UIButtonGroup styleBox;
public VanChartBeautyPane() { public VanChartBeautyPane() {
styleBox = new UIComboBox(getNameArray()); styleBox = new UIButtonGroup(getNameArray());
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = { f }; double[] columnSize = {p, f};
double[] rowSize = { p}; double[] rowSize = {p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{styleBox}, new Component[]{new UILabel(Inter.getLocText("Plugin-Chart_Style")), styleBox},
} ; } ;
JPanel panel = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Plugin-Chart_Style"}, components, rowSize, columnSize); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER); this.add(panel,BorderLayout.CENTER);
} }

3
designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartGradientPane.java

@ -44,8 +44,7 @@ public class VanChartGradientPane extends GradientBackgroundQuickPane {
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{gradientBar, null}, new Component[]{gradientBar, null},
new Component[]{new UILabel(Inter.getLocText("Plugin-Chart_Gradient_Direction") + ":")}, new Component[]{new UILabel(Inter.getLocText("Plugin-Chart_Gradient_Direction")),directionPane},
new Component[]{directionPane}
}; };
JPanel Gradient = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel Gradient = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());

4
designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartAxisScrollPaneWithOutTypeSelect.java

@ -1,8 +1,8 @@
package com.fr.plugin.chart.designer.style.axis; package com.fr.plugin.chart.designer.style.axis;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.designer.AbstractVanChartScrollPane;
import com.fr.plugin.chart.designer.style.VanChartStylePane; import com.fr.plugin.chart.designer.style.VanChartStylePane;
import javax.swing.*; import javax.swing.*;
@ -10,7 +10,7 @@ import javax.swing.*;
/** /**
* 无类型选择y轴数值轴 * 无类型选择y轴数值轴
*/ */
public class VanChartAxisScrollPaneWithOutTypeSelect extends BasicScrollPane<VanChartAxis> implements VanChartXYAxisPaneInterface{ public class VanChartAxisScrollPaneWithOutTypeSelect extends AbstractVanChartScrollPane<VanChartAxis> implements VanChartXYAxisPaneInterface{
private static final long serialVersionUID = 7700110757493668325L; private static final long serialVersionUID = 7700110757493668325L;
protected VanChartBaseAxisPane axisPane; protected VanChartBaseAxisPane axisPane;

9
designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java

@ -2,17 +2,17 @@ package com.fr.plugin.chart.designer.style.axis;
import com.fr.chart.chartattr.Axis; import com.fr.chart.chartattr.Axis;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.type.AxisType;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartTimeAxis; import com.fr.plugin.chart.attr.axis.VanChartTimeAxis;
import com.fr.plugin.chart.attr.axis.VanChartValueAxis; import com.fr.plugin.chart.attr.axis.VanChartValueAxis;
import com.fr.plugin.chart.designer.AbstractVanChartScrollPane;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.designer.style.VanChartStylePane; import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.type.AxisType;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -22,7 +22,7 @@ import java.util.List;
/** /**
* 带有坐标轴类型选择控件可选类型分类时间数值 * 带有坐标轴类型选择控件可选类型分类时间数值
*/ */
public class VanChartAxisScrollPaneWithTypeSelect extends BasicScrollPane<VanChartAxis> implements VanChartXYAxisPaneInterface{ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScrollPane<VanChartAxis> implements VanChartXYAxisPaneInterface{
private static final long serialVersionUID = -8462279689749700666L; private static final long serialVersionUID = -8462279689749700666L;
private UIComboBoxPane axisTypePane; private UIComboBoxPane axisTypePane;
private VanChartTimeAxisPane timeAxisPane; private VanChartTimeAxisPane timeAxisPane;
@ -56,7 +56,8 @@ public class VanChartAxisScrollPaneWithTypeSelect extends BasicScrollPane<VanCha
protected void initLayout() { protected void initLayout() {
this.setLayout(new BorderLayout(0,6)); this.setLayout(new BorderLayout(0,6));
JPanel northPane = TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_type"),jcb); JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_type"),jcb);
northPane.setBorder(BorderFactory.createEmptyBorder(0,10,10,10));
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
this.add(cardPane, BorderLayout.CENTER); this.add(cardPane, BorderLayout.CENTER);

121
designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartBaseAxisPane.java

@ -21,12 +21,12 @@ import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.type.AxisTickLineType;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.base.VanChartConstants; import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.designer.component.VanChartHtmlLabelPane; import com.fr.plugin.chart.designer.component.VanChartHtmlLabelPane;
import com.fr.plugin.chart.designer.style.VanChartStylePane; import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.type.AxisTickLineType;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
@ -54,6 +54,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected UINumberDragPane labelTextRotation; protected UINumberDragPane labelTextRotation;
protected UIButtonGroup<Integer> labelGapStyle; protected UIButtonGroup<Integer> labelGapStyle;
protected UITextField labelGapValue; protected UITextField labelGapValue;
protected JPanel labelPanel;
protected LineComboBox axisLineStyle; protected LineComboBox axisLineStyle;
protected ColorSelectBox axisLineColor; protected ColorSelectBox axisLineColor;
@ -61,10 +63,11 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected UIButtonGroup<AxisTickLineType> secondTick; protected UIButtonGroup<AxisTickLineType> secondTick;
protected UIButtonGroup<Integer> position; protected UIButtonGroup<Integer> position;
protected UIToggleButton reversed; protected UIButtonGroup<Boolean> reversed;
protected UIButtonGroup<Integer> axisLimitSize; protected UIButtonGroup<Integer> axisLimitSize;
protected UISpinner maxProportion; protected UISpinner maxProportion;
protected JPanel maxProportionPane;
protected UIButtonGroup valueFormatStyle; protected UIButtonGroup valueFormatStyle;
protected FormatPane valueFormat; protected FormatPane valueFormat;
@ -93,20 +96,14 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p,p,p,p,p,p,p,p,p,p,p,p,p,p}; double[] rowSize = {p, p, p, p, p, p, p,p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new JSeparator(),null}, new Component[]{createTitlePane(new double[]{p, p, p, p, p, p}, columnSize, isXAxis), null},
new Component[]{createTitlePane(new double[]{p, p, p, p, p}, columnSize, isXAxis),null}, new Component[]{createLabelPane(new double[]{p, p}, columnSize), null},
new Component[]{new JSeparator(),null}, new Component[]{createLineStylePane(new double[]{p, p, p, p, p}, columnSize), null},
new Component[]{createLabelPane(new double[]{p, p, p}, columnSize),null}, new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis), null},
new Component[]{new JSeparator(),null}, new Component[]{createDisplayStrategy(new double[]{p, p, p}, columnSize), null},
new Component[]{createLineStylePane(new double[]{p, p,p,p}, columnSize),null}, new Component[]{createValueStylePane(), null},
new Component[]{new JSeparator(),null},
new Component[]{createAxisPositionPane(new double[]{p, p}, columnSize, isXAxis),null},
new Component[]{new JSeparator(),null},
new Component[]{createDisplayStrategy(new double[]{p, p}, columnSize),null},
new Component[]{new JSeparator(),null},
new Component[]{createValueStylePane(),null},
}; };
return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
@ -125,15 +122,16 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
titleTextRotation.populateBean(-ROTATION_MAX); titleTextRotation.populateBean(-ROTATION_MAX);
} }
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{titleContent,null}, new Component[]{null,null},
new Component[]{titleAlignPane,null}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Content")),titleContent},
new Component[]{titleUseHtml,null}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Position")),titleAlignPane},
new Component[]{null,titleUseHtml},
new Component[]{titleTextAttrPane,null}, new Component[]{titleTextAttrPane,null},
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_TextRotation")),titleTextRotation}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_TextRotation")),titleTextRotation},
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(PaneTitleConstants.CHART_STYLE_TITLE_TITLE, panel); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_TITLE_TITLE, panel);
} }
private UIButtonGroup<Integer> getXAxisTitleAlignPane(){ private UIButtonGroup<Integer> getXAxisTitleAlignPane(){
@ -168,11 +166,13 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
JPanel gapPanel = TableLayoutHelper.createTableLayoutPane(gapComponents, row, col); JPanel gapPanel = TableLayoutHelper.createTableLayoutPane(gapComponents, row, col);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{showLabel,null},
new Component[]{labelTextAttrPane, null}, new Component[]{labelTextAttrPane, null},
new Component[]{gapPanel,null}, new Component[]{gapPanel,null},
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col);
JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_AxisLabel"),showLabel);
labelPanel = TableLayoutHelper.createTableLayoutPane(components, row, col);
labelPanel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0));
showLabel.addActionListener(new ActionListener() { showLabel.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -185,7 +185,10 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
checkLabelGapValuePane(); checkLabelGapValuePane();
} }
}); });
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, panel); JPanel jPanel = new JPanel(new BorderLayout());
jPanel.add(showLabelPane, BorderLayout.NORTH);
jPanel.add(labelPanel, BorderLayout.CENTER);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, jPanel);
} }
protected JPanel createLineStylePane(double[] row, double[] col){ protected JPanel createLineStylePane(double[] row, double[] col){
@ -197,11 +200,12 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
secondTick = new UIButtonGroup<AxisTickLineType>(strings, values); secondTick = new UIButtonGroup<AxisTickLineType>(strings, values);
JPanel panel = TableLayoutHelper.createTableLayoutPane(getLineStylePaneComponents(), row, col); JPanel panel = TableLayoutHelper.createTableLayoutPane(getLineStylePaneComponents(), row, col);
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_AxisLineStyle"), panel); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AxisLineStyle"), panel);
} }
protected Component[][] getLineStylePaneComponents() { protected Component[][] getLineStylePaneComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{null,null} ,
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_type")),axisLineStyle} , new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_type")),axisLineStyle} ,
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Color_Color")),axisLineColor}, new Component[]{new UILabel(Inter.getLocText("FR-Chart-Color_Color")),axisLineColor},
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MainGraduationLine")),mainTick}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MainGraduationLine")),mainTick},
@ -211,14 +215,15 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected JPanel createAxisPositionPane(double[] row, double[] col, boolean isXAxis){ protected JPanel createAxisPositionPane(double[] row, double[] col, boolean isXAxis){
position = new UIButtonGroup<Integer>(getAxisPositionNameArray(isXAxis), getAxisPositionValueArray(isXAxis)); position = new UIButtonGroup<Integer>(getAxisPositionNameArray(isXAxis), getAxisPositionValueArray(isXAxis));
reversed = new UIToggleButton(Inter.getLocText("Plugin-ChartF_OpenAxisReversed")); reversed = new UIButtonGroup<Boolean>(new String[]{Inter.getLocText("Plugin-ChartF_On"), Inter.getLocText("Plugin-ChartF_Off")}, new Boolean[]{true, false});
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{position, null}, new Component[]{null, null},
new Component[]{reversed,null}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_AxisLabel_Position")),position},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_AxisReversed")),reversed},
} ; } ;
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Chart-Layout_Position"), panel); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Chart-Layout_Position"), panel);
} }
private String[] getAxisPositionNameArray(boolean isXAxis){ private String[] getAxisPositionNameArray(boolean isXAxis){
@ -240,11 +245,13 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected JPanel createDisplayStrategy(double[] row, double[] col){ protected JPanel createDisplayStrategy(double[] row, double[] col){
maxProportion = new UISpinner(0,100,1,30); maxProportion = new UISpinner(0,100,1,30);
axisLimitSize = new UIButtonGroup<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_LimitAreaSize"),Inter.getLocText("Plugin-ChartF_NotLimitAreaSize")}); axisLimitSize = new UIButtonGroup<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_LimitAreaSize"),Inter.getLocText("Plugin-ChartF_NotLimitAreaSize")});
Component[][] components = new Component[][]{
new Component[]{axisLimitSize,null}, JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_AreaSize"),axisLimitSize);
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_AxisProportion")+":"),maxProportion}, maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_MaxProportion"),maxProportion);
}; maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0,15,0,0));
JPanel panel = TableLayoutHelper.createTableLayoutPane(components,row,col); JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
axisLimitSize.addActionListener(new ActionListener() { axisLimitSize.addActionListener(new ActionListener() {
@Override @Override
@ -253,7 +260,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
} }
}); });
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_DisplayStrategy"), panel); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_DisplayStrategy"), panel);
} }
protected JPanel createValueStylePane(){ protected JPanel createValueStylePane(){
@ -269,9 +276,17 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
centerPane.add(valueFormat,Inter.getLocText("Plugin-ChartF_Common")); centerPane.add(valueFormat,Inter.getLocText("Plugin-ChartF_Common"));
centerPane.add(htmlLabelPane, Inter.getLocText("Plugin-ChartF_Custom")); centerPane.add(htmlLabelPane, Inter.getLocText("Plugin-ChartF_Custom"));
JPanel contentPane = new JPanel(new BorderLayout(0, 4)); double p = TableLayout.PREFERRED;
contentPane.add(valueFormatStyle, BorderLayout.NORTH); double f = TableLayout.FILL;
contentPane.add(centerPane, BorderLayout.CENTER); 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_AxisLabel_Format"), SwingConstants.LEFT), valueFormatStyle},
new Component[]{null, centerPane},
};
JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize);
valueFormatStyle.addActionListener(new ActionListener() { valueFormatStyle.addActionListener(new ActionListener() {
@Override @Override
@ -280,11 +295,18 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
} }
}); });
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Chart-Use_Format"), contentPane); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Chart-Use_Format"), contentPane);
} }
protected FormatPane createFormatPane(){ protected FormatPane createFormatPane(){
return new FormatPane(); return new FormatPane(){
protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) {
return new Component[][]{
new Component[]{typePane,null},
new Component[]{centerPane, null},
};
}
};
} }
protected void checkFormatType() { protected void checkFormatType() {
@ -311,17 +333,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected void checkLabelPane() { protected void checkLabelPane() {
if(showLabel != null){ if(showLabel != null){
boolean enabled = showLabel.getSelectedIndex() == 0; boolean enabled = showLabel.getSelectedIndex() == 0;
if(labelTextAttrPane != null){ if(labelPanel != null){
labelTextAttrPane.setEnabled(enabled); labelPanel.setVisible(enabled);
}
if(labelTextRotation != null){
labelTextRotation.setEnabled(enabled);
}
if(labelGapValue != null){
labelGapValue.setEnabled(enabled);
}
if(labelGapStyle != null){
labelGapStyle.setEnabled(enabled);
} }
if(enabled){ if(enabled){
checkLabelGapValuePane(); checkLabelGapValuePane();
@ -329,7 +342,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
} }
} }
private void checkLabelGapValuePane() { protected void checkLabelGapValuePane() {
if(labelGapValue != null && labelGapStyle != null){ if(labelGapValue != null && labelGapStyle != null){
labelGapValue.setEnabled(labelGapStyle.getSelectedIndex() == 1); labelGapValue.setEnabled(labelGapStyle.getSelectedIndex() == 1);
} }
@ -337,8 +350,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
//检查最大显示占比是否可用 //检查最大显示占比是否可用
private void checkMaxProPortionUse() { private void checkMaxProPortionUse() {
if(maxProportion != null && axisLimitSize != null){ if(maxProportionPane != null && axisLimitSize != null){
maxProportion.setEnabled(axisLimitSize.getSelectedIndex() == 0 && axisLimitSize.isEnabled()); maxProportionPane.setVisible(axisLimitSize.getSelectedIndex() == 0 && axisLimitSize.isEnabled());
} }
} }
@ -453,7 +466,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
} }
} }
if(reversed != null){ if(reversed != null){
reversed.setSelected(axis.hasAxisReversed()); reversed.setSelectedIndex(axis.hasAxisReversed() == true ? 0 : 1);
} }
} }
@ -574,7 +587,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
axis.setPosition(position.getSelectedItem()); axis.setPosition(position.getSelectedItem());
} }
if(reversed != null){ if(reversed != null){
axis.setAxisReversed(reversed.isSelected()); axis.setAxisReversed(reversed.getSelectedItem());
} }
} }

97
designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartTimeAxisPane.java

@ -18,12 +18,12 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.DateUtils; import com.fr.general.DateUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.type.TimeType;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartTimeAxis; import com.fr.plugin.chart.attr.axis.VanChartTimeAxis;
import com.fr.plugin.chart.base.VanChartConstants; import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.plugin.chart.designer.PlotFactory; import com.fr.plugin.chart.designer.PlotFactory;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.type.TimeType;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
@ -38,6 +38,10 @@ import java.util.regex.Pattern;
* 时间坐标轴 * 时间坐标轴
*/ */
public class VanChartTimeAxisPane extends VanChartBaseAxisPane { public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
private JPanel minPane;
private JPanel maxPane;
private JPanel mainPane;
private JPanel secPane;
private static final long serialVersionUID = 1371126030195384450L; private static final long serialVersionUID = 1371126030195384450L;
private static final String[] TYPES = new String[]{ private static final String[] TYPES = new String[]{
@ -57,19 +61,12 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p,p,p,p,p,p,p,p,p,p,p,p,p,p}; double[] rowSize = {p,p,p,p,p,p,p,p,p,p,p,p,p,p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new JSeparator(),null}, new Component[]{createTitlePane(new double[]{p, p, p, p, p,p}, columnSize, isXAxis),null},
new Component[]{createTitlePane(new double[]{p, p, p, p, p}, columnSize, isXAxis),null},
new Component[]{new JSeparator(),null},
new Component[]{createLabelPane(new double[]{p, p, p}, columnSize),null}, new Component[]{createLabelPane(new double[]{p, p, p}, columnSize),null},
new Component[]{new JSeparator(),null},
new Component[]{createValueDefinition(),null}, new Component[]{createValueDefinition(),null},
new Component[]{new JSeparator(),null}, new Component[]{createLineStylePane(new double[]{p, p,p,p,p}, columnSize),null},
new Component[]{createLineStylePane(new double[]{p, p,p,p}, columnSize),null},
new Component[]{new JSeparator(),null},
new Component[]{createAxisPositionPane(new double[]{p, p}, columnSize, isXAxis),null}, new Component[]{createAxisPositionPane(new double[]{p, p}, columnSize, isXAxis),null},
new Component[]{new JSeparator(),null}, new Component[]{createDisplayStrategy(new double[]{p, p,p}, columnSize),null},
new Component[]{createDisplayStrategy(new double[]{p, p}, columnSize),null},
new Component[]{new JSeparator(),null},
new Component[]{createValueStylePane(),null}, new Component[]{createValueStylePane(),null},
}; };
@ -78,7 +75,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
private JPanel createValueDefinition(){ private JPanel createValueDefinition(){
timeMinMaxValuePane = new TimeMinMaxValuePane(); timeMinMaxValuePane = new TimeMinMaxValuePane();
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), timeMinMaxValuePane); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), timeMinMaxValuePane);
} }
@Override @Override
@ -145,44 +142,60 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] rowSize = {p, p, p}; double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {f, p, p};
Component[][] maxMin = {
{minCheckBox, minValueField},
{maxCheckBox, maxValueField},
};
JPanel maxMinPane = TableLayoutHelper.createTableLayoutPane(maxMin, rowSize, columnSize);
JPanel mainTickPane = new JPanel(); JPanel mainTickPane = new JPanel();
mainTickPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); mainTickPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
mainTickPane.add(mainTickBox);
mainTickPane.add(mainUnitField); mainTickPane.add(mainUnitField);
mainTickPane.add(mainType); mainTickPane.add(mainType);
JPanel secTickPane = new JPanel(); JPanel secTickPane = new JPanel();
secTickPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); secTickPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
secTickPane.add(secondTickBox);
secTickPane.add(secondUnitField); secTickPane.add(secondUnitField);
secTickPane.add(secondType); secTickPane.add(secondType);
minPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("FR-Chart-Data_Min"),minValueField);
maxPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("FR-Chart-Data_Max"),maxValueField);
mainPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_MainType"),mainTickPane);
secPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_SecType"),secTickPane);
minPane.setBorder(BorderFactory.createEmptyBorder(0,25,0,15));
maxPane.setBorder(BorderFactory.createEmptyBorder(0,25,0,15));
mainPane.setBorder(BorderFactory.createEmptyBorder(0,25,0,15));
secPane.setBorder(BorderFactory.createEmptyBorder(0,25,0,15));
JPanel minPaneWithCheckBox = new JPanel(new BorderLayout());
JPanel maxPaneWithCheckBox = new JPanel(new BorderLayout());
JPanel mainPaneWithCheckBox = new JPanel(new BorderLayout());
JPanel secPaneWithCheckBox = new JPanel(new BorderLayout());
minPaneWithCheckBox.add(minCheckBox, BorderLayout.NORTH);
minPaneWithCheckBox.add(minPane, BorderLayout.CENTER);
maxPaneWithCheckBox.add(maxCheckBox, BorderLayout.NORTH);
maxPaneWithCheckBox.add(maxPane, BorderLayout.CENTER);
mainPaneWithCheckBox.add(mainTickBox, BorderLayout.NORTH);
mainPaneWithCheckBox.add(mainPane, BorderLayout.CENTER);
secPaneWithCheckBox.add(secondTickBox, BorderLayout.NORTH);
secPaneWithCheckBox.add(secPane, BorderLayout.CENTER);
Component[][] components = { Component[][] components = {
{maxMinPane, null}, {minPaneWithCheckBox},
{mainTickPane, null}, {maxPaneWithCheckBox},
{secTickPane, null}, {mainPaneWithCheckBox},
{secPaneWithCheckBox},
}; };
this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize)); this.add(TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize));
} }
private void initMin() { private void initMin() {
// 最小值. // 最小值.
minCheckBox = new UICheckBox(Inter.getLocText("FR-Chart-Data_Min")); minCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Min_Value"}));
Date tmp = null; Date tmp = null;
DateEditor dateEditor = new DateEditor(tmp, true, Inter.getLocText("FR-Designer_Date"), UIDatePicker.STYLE_CN_DATETIME1); DateEditor dateEditor = new DateEditor(tmp, true, Inter.getLocText("FR-Designer_Date"), UIDatePicker.STYLE_CN_DATETIME1);
Editor formulaEditor = new FormulaEditor(Inter.getLocText("Plugin-ChartF_Formula")); Editor formulaEditor = new FormulaEditor(Inter.getLocText("Plugin-ChartF_Formula"));
Editor[] editor = new Editor[]{dateEditor, formulaEditor}; Editor[] editor = new Editor[]{dateEditor, formulaEditor};
minValueField = new ValueEditorPane(editor); minValueField = new ValueEditorPane(editor);
minValueField.setEnabled(false);
minCheckBox.addActionListener(new ActionListener() { minCheckBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
checkBoxUse(); checkBoxUse();
@ -192,13 +205,12 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
private void initMax() { private void initMax() {
// 最大值 // 最大值
maxCheckBox = new UICheckBox(Inter.getLocText("FR-Chart-Data_Max")); maxCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Max_Value"}));
Date tmp = null; Date tmp = null;
DateEditor dateEditor = new DateEditor(tmp, true, Inter.getLocText("FR-Designer_Date"), UIDatePicker.STYLE_CN_DATETIME1); DateEditor dateEditor = new DateEditor(tmp, true, Inter.getLocText("FR-Designer_Date"), UIDatePicker.STYLE_CN_DATETIME1);
Editor formulaEditor = new FormulaEditor(Inter.getLocText("Plugin-ChartF_Formula")); Editor formulaEditor = new FormulaEditor(Inter.getLocText("Plugin-ChartF_Formula"));
Editor[] editor = new Editor[]{dateEditor, formulaEditor}; Editor[] editor = new Editor[]{dateEditor, formulaEditor};
maxValueField = new ValueEditorPane(editor); maxValueField = new ValueEditorPane(editor);
maxValueField.setEnabled(false);
maxCheckBox.addActionListener(new ActionListener() { maxCheckBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
checkBoxUse(); checkBoxUse();
@ -208,12 +220,10 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
private void initMain() { private void initMain() {
// 主要刻度单位 // 主要刻度单位
mainTickBox = new UICheckBox(Inter.getLocText("Plugin-ChartF_MainType")); mainTickBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Plugin-ChartF_MainType"}));
mainUnitField = new UITextField(); mainUnitField = new UITextField();
mainUnitField.setPreferredSize(new Dimension(20, 20)); mainUnitField.setPreferredSize(new Dimension(20, 20));
mainUnitField.setEditable(false);
mainType = new UIComboBox(TYPES); mainType = new UIComboBox(TYPES);
mainType.setEnabled(false);
mainTickBox.addActionListener(new ActionListener() { mainTickBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -226,12 +236,10 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
private void initSecond() { private void initSecond() {
// 次要刻度单位 // 次要刻度单位
secondTickBox = new UICheckBox(Inter.getLocText("Plugin-ChartF_SecType")); secondTickBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Plugin-ChartF_SecType"}));
secondUnitField = new UITextField(); secondUnitField = new UITextField();
secondUnitField.setPreferredSize(new Dimension(20, 20)); secondUnitField.setPreferredSize(new Dimension(20, 20));
secondUnitField.setEditable(false);
secondType = new UIComboBox(TYPES); secondType = new UIComboBox(TYPES);
secondType.setEnabled(false);
secondTickBox.addActionListener(new ActionListener() { secondTickBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -244,22 +252,11 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
private void checkBoxUse() { private void checkBoxUse() {
minValueField.setEnabled(minCheckBox.isSelected());
maxValueField.setEnabled(maxCheckBox.isSelected());
if(minValueField.getCurrentEditor() instanceof FormulaEditor){
FormulaEditor tmpEditor = (FormulaEditor)minValueField.getCurrentEditor();
tmpEditor.enableEditor(minCheckBox.isSelected());
}
if(maxValueField.getCurrentEditor() instanceof FormulaEditor){
FormulaEditor tmpEditor = (FormulaEditor)maxValueField.getCurrentEditor();
tmpEditor.enableEditor(maxCheckBox.isSelected());
}
mainType.setEnabled(mainTickBox.isSelected()); minPane.setVisible(minCheckBox.isSelected());
mainUnitField.setEnabled(mainTickBox.isSelected()); maxPane.setVisible(maxCheckBox.isSelected());
secondType.setEnabled(secondTickBox.isSelected()); mainPane.setVisible(mainTickBox.isSelected());
secondUnitField.setEnabled(secondTickBox.isSelected()); secPane.setVisible(secondTickBox.isSelected());
} }
public void update(VanChartTimeAxis timeAxis){ public void update(VanChartTimeAxis timeAxis){

44
designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartValueAxisPane.java

@ -27,6 +27,7 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane {
protected VanChartMinMaxValuePane minMaxValuePane; protected VanChartMinMaxValuePane minMaxValuePane;
private UICheckBox logBox; private UICheckBox logBox;
private UITextField logBaseField; private UITextField logBaseField;
private JPanel logPane;
public VanChartValueAxisPane(){ public VanChartValueAxisPane(){
this(false); this(false);
@ -43,20 +44,13 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane {
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p,p,p,p,p,p,p,p,p,p,p,p,p,p}; double[] rowSize = {p,p,p,p,p,p,p,p,p,p,p,p,p,p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new JSeparator(),null}, new Component[]{createTitlePane(new double[]{p, p, p, p, p, p}, columnSize, isXAxis), null},
new Component[]{createTitlePane(new double[]{p, p, p, p,p}, columnSize, isXAxis),null}, new Component[]{createLabelPane(new double[]{p, p, p}, columnSize), null},
new Component[]{new JSeparator(),null}, new Component[]{createMinMaxValuePane(new double[]{p, p}, columnSize), null},
new Component[]{createLabelPane(new double[]{p, p, p}, columnSize),null}, new Component[]{createLineStylePane(new double[]{p, p, p, p, p}, columnSize), null},
new Component[]{new JSeparator(),null}, new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis), null},
new Component[]{createMinMaxValuePane(new double[]{p, p, p}, columnSize),null}, new Component[]{createDisplayStrategy(new double[]{p, p, p}, columnSize), null},
new Component[]{new JSeparator(),null}, new Component[]{createValueStylePane(), null},
new Component[]{createLineStylePane(new double[]{p, p,p,p}, columnSize),null},
new Component[]{new JSeparator(),null},
new Component[]{createAxisPositionPane(new double[]{p, p}, columnSize, isXAxis),null},
new Component[]{new JSeparator(),null},
new Component[]{createDisplayStrategy(new double[]{p, p}, columnSize),null},
new Component[]{new JSeparator(),null},
new Component[]{createValueStylePane(),null},
}; };
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
@ -64,12 +58,12 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane {
protected JPanel createMinMaxValuePane(double[] row, double[] col){ protected JPanel createMinMaxValuePane(double[] row, double[] col){
JPanel panel = createCommenValuePane(row,col); JPanel panel = createCommenValuePane(row,col);
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), panel); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), panel);
} }
protected JPanel createCommenValuePane(double[] row, double[] col){ protected JPanel createCommenValuePane(double[] row, double[] col){
initMinMaxValuePane(); initMinMaxValuePane();
logBox = new UICheckBox(Inter.getLocText("Plugin-ChartF_LogBaseValue") + " "); logBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Plugin-ChartF_LogBaseValue"}));
logBaseField = new UITextField(); logBaseField = new UITextField();
logBaseField.setPreferredSize(new Dimension(55, 20)); logBaseField.setPreferredSize(new Dimension(55, 20));
logBox.addActionListener(new ActionListener() { logBox.addActionListener(new ActionListener() {
@ -77,16 +71,26 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane {
logBaseField.setEnabled(logBox.isSelected()); logBaseField.setEnabled(logBox.isSelected());
} }
}); });
ChartSwingUtils.addListener(logBox, logBaseField); ChartSwingUtils.addListener(logBox, logBaseField);
// JPanel logPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); // JPanel logPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
// logPane.add(logBox); // logPane.add(logBox);
// logPane.add(logBaseField); // logPane.add(logBaseField);
logPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_LogBaseValue"), logBaseField);
logPane.setBorder(BorderFactory.createEmptyBorder(0, 25, 0, 15));
JPanel logPaneWithCheckBox = new JPanel(new BorderLayout());
logPaneWithCheckBox.add(logBox, BorderLayout.NORTH);
logPaneWithCheckBox.add(logPane, BorderLayout.CENTER);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{minMaxValuePane, null}, new Component[]{minMaxValuePane, null},
new Component[]{logBox}, new Component[]{logPaneWithCheckBox, null},
new Component[]{logBaseField}, };
} ;
logBox.addActionListener(new ActionListener() { logBox.addActionListener(new ActionListener() {
@Override @Override
@ -103,7 +107,7 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane {
} }
private void checkBox() { private void checkBox() {
logBaseField.setEnabled(logBox.isSelected()); logPane.setVisible(logBox.isSelected());
} }
/** /**

18
designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/MinMaxValuePaneWithOutSecTick.java

@ -1,5 +1,6 @@
package com.fr.plugin.chart.designer.style.axis.component; package com.fr.plugin.chart.designer.style.axis.component;
import javax.swing.*;
import java.awt.*; import java.awt.*;
/** /**
@ -9,14 +10,15 @@ public class MinMaxValuePaneWithOutSecTick extends VanChartMinMaxValuePane {
private static final long serialVersionUID = -887359523503645758L; private static final long serialVersionUID = -887359523503645758L;
protected Component[][] getPanelComponents() { protected double[] getRowSize(double p) {
return new Component[][]{ return new double[]{p, p, p};
new Component[]{minCheckBox}, }
new Component[]{minValueField},
new Component[]{maxCheckBox}, protected Component[][] getShowComponents(JPanel minPaneWithCheckBox, JPanel maxPaneWithCheckBox, JPanel mainPaneWithCheckBox, JPanel secPaneWithCheckBox) {
new Component[]{maxValueField}, return new Component[][] {
new Component[]{isCustomMainUnitBox}, {minPaneWithCheckBox},
new Component[]{mainUnitField}, {maxPaneWithCheckBox},
{mainPaneWithCheckBox},
}; };
} }

21
designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/MinMaxValuePaneWithOutTick.java

@ -3,6 +3,7 @@ package com.fr.plugin.chart.designer.style.axis.component;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.plugin.chart.range.MinAndMaxValue; import com.fr.plugin.chart.range.MinAndMaxValue;
import javax.swing.*;
import java.awt.*; import java.awt.*;
/** /**
@ -11,13 +12,14 @@ import java.awt.*;
public class MinMaxValuePaneWithOutTick extends VanChartMinMaxValuePane { public class MinMaxValuePaneWithOutTick extends VanChartMinMaxValuePane {
private static final long serialVersionUID = -957414093602086034L; private static final long serialVersionUID = -957414093602086034L;
@Override protected double[] getRowSize(double p) {
protected Component[][] getPanelComponents() { return new double[]{p, p};
return new Component[][]{ }
new Component[]{minCheckBox},
new Component[]{minValueField}, protected Component[][] getShowComponents(JPanel minPaneWithCheckBox, JPanel maxPaneWithCheckBox, JPanel mainPaneWithCheckBox, JPanel secPaneWithCheckBox) {
new Component[]{maxCheckBox}, return new Component[][] {
new Component[]{maxValueField}, {minPaneWithCheckBox},
{maxPaneWithCheckBox},
}; };
} }
@ -39,9 +41,4 @@ public class MinMaxValuePaneWithOutTick extends VanChartMinMaxValuePane {
minAndMaxValue.setCustomMax(maxCheckBox.isSelected()); minAndMaxValue.setCustomMax(maxCheckBox.isSelected());
} }
private void checkBoxUse() {
minValueField.setEnabled(minCheckBox.isSelected());
maxValueField.setEnabled(maxCheckBox.isSelected());
}
} }

92
designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/VanChartMinMaxValuePane.java

@ -2,9 +2,10 @@ package com.fr.plugin.chart.designer.style.axis.component;
import com.fr.design.chart.ChartSwingUtils; import com.fr.design.chart.ChartSwingUtils;
import com.fr.design.chart.axis.MinMaxValuePane; import com.fr.design.chart.axis.MinMaxValuePane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.general.Inter;
import com.fr.design.gui.itextfield.UITextField; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -14,31 +15,90 @@ import java.awt.event.ActionListener;
*/ */
public class VanChartMinMaxValuePane extends MinMaxValuePane { public class VanChartMinMaxValuePane extends MinMaxValuePane {
private JPanel minPane;
private JPanel maxPane;
private JPanel mainPane;
private JPanel secPane;
@Override @Override
protected double[] getRowSize(double p) { protected double[] getRowSize(double p) {
return new double[]{p, p, p, p, p, p, p, p}; return new double[]{p, p, p, p};
} }
@Override @Override
protected void addComponentListener(Component[][] components) { protected void addComponentListener(Component[][] components) {
for (int i = 0; i < components.length; i += 2) {
addListener((UICheckBox) components[i][0]); ChartSwingUtils.addListener(minCheckBox, minValueField);
ChartSwingUtils.addListener((UICheckBox) components[i][0], (UITextField) components[i + 1][0]); ChartSwingUtils.addListener(maxCheckBox, maxValueField);
} ChartSwingUtils.addListener(isCustomMainUnitBox, mainUnitField);
ChartSwingUtils.addListener(isCustomSecUnitBox, secUnitField);
minCheckBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
checkBoxUse();
}
});
maxCheckBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
checkBoxUse();
}
});
isCustomMainUnitBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
checkBoxUse();
}
});
isCustomSecUnitBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
checkBoxUse();
}
});
} }
@Override @Override
protected Component[][] getPanelComponents() { protected Component[][] getPanelComponents() {
return new Component[][]{
new Component[]{minCheckBox}, minPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("FR-Chart-Data_Min"),minValueField);
new Component[]{minValueField}, maxPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("FR-Chart-Data_Max"),maxValueField);
new Component[]{maxCheckBox}, mainPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_MainType"),mainUnitField);
new Component[]{maxValueField}, secPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_SecType"),secUnitField);
new Component[]{isCustomMainUnitBox},
new Component[]{mainUnitField}, minPane.setBorder(BorderFactory.createEmptyBorder(0,25,0,15));
new Component[]{isCustomSecUnitBox}, maxPane.setBorder(BorderFactory.createEmptyBorder(0,25,0,15));
new Component[]{secUnitField}, mainPane.setBorder(BorderFactory.createEmptyBorder(0,25,0,15));
secPane.setBorder(BorderFactory.createEmptyBorder(0,25,0,15));
JPanel minPaneWithCheckBox = new JPanel(new BorderLayout());
JPanel maxPaneWithCheckBox = new JPanel(new BorderLayout());
JPanel mainPaneWithCheckBox = new JPanel(new BorderLayout());
JPanel secPaneWithCheckBox = new JPanel(new BorderLayout());
minPaneWithCheckBox.add(minCheckBox, BorderLayout.NORTH);
minPaneWithCheckBox.add(minPane, BorderLayout.CENTER);
maxPaneWithCheckBox.add(maxCheckBox, BorderLayout.NORTH);
maxPaneWithCheckBox.add(maxPane, BorderLayout.CENTER);
mainPaneWithCheckBox.add(isCustomMainUnitBox, BorderLayout.NORTH);
mainPaneWithCheckBox.add(mainPane, BorderLayout.CENTER);
secPaneWithCheckBox.add(isCustomSecUnitBox, BorderLayout.NORTH);
secPaneWithCheckBox.add(secPane, BorderLayout.CENTER);
return getShowComponents(minPaneWithCheckBox, maxPaneWithCheckBox, mainPaneWithCheckBox, secPaneWithCheckBox);
}
protected Component[][] getShowComponents(JPanel minPaneWithCheckBox, JPanel maxPaneWithCheckBox, JPanel mainPaneWithCheckBox, JPanel secPaneWithCheckBox) {
return new Component[][] {
{minPaneWithCheckBox},
{maxPaneWithCheckBox},
{mainPaneWithCheckBox},
{secPaneWithCheckBox},
}; };
} }
protected void checkBoxUse() {
minPane.setVisible(minCheckBox.isSelected());
maxPane.setVisible(maxCheckBox.isSelected());
mainPane.setVisible(isCustomMainUnitBox.isSelected());
secPane.setVisible(isCustomSecUnitBox.isSelected());
}
} }

24
designer_chart/src/com/fr/plugin/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java

@ -15,8 +15,8 @@ import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.designer.style.axis.VanChartValueAxisPane; import com.fr.plugin.chart.designer.style.axis.VanChartValueAxisPane;
import com.fr.plugin.chart.designer.style.axis.component.MinMaxValuePaneWithOutTick; import com.fr.plugin.chart.designer.style.axis.component.MinMaxValuePaneWithOutTick;
import com.fr.plugin.chart.designer.style.axis.component.VanChartMinMaxValuePane; import com.fr.plugin.chart.designer.style.axis.component.VanChartMinMaxValuePane;
import com.fr.plugin.chart.type.GaugeStyle;
import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.type.GaugeStyle;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -54,11 +54,8 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane{
case THERMOMETER: case THERMOMETER:
return new Component[][]{ return new Component[][]{
new Component[]{createLabelPane(new double[]{p, p, p}, columnSize), null}, new Component[]{createLabelPane(new double[]{p, p, p}, columnSize), null},
new Component[]{new JSeparator(), null},
new Component[]{createValueDefinition(), null}, new Component[]{createValueDefinition(), null},
new Component[]{new JSeparator(), null},
new Component[]{createTickColorPane(new double[]{p, p, p}, new double[]{p, f}), null}, new Component[]{createTickColorPane(new double[]{p, p, p}, new double[]{p, f}), null},
new Component[]{new JSeparator(), null},
new Component[]{createValueStylePane()}, new Component[]{createValueStylePane()},
}; };
case RING: case RING:
@ -72,9 +69,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane{
default: default:
return new Component[][]{ return new Component[][]{
new Component[]{createLabelPane(new double[]{p, p, p}, columnSize), null}, new Component[]{createLabelPane(new double[]{p, p, p}, columnSize), null},
new Component[]{new JSeparator(), null},
new Component[]{createValueDefinition(), null}, new Component[]{createValueDefinition(), null},
new Component[]{new JSeparator(), null},
new Component[]{createValueStylePane()}, new Component[]{createValueStylePane()},
}; };
} }
@ -83,16 +78,21 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane{
protected JPanel createLabelPane(double[] row, double[] col){ protected JPanel createLabelPane(double[] row, double[] col){
showLabel = new UIButtonGroup(new String[]{Inter.getLocText("Chart-Use_Show"), Inter.getLocText("Plugin-ChartF_Hidden")}); showLabel = new UIButtonGroup(new String[]{Inter.getLocText("Chart-Use_Show"), Inter.getLocText("Plugin-ChartF_Hidden")});
labelTextAttrPane = new ChartTextAttrPane(); labelTextAttrPane = new ChartTextAttrPane();
labelPanel = new JPanel(new BorderLayout());
labelPanel.add(labelTextAttrPane);
labelPanel.setBorder(BorderFactory.createEmptyBorder(0,15,0,0));
JPanel panel = new JPanel(new BorderLayout(0, 6)); JPanel panel = new JPanel(new BorderLayout(0, 6));
panel.add(showLabel, BorderLayout.NORTH); panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_AxisLabel"), showLabel), BorderLayout.NORTH);
panel.add(labelTextAttrPane, BorderLayout.CENTER); panel.add(labelPanel, BorderLayout.CENTER);
showLabel.addActionListener(new ActionListener() { showLabel.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
checkLabelPane(); checkLabelPane();
} }
}); });
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, panel); JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, panel);
panel.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
return jPanel;
} }
private JPanel createValueDefinition(){ private JPanel createValueDefinition(){
@ -107,7 +107,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane{
minMaxValuePane = new VanChartMinMaxValuePane(); minMaxValuePane = new VanChartMinMaxValuePane();
break; break;
} }
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), minMaxValuePane); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), minMaxValuePane);
} }
private JPanel createTickColorPane(double[] row, double[] col){ private JPanel createTickColorPane(double[] row, double[] col){
@ -118,7 +118,9 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane{
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_SecondGraduationLine")), secTickColor}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_SecondGraduationLine")), secTickColor},
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_TickColor"), panel); JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_TickColor"), panel);
panel.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
return jPanel;
} }
private boolean isMulti(GaugeStyle style){ private boolean isMulti(GaugeStyle style){

4
designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java

@ -23,11 +23,8 @@ public class VanChartRadarXAxisPane extends VanChartBaseAxisPane {
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p,p,p,p,p,p}; double[] rowSize = {p,p,p,p,p,p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new JSeparator(),null},
new Component[]{createLabelPane(new double[]{p, p, p}, columnSize),null}, new Component[]{createLabelPane(new double[]{p, p, p}, columnSize),null},
new Component[]{new JSeparator(),null},
new Component[]{createLineStylePane(new double[]{p, p, p, p}, columnSize),null}, new Component[]{createLineStylePane(new double[]{p, p, p, p}, columnSize),null},
new Component[]{new JSeparator(),null},
new Component[]{createValueStylePane(),null}, new Component[]{createValueStylePane(),null},
}; };
@ -36,6 +33,7 @@ public class VanChartRadarXAxisPane extends VanChartBaseAxisPane {
protected Component[][] getLineStylePaneComponents() { protected Component[][] getLineStylePaneComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{null,null} ,
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_type")),axisLineStyle} , new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_type")),axisLineStyle} ,
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Color_Color")),axisLineColor}, new Component[]{new UILabel(Inter.getLocText("FR-Chart-Color_Color")),axisLineColor},
}; };

11
designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java

@ -33,13 +33,9 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane {
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p, p, p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new JSeparator(), null},
new Component[]{createLabelPane(new double[]{p, p, p}, columnSize), null}, new Component[]{createLabelPane(new double[]{p, p, p}, columnSize), null},
new Component[]{new JSeparator(), null},
new Component[]{createMinMaxValuePane(new double[]{p, p, p}, columnSize), null}, new Component[]{createMinMaxValuePane(new double[]{p, p, p}, columnSize), null},
new Component[]{new JSeparator(), null},
new Component[]{createLineStylePane(new double[]{p, p, p, p}, columnSize), null}, new Component[]{createLineStylePane(new double[]{p, p, p, p}, columnSize), null},
new Component[]{new JSeparator(), null},
new Component[]{createValueStylePane(), null}, new Component[]{createValueStylePane(), null},
}; };
@ -61,7 +57,7 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane {
centerPane.add(commenPane, Inter.getLocText("Plugin-ChartF_UnifiedComputing")); centerPane.add(commenPane, Inter.getLocText("Plugin-ChartF_UnifiedComputing"));
centerPane.add(tableDataPane, Inter.getLocText("Plugin-ChartF_RespectivelySpecified")); centerPane.add(tableDataPane, Inter.getLocText("Plugin-ChartF_RespectivelySpecified"));
JPanel contentPane = new JPanel(new BorderLayout(0, 4)); JPanel contentPane = new JPanel(new BorderLayout());
contentPane.add(valueStyle, BorderLayout.NORTH); contentPane.add(valueStyle, BorderLayout.NORTH);
contentPane.add(centerPane, BorderLayout.CENTER); contentPane.add(centerPane, BorderLayout.CENTER);
valueStyle.addActionListener(new ActionListener() { valueStyle.addActionListener(new ActionListener() {
@ -71,11 +67,14 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane {
} }
}); });
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), contentPane); JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), contentPane);
contentPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
return panel;
} }
protected Component[][] getLineStylePaneComponents() { protected Component[][] getLineStylePaneComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{null,null} ,
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_type")), axisLineStyle}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_type")), axisLineStyle},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Color_Color")), axisLineColor}, new Component[]{new UILabel(Inter.getLocText("FR-Chart-Color_Color")), axisLineColor},
}; };

14
designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAreaBackgroundPane.java

@ -6,7 +6,9 @@ import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.AbstractChartTabPane; import com.fr.general.Inter;
import com.fr.plugin.chart.designer.AbstractVanChartScrollPane;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.designer.component.background.VanChartBackgroundPane; import com.fr.plugin.chart.designer.component.background.VanChartBackgroundPane;
import com.fr.plugin.chart.designer.component.border.VanChartBorderWithRadiusPane; import com.fr.plugin.chart.designer.component.border.VanChartBorderWithRadiusPane;
import com.fr.plugin.chart.designer.style.background.radar.VanChartRadarAxisAreaPane; import com.fr.plugin.chart.designer.style.background.radar.VanChartRadarAxisAreaPane;
@ -15,7 +17,7 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
//图表区|绘图区 边框和背景 //图表区|绘图区 边框和背景
public class VanChartAreaBackgroundPane extends AbstractChartTabPane<Chart> { public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart> {
private static final long serialVersionUID = 104381641640066015L; private static final long serialVersionUID = 104381641640066015L;
protected VanChartBorderWithRadiusPane chartBorderPane; protected VanChartBorderWithRadiusPane chartBorderPane;
@ -45,8 +47,8 @@ public class VanChartAreaBackgroundPane extends AbstractChartTabPane<Chart> {
double[] columnSize = { f }; double[] columnSize = { f };
double[] rowSize = {p,p,p}; double[] rowSize = {p,p,p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{chartBorderPane}, new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Border"),chartBorderPane)},
new Component[]{chartBackgroundPane} new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Background"), chartBackgroundPane)},
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
contentPane.add(panel, BorderLayout.CENTER); contentPane.add(panel, BorderLayout.CENTER);
@ -88,8 +90,8 @@ public class VanChartAreaBackgroundPane extends AbstractChartTabPane<Chart> {
protected Component[][] initComponents() { protected Component[][] initComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{chartBorderPane}, new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Border"),chartBorderPane)},
new Component[]{chartBackgroundPane}, new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Background"), chartBackgroundPane)},
new Component[]{chartAxisAreaPane} new Component[]{chartAxisAreaPane}
}; };
} }

20
designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java

@ -15,8 +15,8 @@ import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.attr.DefaultAxisHelper; import com.fr.plugin.chart.attr.DefaultAxisHelper;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue; import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.base.VanChartCustomIntervalBackground;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.base.VanChartCustomIntervalBackground;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.designer.component.VanChartUIMenuNameableCreator; import com.fr.plugin.chart.designer.component.VanChartUIMenuNameableCreator;
@ -53,14 +53,12 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = { f }; double[] columnSize = { f };
double[] rowSize = {p,p,p,p,p}; double[] rowSize = {p,p,p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createGridLinePane(new double[]{p,p}, new double[]{p,f})}, new Component[]{createGridLinePane(new double[]{p,p,p}, new double[]{p,f})},
new Component[]{new JSeparator()},
new Component[]{createAlertLinePane()}, new Component[]{createAlertLinePane()},
new Component[]{new JSeparator()}, new Component[]{createIntervalPane(new double[]{p,p,p,p}, new double[]{p,f})},
new Component[]{createIntervalPane(new double[]{p,p,p}, new double[]{p,f})},
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
@ -71,12 +69,13 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
horizontalGridLine = new ColorSelectBox(100); horizontalGridLine = new ColorSelectBox(100);
verticalGridLine = new ColorSelectBox(100); verticalGridLine = new ColorSelectBox(100);
Component[][] components = getGridLinePaneComponents(); Component[][] components = getGridLinePaneComponents();
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("ChartF-Grid_Line"),panel); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("ChartF-Grid_Line"),panel);
} }
protected Component[][] getGridLinePaneComponents() { protected Component[][] getGridLinePaneComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{null,null},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")),horizontalGridLine}, new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")),horizontalGridLine},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")),verticalGridLine}, new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")),verticalGridLine},
}; };
@ -84,7 +83,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
protected JPanel createAlertLinePane(){ protected JPanel createAlertLinePane(){
alertLine = new UICorrelationComboBoxPane(); alertLine = new UICorrelationComboBoxPane();
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"),alertLine); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"),alertLine);
} }
protected JPanel createIntervalPane(double[] row, double[] col){ protected JPanel createIntervalPane(double[] row, double[] col){
@ -108,11 +107,12 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
JPanel intervalPane = new JPanel(new BorderLayout(0, 6)); JPanel intervalPane = new JPanel(new BorderLayout(0, 6));
intervalPane.add(isDefaultIntervalBackground, BorderLayout.NORTH); intervalPane.add(isDefaultIntervalBackground, BorderLayout.NORTH);
intervalPane.add(centerPane, BorderLayout.CENTER); intervalPane.add(centerPane, BorderLayout.CENTER);
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"),intervalPane); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"),intervalPane);
} }
protected Component[][] getIntervalPaneComponents() { protected Component[][] getIntervalPaneComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{null,null},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")),horizontalColorBackground}, new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")),horizontalColorBackground},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")),verticalColorBackground}, new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")),verticalColorBackground},
}; };

47
designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java

@ -11,6 +11,8 @@ import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection; import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane; import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane;
import com.fr.design.mainframe.chart.gui.style.series.AbstractPlotSeriesPane; import com.fr.design.mainframe.chart.gui.style.series.AbstractPlotSeriesPane;
@ -40,6 +42,7 @@ import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.*;
/** /**
* 图表样式-系列抽象界面 * 图表样式-系列抽象界面
@ -75,13 +78,38 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
super(parent, plot); super(parent, plot);
} }
protected JPanel getContentPane(boolean custom) {
return getContentInPlotType();
}
@Override @Override
/** /**
* 返回 填充界面. * 返回 填充界面.
*/ */
protected ChartFillStylePane getFillStylePane() { protected ChartFillStylePane getFillStylePane() {
//如果是自定義組合圖,則不創建填充界面 //如果是自定義組合圖,則不創建填充界面
return parentPane instanceof VanChartCustomStylePane ? null : new ChartFillStylePane(); return parentPane instanceof VanChartCustomStylePane ? null : new ChartFillStylePane(){
protected JPanel getContentPane () {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("ColorMatch")),styleSelectBox},
new Component[]{null,customPane},
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize);
}
@Override
public Dimension getPreferredSize() {
if(styleSelectBox.getSelectedIndex() != styleSelectBox.getItemCount() - 1) {
return new Dimension(styleSelectBox.getPreferredSize().width, 30);
}
return super.getPreferredSize();
}
};
} }
//风格 //风格
@ -98,13 +126,13 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
//趋势线 //趋势线
protected JPanel createTrendLinePane() { protected JPanel createTrendLinePane() {
trendLinePane = new VanChartTrendLinePane(); trendLinePane = new VanChartTrendLinePane();
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Chart-Trend_Line"), trendLinePane); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Chart-Trend_Line"), trendLinePane);
} }
//线 //线
protected JPanel createLineTypePane() { protected JPanel createLineTypePane() {
lineTypePane = getLineTypePane(); lineTypePane = getLineTypePane();
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Line"), lineTypePane); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Line"), lineTypePane);
} }
protected VanChartLineTypePane getLineTypePane() { protected VanChartLineTypePane getLineTypePane() {
@ -114,19 +142,20 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
//标记点类型 //标记点类型
protected JPanel createMarkerPane() { protected JPanel createMarkerPane() {
markerPane = new VanChartMarkerPane(); markerPane = new VanChartMarkerPane();
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Marker"), markerPane); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Marker"), markerPane);
} }
//填充颜色 //填充颜色
protected JPanel createAreaFillColorPane() { protected JPanel createAreaFillColorPane() {
areaSeriesFillColorPane = new VanChartAreaSeriesFillColorPane(); areaSeriesFillColorPane = new VanChartAreaSeriesFillColorPane();
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_FillColor"), areaSeriesFillColorPane); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_FillColor"), areaSeriesFillColorPane);
} }
//边框(默认没有圆角) //边框(默认没有圆角)
protected VanChartBorderPane createBorderPane() { protected JPanel createBorderPane() {
borderPane = createDiffBorderPane(); borderPane = createDiffBorderPane();
return borderPane; return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Border"), borderPane);
} }
//半径界面 //半径界面
@ -196,7 +225,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
} }
protected JPanel createLargeDataModelPane(UIButtonGroup<DataProcessor> modelGroup) { protected JPanel createLargeDataModelPane(UIButtonGroup<DataProcessor> modelGroup) {
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Large_Model"), modelGroup); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Large_Model"), modelGroup);
} }
protected UIButtonGroup<DataProcessor> createLargeDataModelGroup() { protected UIButtonGroup<DataProcessor> createLargeDataModelGroup() {
@ -217,7 +246,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
//不透明度 //不透明度
protected JPanel createAlphaPane() { protected JPanel createAlphaPane() {
transparent = new UINumberDragPane(0, 100); transparent = new UINumberDragPane(0, 100);
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Alpha"), transparent); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Alpha"), transparent);
} }
//堆积和坐标轴设置(自定义柱形图等用到) //堆积和坐标轴设置(自定义柱形图等用到)

10
designer_chart/src/com/fr/plugin/chart/gauge/VanChartGaugeSeriesPane.java

@ -12,9 +12,9 @@ import com.fr.design.mainframe.chart.gui.style.series.UIColorPickerPane;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.attr.GaugeDetailStyle;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.AttrLabel; import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.attr.GaugeDetailStyle;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.designer.style.series.VanChartAbstractPlotSeriesPane; import com.fr.plugin.chart.designer.style.series.VanChartAbstractPlotSeriesPane;
import com.fr.plugin.chart.pie.RadiusCardLayoutPane; import com.fr.plugin.chart.pie.RadiusCardLayoutPane;
@ -57,9 +57,7 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane {
double[] rowSize = {p,p,p,p,p,p}; double[] rowSize = {p,p,p,p,p,p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createGaugeLayoutPane()}, new Component[]{createGaugeLayoutPane()},
new Component[]{new JSeparator()},
new Component[]{createGaugeStylePane(rowSize, new double[]{p,f})}, new Component[]{createGaugeStylePane(rowSize, new double[]{p,f})},
new Component[]{new JSeparator()},
new Component[]{createGaugeBandsPane()} new Component[]{createGaugeBandsPane()}
}; };
@ -74,7 +72,7 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane {
changeLabelPosition(); changeLabelPosition();
} }
}); });
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("FR-Chart_Layout"), gaugeLayout); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart_Layout"), gaugeLayout);
} }
private void changeLabelPosition() { private void changeLabelPosition() {
@ -106,7 +104,7 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane {
if(rotate != null){ if(rotate != null){
panel.add(rotate, BorderLayout.NORTH); panel.add(rotate, BorderLayout.NORTH);
} }
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), panel); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), panel);
} }
private Component[][] getDiffComponentsWithGaugeStyle() { private Component[][] getDiffComponentsWithGaugeStyle() {
@ -183,7 +181,7 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane {
private JPanel createGaugeBandsPane() { private JPanel createGaugeBandsPane() {
colorPickerPane = new ColorPickerPaneWithFormula("meterString"); colorPickerPane = new ColorPickerPaneWithFormula("meterString");
return TableLayout4VanChartHelper.createTitlePane(Inter.getLocText("Plugin-ChartF_Range"), colorPickerPane, 16); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Range"), colorPickerPane);
} }

7
designer_chart/src/com/fr/plugin/chart/pie/RadiusCardLayoutPane.java

@ -3,15 +3,14 @@ package com.fr.plugin.chart.pie;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.type.RadiusType;
import com.fr.plugin.chart.base.VanChartRadius;
import com.fr.plugin.chart.attr.radius.VanChartRadiusPlot; import com.fr.plugin.chart.attr.radius.VanChartRadiusPlot;
import com.fr.plugin.chart.base.VanChartRadius;
import com.fr.plugin.chart.layout.VanChartCardLayoutPane; import com.fr.plugin.chart.layout.VanChartCardLayoutPane;
import com.fr.plugin.chart.type.RadiusType;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -71,7 +70,7 @@ public class RadiusCardLayoutPane extends BasicBeanPane<Plot> {
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p,p}; double[] rowSize = {p,p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Radius_Set")),radiusType}, new Component[]{radiusType,null},
new Component[]{cardPane, null}, new Component[]{cardPane, null},
}; };

31
designer_chart/src/com/fr/plugin/chart/pie/VanChartPieSeriesPane.java

@ -2,7 +2,7 @@ package com.fr.plugin.chart.pie;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
@ -28,7 +28,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane {
protected UISpinner startAngle; protected UISpinner startAngle;
protected UISpinner endAngle; protected UISpinner endAngle;
protected UISpinner innerRadius; protected UISpinner innerRadius;
private UIToggleButton supportRotation; private UIButtonGroup<Boolean> supportRotation;
public VanChartPieSeriesPane(ChartStylePane parent, Plot plot) { public VanChartPieSeriesPane(ChartStylePane parent, Plot plot) {
super(parent, plot); super(parent, plot);
@ -38,12 +38,15 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {f}; double[] columnSize = {f};
double[] rowSize = {p,p,p,p,p,p,p}; double[] rowSize = {p,p,p,p,p};
JPanel panel = new JPanel(new BorderLayout());
panel.add(getFillStylePane(), BorderLayout.NORTH);
panel.add(createStylePane(), BorderLayout.CENTER);
JPanel ColorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Color"), panel);
panel.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createStylePane()}, new Component[]{ColorPane},
new Component[]{stylePane == null ? null : new JSeparator()},
new Component[]{createSeriesStylePane(rowSize, new double[]{p,f})}, new Component[]{createSeriesStylePane(rowSize, new double[]{p,f})},
new Component[]{new JSeparator()},
new Component[]{createBorderPane()}, new Component[]{createBorderPane()},
}; };
@ -55,19 +58,21 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane {
startAngle = new UISpinner(MIN_ANGLE, MAX_ANGLE, 1, 0); startAngle = new UISpinner(MIN_ANGLE, MAX_ANGLE, 1, 0);
endAngle = new UISpinner(MIN_ANGLE, MAX_ANGLE, 1, 0); endAngle = new UISpinner(MIN_ANGLE, MAX_ANGLE, 1, 0);
innerRadius = new UISpinner(0, 100, 1, 0); innerRadius = new UISpinner(0, 100, 1, 0);
supportRotation = new UIToggleButton(Inter.getLocText("Plugin-ChartF_Rotation")); supportRotation = new UIButtonGroup<Boolean>(new String[]{Inter.getLocText("Plugin-ChartF_On"), Inter.getLocText("Plugin-ChartF_Off")}, new Boolean[]{true, false});
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null,null},
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_StartAngle")),startAngle}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_StartAngle")),startAngle},
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_EndAngle")),endAngle}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_EndAngle")),endAngle},
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_InnerRadius")),innerRadius}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_InnerRadius")),innerRadius},
new Component[]{createRadiusPane(), null}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Radius_Set")), createRadiusPane()},
new Component[]{supportRotation,null} new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Rotation")),supportRotation}
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), panel); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), panel);
} }
//半径界面 //半径界面
@ -93,7 +98,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane {
startAngle.setValue(piePlot4VanChart.getStartAngle()); startAngle.setValue(piePlot4VanChart.getStartAngle());
endAngle.setValue(piePlot4VanChart.getEndAngle()); endAngle.setValue(piePlot4VanChart.getEndAngle());
innerRadius.setValue(piePlot4VanChart.getInnerRadiusPercent()); innerRadius.setValue(piePlot4VanChart.getInnerRadiusPercent());
supportRotation.setSelected(piePlot4VanChart.isSupportRotation()); supportRotation.setSelectedIndex(piePlot4VanChart.isSupportRotation() == true ?0:1);
} }
} }
@ -114,7 +119,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane {
piePlot4VanChart.setStartAngle(startAngle.getValue()); piePlot4VanChart.setStartAngle(startAngle.getValue());
piePlot4VanChart.setEndAngle(endAngle.getValue()); piePlot4VanChart.setEndAngle(endAngle.getValue());
piePlot4VanChart.setInnerRadiusPercent(innerRadius.getValue()); piePlot4VanChart.setInnerRadiusPercent(innerRadius.getValue());
piePlot4VanChart.setSupportRotation(supportRotation.isSelected()); piePlot4VanChart.setSupportRotation(supportRotation.getSelectedItem());
} }
} }
} }
Loading…
Cancel
Save