Browse Source

Pull request #4861: CHART-19708 图表块图表标题背景修改

Merge in DESIGN/design from ~BJORN/design:feature/10.0 to feature/10.0

* commit '5cfb22420c95c3d1ef3e631330b7f72e15d21a6d':
  CHART-19708 图表块图表标题背景修改
feature/10.0
Bjorn 3 years ago
parent
commit
eb81e28f0d
  1. 9
      designer-chart/src/main/java/com/fr/design/chart/gui/ChartWidgetOption.java
  2. 12
      designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java
  3. 13
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  4. 9
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  5. 14
      designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleStylePane.java
  6. 5
      designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomStylePane.java
  7. 26
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java
  8. 25
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java
  9. 48
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java
  10. 13
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java

9
designer-chart/src/main/java/com/fr/design/chart/gui/ChartWidgetOption.java

@ -1,10 +1,12 @@
package com.fr.design.chart.gui; package com.fr.design.chart.gui;
import com.fr.base.chart.BaseChartGetter; import com.fr.base.chart.BaseChartGetter;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.form.ui.ChartEditor; import com.fr.form.ui.ChartEditor;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.vanchart.VanChart;
import javax.swing.Icon; import javax.swing.Icon;
@ -37,7 +39,12 @@ public class ChartWidgetOption extends WidgetOption {
Class<? extends ChartEditor> clz = widgetClass(); Class<? extends ChartEditor> clz = widgetClass();
try { try {
ChartEditor widget = clz.newInstance(); ChartEditor widget = clz.newInstance();
widget.resetChangeChartCollection(BaseChartGetter.createChartCollection(this.chartID)); ChartCollection chartCollection = (ChartCollection) BaseChartGetter.createChartCollection(this.chartID);
VanChart vanChart = chartCollection.getSelectedChartProvider(VanChart.class);
if (vanChart !=null) {
vanChart.resetAttrInForm();
}
widget.resetChangeChartCollection(chartCollection);
return widget; return widget;
} catch (InstantiationException e) { } catch (InstantiationException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);

12
designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java

@ -20,6 +20,7 @@ import com.fr.design.mainframe.chart.gui.ChartOtherPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.ChartTypePane; import com.fr.design.mainframe.chart.gui.ChartTypePane;
import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.form.main.Form;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.vanchart.VanChart; import com.fr.plugin.chart.vanchart.VanChart;
@ -168,6 +169,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange, Prepare
AbstractChartAttrPane[] otherPaneList = ChartTypeInterfaceManager.getInstance().getAttrPaneArray(chartID, listener); AbstractChartAttrPane[] otherPaneList = ChartTypeInterfaceManager.getInstance().getAttrPaneArray(chartID, listener);
for (int i = 0; i < otherPaneList.length; i++) { for (int i = 0; i < otherPaneList.length; i++) {
otherPaneList[i].addAttributeChangeListener(listener); otherPaneList[i].addAttributeChangeListener(listener);
otherPaneList[i].registerChartEditPane(this);
paneList.add(otherPaneList[i]); paneList.add(otherPaneList[i]);
} }
this.isDefaultPane = false; this.isDefaultPane = false;
@ -366,4 +368,14 @@ public class ChartEditPane extends BasicPane implements AttributeChange, Prepare
} }
}); });
} }
public boolean isInForm() {
if (container != null && container.getEPane() != null) {
Object target = container.getEPane().getTarget();
if (target instanceof Form) {
return true;
}
}
return false;
}
} }

13
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -67,6 +67,8 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
registerSupportChangeConfigChartClass(VanChart.class); registerSupportChangeConfigChartClass(VanChart.class);
} }
private boolean inForm;
private UIButton addButton; private UIButton addButton;
private UIButton configButton; private UIButton configButton;
private UIButton copyButton; private UIButton copyButton;
@ -160,10 +162,17 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
addButton.addActionListener((e) -> { addButton.addActionListener((e) -> {
String name = getNewChartName(); String name = getNewChartName();
ChartProvider chart = getChangeStateNewChart(); ChartProvider chart = getChangeStateNewChart();
checkInForm(chart);
addNewChart(chart, name, editingCollection.getChartCount()); addNewChart(chart, name, editingCollection.getChartCount());
}); });
} }
private void checkInForm(ChartProvider chart) {
if (inForm) {
chart.resetAttrInForm();
}
}
private void initConfigButton() { private void initConfigButton() {
configButton.setPreferredSize(new Dimension(20, 20)); configButton.setPreferredSize(new Dimension(20, 20));
configButton.addActionListener((e) -> showConfigDialog()); configButton.addActionListener((e) -> showConfigDialog());
@ -680,4 +689,8 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
currentEditingEditor.requestFocus(); currentEditingEditor.requestFocus();
} }
} }
public void refreshChartInForm(boolean inForm) {
this.inForm = inForm;
}
} }

9
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -47,6 +47,7 @@ public class ChartTypePane extends AbstractChartAttrPane {
private ChartEditPane editPane; private ChartEditPane editPane;
private ChartCollection editingCollection; private ChartCollection editingCollection;
private ActionListener autoButtonListener; private ActionListener autoButtonListener;
private boolean inForm;
@Override @Override
protected JPanel createContentPane() { protected JPanel createContentPane() {
@ -54,6 +55,7 @@ public class ChartTypePane extends AbstractChartAttrPane {
JPanel content = new JPanel(new BorderLayout()); JPanel content = new JPanel(new BorderLayout());
buttonPane = new ChartTypeButtonPane(this); buttonPane = new ChartTypeButtonPane(this);
buttonPane.refreshChartInForm(inForm);
content.add(buttonPane, BorderLayout.NORTH); content.add(buttonPane, BorderLayout.NORTH);
if (editingCollection != null) { if (editingCollection != null) {
@ -180,8 +182,10 @@ public class ChartTypePane extends AbstractChartAttrPane {
} }
//这一步会替换plot //这一步会替换plot
((AbstractChartTypePane) getSelectedPane()).updateBean(chart); ((AbstractChartTypePane) getSelectedPane()).updateBean(chart);
if (inForm) {
reLayoutEditPane(chart,lastPlotID); chart.resetAttrInForm();
}
reLayoutEditPane(chart, lastPlotID);
} }
protected UIComboBox createComboBox() { protected UIComboBox createComboBox() {
@ -405,5 +409,6 @@ public class ChartTypePane extends AbstractChartAttrPane {
*/ */
public void registerChartEditPane(ChartEditPane currentEditPane) { public void registerChartEditPane(ChartEditPane currentEditPane) {
this.editPane = currentEditPane; this.editPane = currentEditPane;
this.inForm = editPane.isInForm();
} }
} }

14
designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleStylePane.java

@ -21,9 +21,9 @@ public class VanChartBubbleStylePane extends VanChartScatterStylePane {
super(listener); super(listener);
} }
protected void addVanChartTooltipPane(List<BasicPane> paneList){ protected void addVanChartTooltipPane(List<BasicPane> paneList) {
Plot plot = getChart().getPlot(); Plot plot = getChart().getPlot();
if(((VanChartBubblePlot) plot).isForceBubble()){ if (((VanChartBubblePlot) plot).isForceBubble()) {
paneList.add(new VanChartForceBubbleTooltipPane(VanChartBubbleStylePane.this)); paneList.add(new VanChartForceBubbleTooltipPane(VanChartBubbleStylePane.this));
} else { } else {
super.addVanChartTooltipPane(paneList); super.addVanChartTooltipPane(paneList);
@ -31,11 +31,11 @@ public class VanChartBubbleStylePane extends VanChartScatterStylePane {
} }
@Override @Override
protected void addVanChartAreaPane(List<BasicPane> paneList) { protected VanChartAreaPane createVanChartAreaPane() {
if (((VanChartBubblePlot)getChart().getPlot()).isForceBubble()){ if (((VanChartBubblePlot) getChart().getPlot()).isForceBubble()) {
paneList.add(new VanChartForceBubbleAreaPane(getChart().getPlot(), VanChartBubbleStylePane.this)); return new VanChartForceBubbleAreaPane(getChart().getPlot(), VanChartBubbleStylePane.this);
}else { } else {
paneList.add(new VanChartAreaPane(getChart().getPlot(), VanChartBubbleStylePane.this)); return new VanChartAreaPane(getChart().getPlot(), VanChartBubbleStylePane.this);
} }
} }

5
designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomStylePane.java

@ -11,6 +11,7 @@ import com.fr.plugin.chart.custom.VanChartCustomPlot;
import com.fr.plugin.chart.custom.type.CustomPlotType; import com.fr.plugin.chart.custom.type.CustomPlotType;
import com.fr.van.chart.designer.component.richText.VanChartRichEditorPane; import com.fr.van.chart.designer.component.richText.VanChartRichEditorPane;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.designer.style.background.VanChartAreaPane;
import java.util.List; import java.util.List;
@ -61,8 +62,8 @@ public class VanChartCustomStylePane extends VanChartStylePane {
@Override @Override
protected void addVanChartAreaPane(List<BasicPane> paneList) { protected VanChartAreaPane createVanChartAreaPane() {
paneList.add(new VanChartCustomAreaPane(getChart().getPlot(), VanChartCustomStylePane.this)); return new VanChartCustomAreaPane(getChart().getPlot(), VanChartCustomStylePane.this);
} }
@Override @Override

26
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java

@ -3,6 +3,7 @@ package com.fr.van.chart.designer.style;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.plugin.chart.attr.plot.VanChartAxisPlot; import com.fr.plugin.chart.attr.plot.VanChartAxisPlot;
import com.fr.van.chart.designer.component.richText.VanChartRichEditorPane; import com.fr.van.chart.designer.component.richText.VanChartRichEditorPane;
@ -19,14 +20,20 @@ public class VanChartStylePane extends ChartStylePane {
private static final long serialVersionUID = 186776958263021761L; private static final long serialVersionUID = 186776958263021761L;
private ChartEditPane chartEditPane;
public VanChartStylePane(AttributeChangeListener listener) { public VanChartStylePane(AttributeChangeListener listener) {
super(listener); super(listener);
} }
protected java.util.List<BasicPane> getPaneList() { protected List<BasicPane> getPaneList() {
java.util.List<BasicPane> paneList = new ArrayList<BasicPane>(); List<BasicPane> paneList = new ArrayList<BasicPane>();
Plot plot = getChart().getPlot(); Plot plot = getChart().getPlot();
paneList.add(createVanChartTitlePane());
boolean inForm = chartEditPane != null ? chartEditPane.isInForm() : false;
VanChartTitlePane vanChartTitlePane = createVanChartTitlePane();
vanChartTitlePane.refreshTooltipLabel(inForm);
paneList.add(vanChartTitlePane);
if (plot.isSupportLegend()) { if (plot.isSupportLegend()) {
paneList.add(new VanChartLegendPane(VanChartStylePane.this)); paneList.add(new VanChartLegendPane(VanChartStylePane.this));
} }
@ -47,7 +54,9 @@ public class VanChartStylePane extends ChartStylePane {
} }
} }
addVanChartAreaPane(paneList); VanChartAreaPane vanChartAreaPane = createVanChartAreaPane();
vanChartAreaPane.refreshTooltipLabel(inForm);
paneList.add(vanChartAreaPane);
addVanChartTooltipPane(paneList); addVanChartTooltipPane(paneList);
@ -61,8 +70,8 @@ public class VanChartStylePane extends ChartStylePane {
protected void addOtherAxisPane(java.util.List<BasicPane> paneList, Plot plot) { protected void addOtherAxisPane(java.util.List<BasicPane> paneList, Plot plot) {
} }
protected void addVanChartAreaPane(List<BasicPane> paneList) { protected VanChartAreaPane createVanChartAreaPane() {
paneList.add(new VanChartAreaPane(getChart().getPlot(), VanChartStylePane.this)); return new VanChartAreaPane(getChart().getPlot(), VanChartStylePane.this);
} }
protected void createVanChartAxisPane(List<BasicPane> paneList, VanChartAxisPlot plot) { protected void createVanChartAxisPane(List<BasicPane> paneList, VanChartAxisPlot plot) {
@ -80,4 +89,9 @@ public class VanChartStylePane extends ChartStylePane {
public void refreshTableFieldNames() { public void refreshTableFieldNames() {
VanChartRichEditorPane.refreshCommonChartFieldNames(getChart()); VanChartRichEditorPane.refreshCommonChartFieldNames(getChart());
} }
public void registerChartEditPane(ChartEditPane currentEditPane) {
this.chartEditPane = currentEditPane;
}
} }

25
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java

@ -13,6 +13,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
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;
@ -36,6 +37,7 @@ import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Point; import java.awt.Point;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -69,6 +71,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private JPanel maxProportionPane; private JPanel maxProportionPane;
//区域显示策略 恢复用注释。取消注释。 //区域显示策略 恢复用注释。取消注释。
//private LimitPane limitPane; //private LimitPane limitPane;
private UILabel tooltipLabel;
protected VanChartStylePane parent; protected VanChartStylePane parent;
@ -88,21 +91,30 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
} }
private void initComponents() { private void initComponents() {
isTitleVisible = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Title_Visible")); isTitleVisible = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Title_Visible"));
titlePane = createTitlePane(); tooltipLabel = new UILabel("<html>" + Toolkit.i18nText("Fine-Design_Chart_Title_Tooltip") + "</html>");
tooltipLabel.setForeground(Color.gray);
tooltipLabel.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10));
tooltipLabel.setVisible(false);
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.add(isTitleVisible, BorderLayout.NORTH);
panel.add(tooltipLabel, BorderLayout.CENTER);
titlePane = createTitlePane();
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}; double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{isTitleVisible}, new Component[]{panel},
new Component[]{titlePane} new Component[]{titlePane}
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel1 = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER); this.add(panel1, BorderLayout.CENTER);
isTitleVisible.addActionListener(new ActionListener() { isTitleVisible.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -370,4 +382,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.TITLE, chart.getBuryingPointTitleConfig()); ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.TITLE, chart.getBuryingPointTitleConfig());
} }
public void refreshTooltipLabel(boolean inForm) {
tooltipLabel.setVisible(inForm);
}
} }

48
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java

@ -3,6 +3,8 @@ package com.fr.van.chart.designer.style.background;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
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;
@ -12,8 +14,10 @@ import com.fr.van.chart.designer.component.background.VanChartBackgroundPane;
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane;
import com.fr.van.chart.designer.style.background.radar.VanChartRadarAxisAreaPane; import com.fr.van.chart.designer.style.background.radar.VanChartRadarAxisAreaPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component; import java.awt.Component;
//图表区|绘图区 边框和背景 //图表区|绘图区 边框和背景
@ -25,12 +29,13 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
private VanChartAxisAreaPane chartAxisAreaPane; private VanChartAxisAreaPane chartAxisAreaPane;
private JPanel contentPane; private JPanel contentPane;
private UILabel tooltipLabel;
private boolean isPlot;//绘图区 private boolean isPlot;//绘图区
private AbstractAttrNoScrollPane parent; private AbstractAttrNoScrollPane parent;
public VanChartAreaBackgroundPane(boolean isPlot, AbstractAttrNoScrollPane parent){ public VanChartAreaBackgroundPane(boolean isPlot, AbstractAttrNoScrollPane parent) {
super(); super();
this.isPlot = isPlot; this.isPlot = isPlot;
this.parent = parent; this.parent = parent;
@ -50,14 +55,22 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
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}; double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"),chartBorderPane)}, new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"), chartBorderPane)},
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), chartBackgroundPane)}, new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_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);
if (!isPlot) {
tooltipLabel = new UILabel("<html>" + Toolkit.i18nText("Fine-Design_Chart_Background_Tooltip") + "</html>");
tooltipLabel.setForeground(Color.gray);
tooltipLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 5, 10));
contentPane.add(tooltipLabel, BorderLayout.NORTH);
tooltipLabel.setVisible(false);
}
return contentPane; return contentPane;
} }
@ -68,11 +81,11 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
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}; double[] rowSize = {p, p, p};
Component[][] components; Component[][] components;
if(plot.isSupportBorder()){//有边框和背景 if (plot.isSupportBorder()) {//有边框和背景
chartAxisAreaPane = initAxisAreaPane(); chartAxisAreaPane = initAxisAreaPane();
@ -85,7 +98,7 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
} }
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
contentPane.add(panel,BorderLayout.CENTER); contentPane.add(panel, BorderLayout.CENTER);
parent.initAllListeners(); parent.initAllListeners();
} }
@ -96,7 +109,7 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
protected Component[][] initComponents() { protected Component[][] initComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"),chartBorderPane)}, new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"), chartBorderPane)},
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), chartBackgroundPane)}, new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), chartBackgroundPane)},
new Component[]{chartAxisAreaPane} new Component[]{chartAxisAreaPane}
}; };
@ -104,10 +117,11 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
/** /**
* 标题 * 标题
*
* @return 标题 * @return 标题
*/ */
public String title4PopupWindow() { public String title4PopupWindow() {
if(isPlot){ if (isPlot) {
return PaneTitleConstants.CHART_STYLE_AREA_PLOT_TITLE; return PaneTitleConstants.CHART_STYLE_AREA_PLOT_TITLE;
} }
return PaneTitleConstants.CHART_STYLE_AREA_AREA_TITLE; return PaneTitleConstants.CHART_STYLE_AREA_AREA_TITLE;
@ -118,11 +132,11 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
if (chart == null) { if (chart == null) {
chart = new Chart(); chart = new Chart();
} }
if(isPlot){ if (isPlot) {
Plot plot = chart.getPlot(); Plot plot = chart.getPlot();
chartBorderPane.update(plot); chartBorderPane.update(plot);
chartBackgroundPane.update(plot); chartBackgroundPane.update(plot);
if(plot.isSupportIntervalBackground() && chartAxisAreaPane != null){ if (plot.isSupportIntervalBackground() && chartAxisAreaPane != null) {
chartAxisAreaPane.updateBean(plot); chartAxisAreaPane.updateBean(plot);
} }
} else { } else {
@ -133,12 +147,12 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
@Override @Override
public void populateBean(Chart chart) { public void populateBean(Chart chart) {
if(chart == null) { if (chart == null) {
return; return;
} }
if(isPlot){ if (isPlot) {
Plot plot = chart.getPlot(); Plot plot = chart.getPlot();
if(plot.isSupportIntervalBackground()){ if (plot.isSupportIntervalBackground()) {
//含有坐标轴相关设置,例如警戒线、网格线、间隔背景 //含有坐标轴相关设置,例如警戒线、网格线、间隔背景
if (chartAxisAreaPane == null) { if (chartAxisAreaPane == null) {
refreshContentPane(plot); refreshContentPane(plot);
@ -157,4 +171,8 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
public Chart updateBean() { public Chart updateBean() {
return null; return null;
} }
public void refreshTooltipLabel(boolean inForm) {
tooltipLabel.setVisible(inForm);
}
} }

13
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java

@ -40,16 +40,17 @@ public class VanChartAreaPane extends ThirdTabPane<VanChart> implements AutoSele
JPanel pane = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0)); JPanel pane = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0));
if (nameArray.length > 1) { if (nameArray.length > 1) {
pane.add(tabPane); pane.add(tabPane);
tabPane.setBorder(BorderFactory.createEmptyBorder(0,5,0,0)); tabPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
this.add(pane, BorderLayout.NORTH); this.add(pane, BorderLayout.NORTH);
} }
} }
centerPane.setBorder(BorderFactory.createEmptyBorder(10,0,0,0)); centerPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
} }
/** /**
* 界面 使用标题 * 界面 使用标题
*
* @return 标题 * @return 标题
*/ */
public String title4PopupWindow() { public String title4PopupWindow() {
@ -66,7 +67,7 @@ public class VanChartAreaPane extends ThirdTabPane<VanChart> implements AutoSele
paneList.add(new NamePane(areaPane.title4PopupWindow(), areaPane)); paneList.add(new NamePane(areaPane.title4PopupWindow(), areaPane));
if(plot.isSupportPlotBackground()) { if (plot.isSupportPlotBackground()) {
paneList.add(new NamePane(plotPane.title4PopupWindow(), plotPane)); paneList.add(new NamePane(plotPane.title4PopupWindow(), plotPane));
} }
return paneList; return paneList;
@ -111,4 +112,10 @@ public class VanChartAreaPane extends ThirdTabPane<VanChart> implements AutoSele
} }
} }
} }
public void refreshTooltipLabel(boolean inForm) {
if (areaPane != null) {
areaPane.refreshTooltipLabel(inForm);
}
}
} }
Loading…
Cancel
Save