Browse Source

CHART-20117 图表主题样式

research/11.0
白岳 3 years ago
parent
commit
7e6eedfd8b
  1. 20
      designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java
  2. 13
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ChartPreStylePreView.java
  3. 8
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java
  4. 28
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java
  5. 3
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/AbstractChartStylePane.java
  6. 3
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java
  7. 85
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartSeriesStylePane.java
  8. 42
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStylePane.java
  9. 49
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleStylePane.java
  10. 53
      designer-base/src/main/java/com/fr/design/style/background/gradient/FixedGradientBarWithPopMenu.java
  11. 45
      designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java
  12. 46
      designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java
  13. 62
      designer-base/src/main/java/com/fr/design/style/color/ColorButton.java
  14. 2
      designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java
  15. 1
      designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java
  16. 4
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java
  17. 40
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithThemeStyle.java
  18. 18
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ColorSelectBoxWithThemeStyle.java
  19. 39
      designer-chart/src/main/java/com/fr/design/module/ChartPreStyleListPane.java
  20. 76
      designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java
  21. 4
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java
  22. 22
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java
  23. 11
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java
  24. 14
      designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithThemeStyle.java
  25. 12
      designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPaneWithPreStyle.java
  26. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/MapRangeLegendPane.java
  27. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  28. 8
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java
  29. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitleWithAutoBackground.java
  30. 38
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java
  31. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java
  32. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java
  33. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java
  34. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java
  35. 36
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java
  36. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanChartDataSheetPane.java
  37. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java
  38. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java
  39. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java
  40. 7
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java
  41. 34
      designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java
  42. 21
      designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java
  43. 42
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java
  44. 12
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java
  45. 4
      designer-realize/src/main/java/com/fr/poly/PolyUtils.java

20
designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java

@ -2,14 +2,18 @@ package com.fr.design.gui.icombobox;
import com.fr.base.ChartColorMatching; import com.fr.base.ChartColorMatching;
import com.fr.base.ChartPreStyleConfig; import com.fr.base.ChartPreStyleConfig;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.settings.chart.ThemedChartSeriesColor;
import com.fr.cert.token.lang.Collections; import com.fr.cert.token.lang.Collections;
import com.fr.chart.base.ChartConstants; import com.fr.chart.base.ChartConstants;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import javax.swing.DefaultComboBoxModel; import javax.swing.DefaultComboBoxModel;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JList; import javax.swing.JList;
import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
@ -65,7 +69,21 @@ public class ColorSchemeComboBox extends UIComboBox {
Iterator names = config.names(); Iterator names = config.names();
if (preDefined) { if (preDefined) {
colorSchemes.put(Toolkit.i18nText("Fine-Design_Chart_Predefined"), null); ColorInfo colorInfo = new ColorInfo();
List<Color> list = new ArrayList<>();
colorInfo.setColors(list);
TemplateTheme templateTheme = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplateTheme();
ThemedChartSeriesColor themedChartSeriesColor = templateTheme.getChartStyle().getThemedChartSeriesColor();
if (themedChartSeriesColor.isCombineColor()) {
colorInfo.setGradient(false);
list.addAll(templateTheme.getColorScheme().getColors());
} else {
colorInfo.setGradient(true);
list.add(themedChartSeriesColor.getBeginColor());
list.add(themedChartSeriesColor.getEndColor());
}
colorSchemes.put(Toolkit.i18nText("Fine-Design_Chart_Follow_Theme"), colorInfo);
} else { } else {
//添加默认的方案和第一个方案 //添加默认的方案和第一个方案
String defaultName = config.getCurrentStyle(); String defaultName = config.getCurrentStyle();

13
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ChartPreStylePreView.java

@ -4,17 +4,14 @@ import com.fr.base.chart.BaseChartCollection;
import com.fr.base.chart.BaseChartPainter; import com.fr.base.chart.BaseChartPainter;
import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.base.chart.result.WebChartIDInfo; import com.fr.base.chart.result.WebChartIDInfo;
import com.fr.chart.base.ChartPreStyleProvider;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.config.predefined.PredefinedStyle; import com.fr.config.predefined.PredefinedStyle;
import com.fr.design.gui.chart.MiddleChartComponent; import com.fr.design.gui.chart.MiddleChartComponent;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.core.PropertyChangeListener; import com.fr.stable.core.PropertyChangeListener;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import java.util.List;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
@ -79,13 +76,13 @@ public class ChartPreStylePreView extends MiddleChartComponent {
} }
public void refresh(PredefinedStyle style) { public void refresh(PredefinedStyle style) {
VanChart vanChart = chartCollection.getSelectedChartProvider(VanChart.class); /*VanChart vanChart = chartCollection.getSelectedChartProvider(VanChart.class);
List<ChartPreStyleProvider> chartPreStyleProviders = vanChart.getChartPreStyleProvider(); List<ChartThemeStyleProvider> chartThemeStyleProviders = vanChart.getChartPreStyleProvider();
for (ChartPreStyleProvider chartPreStyleProvider : chartPreStyleProviders) { for (ChartThemeStyleProvider chartThemeStyleProvider : chartThemeStyleProviders) {
chartPreStyleProvider.updatePreDefinedStyle(style); chartThemeStyleProvider.updateThemeStyle(style);
} }
componentBackground = style.getComponentStyle().getBorderStyle().getBackground(); componentBackground = style.getComponentStyle().getBorderStyle().getBackground();
vanChart.attrChange(); vanChart.attrChange();*/
} }
@Override @Override

8
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java

@ -22,10 +22,10 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.theme.dialog.TemplateThemeProfileDialog; import com.fr.design.mainframe.theme.dialog.TemplateThemeProfileDialog;
import com.fr.design.mainframe.theme.edit.CellStyleListEditPane; import com.fr.design.mainframe.theme.edit.CellStyleListEditPane;
import com.fr.design.mainframe.theme.edit.ChartStyleEditPane; import com.fr.design.mainframe.theme.edit.ChartStyleEditPane;
import com.fr.design.mainframe.theme.ui.BorderUtils;
import com.fr.design.mainframe.theme.edit.ui.ColorListExtendedPane; import com.fr.design.mainframe.theme.edit.ui.ColorListExtendedPane;
import com.fr.design.mainframe.theme.edit.ui.ColorListPane; import com.fr.design.mainframe.theme.edit.ui.ColorListPane;
import com.fr.design.mainframe.theme.edit.ui.LabelUtils; import com.fr.design.mainframe.theme.edit.ui.LabelUtils;
import com.fr.design.mainframe.theme.ui.BorderUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
@ -39,6 +39,7 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import java.util.List;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
@ -51,7 +52,6 @@ import java.awt.event.FocusEvent;
import java.awt.event.WindowAdapter; import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.util.List;
/** /**
* @author Starryi * @author Starryi
@ -267,7 +267,9 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
colorListPane.addColorChangeListener(new ChangeListener() { colorListPane.addColorChangeListener(new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
colorListExtendedPane.populate(colorListPane.update()); List<Color> colors = colorListPane.update();
colorListExtendedPane.populate(colors);
chartStyleSettingPane.populateGradientBar(colors);
} }
}); });

28
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java

@ -3,16 +3,17 @@ package com.fr.design.mainframe.theme.edit;
import com.fr.base.theme.settings.ThemedChartStyle; import com.fr.base.theme.settings.ThemedChartStyle;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.MultiTabPane; import com.fr.design.dialog.MultiTabPane;
import com.fr.design.mainframe.theme.edit.chart.ChartBackgroundStylePane;
import com.fr.design.mainframe.theme.edit.chart.ChartTitleStylePane;
import com.fr.design.mainframe.theme.edit.chart.ChartAxisStylePane; import com.fr.design.mainframe.theme.edit.chart.ChartAxisStylePane;
import com.fr.design.mainframe.theme.edit.chart.ChartDataSheetStylePane; import com.fr.design.mainframe.theme.edit.chart.ChartDataSheetStylePane;
import com.fr.design.mainframe.theme.edit.chart.ChartLabelStylePane; import com.fr.design.mainframe.theme.edit.chart.ChartLabelStylePane;
import com.fr.design.mainframe.theme.edit.chart.ChartLegendStylePane; import com.fr.design.mainframe.theme.edit.chart.ChartLegendStylePane;
import com.fr.design.mainframe.theme.edit.chart.ChartSeriesStylePane;
import com.fr.design.mainframe.theme.edit.chart.ChartTitleAndBackgroundStylePane;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.awt.Color;
/** /**
* @author Bjorn * @author Bjorn
@ -21,12 +22,12 @@ import java.util.List;
*/ */
public class ChartStyleEditPane extends MultiTabPane<ThemedChartStyle> { public class ChartStyleEditPane extends MultiTabPane<ThemedChartStyle> {
private ChartTitleStylePane chartTitleStylePane; private ChartSeriesStylePane chartSeriesStylePane;
private ChartLegendStylePane chartLegendStylePane; private ChartLegendStylePane chartLegendStylePane;
private ChartLabelStylePane chartLabelPane; private ChartLabelStylePane chartLabelPane;
private ChartAxisStylePane chartAxisStylePane; private ChartAxisStylePane chartAxisStylePane;
private ChartDataSheetStylePane chartDataSheetStylePane; private ChartDataSheetStylePane chartDataSheetStylePane;
private ChartBackgroundStylePane chartBackgroundStylePane; private ChartTitleAndBackgroundStylePane chartTitleAndBackgroundStylePane;
public ChartStyleEditPane() { public ChartStyleEditPane() {
} }
@ -39,30 +40,30 @@ public class ChartStyleEditPane extends MultiTabPane<ThemedChartStyle> {
@Override @Override
protected List<BasicPane> initPaneList() { protected List<BasicPane> initPaneList() {
this.chartTitleStylePane = new ChartTitleStylePane(); this.chartSeriesStylePane = new ChartSeriesStylePane();
this.chartLegendStylePane = new ChartLegendStylePane(); this.chartLegendStylePane = new ChartLegendStylePane();
this.chartLabelPane = new ChartLabelStylePane(); this.chartLabelPane = new ChartLabelStylePane();
this.chartAxisStylePane = new ChartAxisStylePane(); this.chartAxisStylePane = new ChartAxisStylePane();
this.chartDataSheetStylePane = new ChartDataSheetStylePane(); this.chartDataSheetStylePane = new ChartDataSheetStylePane();
this.chartBackgroundStylePane = new ChartBackgroundStylePane(); this.chartTitleAndBackgroundStylePane = new ChartTitleAndBackgroundStylePane();
paneList = new ArrayList<>(); paneList = new ArrayList<>();
paneList.add(this.chartTitleStylePane); paneList.add(this.chartSeriesStylePane);
paneList.add(this.chartLegendStylePane); paneList.add(this.chartLegendStylePane);
paneList.add(this.chartLabelPane); paneList.add(this.chartLabelPane);
paneList.add(this.chartAxisStylePane); paneList.add(this.chartAxisStylePane);
paneList.add(this.chartDataSheetStylePane); paneList.add(this.chartDataSheetStylePane);
paneList.add(this.chartBackgroundStylePane); paneList.add(this.chartTitleAndBackgroundStylePane);
return paneList; return paneList;
} }
@Override @Override
public void populateBean(ThemedChartStyle ob) { public void populateBean(ThemedChartStyle ob) {
chartTitleStylePane.populate(ob); chartSeriesStylePane.populate(ob);
chartLegendStylePane.populate(ob); chartLegendStylePane.populate(ob);
chartLabelPane.populate(ob); chartLabelPane.populate(ob);
chartAxisStylePane.populate(ob); chartAxisStylePane.populate(ob);
chartDataSheetStylePane.populate(ob); chartDataSheetStylePane.populate(ob);
chartBackgroundStylePane.populate(ob); chartTitleAndBackgroundStylePane.populate(ob);
} }
@Override @Override
@ -74,15 +75,18 @@ public class ChartStyleEditPane extends MultiTabPane<ThemedChartStyle> {
@Override @Override
public ThemedChartStyle updateBean() { public ThemedChartStyle updateBean() {
ThemedChartStyle chartStyle = new ThemedChartStyle(); ThemedChartStyle chartStyle = new ThemedChartStyle();
chartTitleStylePane.update(chartStyle); chartSeriesStylePane.update(chartStyle);
chartLegendStylePane.update(chartStyle); chartLegendStylePane.update(chartStyle);
chartLabelPane.update(chartStyle); chartLabelPane.update(chartStyle);
chartAxisStylePane.update(chartStyle); chartAxisStylePane.update(chartStyle);
chartDataSheetStylePane.update(chartStyle); chartDataSheetStylePane.update(chartStyle);
chartBackgroundStylePane.update(chartStyle); chartTitleAndBackgroundStylePane.update(chartStyle);
return chartStyle; return chartStyle;
} }
public void populateGradientBar(List<Color> colors) {
chartSeriesStylePane.populateGradientBar(colors);
}
@Override @Override
public boolean accept(Object ob) { public boolean accept(Object ob) {

3
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/AbstractChartStylePane.java

@ -29,9 +29,10 @@ public abstract class AbstractChartStylePane extends BasicPane {
protected void initPane() { protected void initPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
double e1 = 75;
double e = 155; double e = 155;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] columnSize = {p, e}; double[] columnSize = {e1, e};
JPanel gapTableLayoutPane = TableLayoutHelper.createGapTableLayoutPane(getComponent(), getRows(p), columnSize, 20, LayoutConstants.VGAP_LARGE); JPanel gapTableLayoutPane = TableLayoutHelper.createGapTableLayoutPane(getComponent(), getRows(p), columnSize, 20, LayoutConstants.VGAP_LARGE);
gapTableLayoutPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); gapTableLayoutPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
UIScrollPane rightTopPane = new UIScrollPane(gapTableLayoutPane); UIScrollPane rightTopPane = new UIScrollPane(gapTableLayoutPane);

3
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java

@ -74,10 +74,11 @@ public class ChartFontPane extends BasicPane {
} }
protected JPanel getContentPane(JPanel buttonPane) { protected JPanel getContentPane(JPanel buttonPane) {
double e1 = 75;
double e = 155; double e = 155;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rows = {p, p, p}; double[] rows = {p, p, p};
double[] columnSize = {p, e}; double[] columnSize = {e1, e};
UILabel text = new UILabel(getUILabelText(), SwingConstants.LEFT); UILabel text = new UILabel(getUILabelText(), SwingConstants.LEFT);
Component[][] components = { Component[][] components = {
new Component[]{null, null}, new Component[]{null, null},

85
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartSeriesStylePane.java

@ -0,0 +1,85 @@
package com.fr.design.mainframe.theme.edit.chart;
import com.fr.base.theme.settings.ThemedChartStyle;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.style.background.gradient.FixedGradientBarWithPopMenu;
import java.util.List;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2020-09-17
*/
public class ChartSeriesStylePane extends AbstractChartStylePane {
private UIButtonGroup<Integer> colorTypeButton;
private FixedGradientBarWithPopMenu gradientBar;
protected void initComponents() {
colorTypeButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Custom_Color"),
Toolkit.i18nText("Fine-Design_Chart_Legend_Gradual")});
gradientBar = new FixedGradientBarWithPopMenu(4, 130);
initListener();
}
protected Component[][] getComponent() {
return new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Match_Color_Scheme")), colorTypeButton},
new Component[]{null, gradientBar}
};
}
protected double[] getRows(double p) {
return new double[]{p, p, p};
}
private void initListener() {
colorTypeButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkTypeButton();
}
});
}
private void checkTypeButton() {
gradientBar.setVisible(colorTypeButton.getSelectedIndex() == 1);
gradientBar.setPreferredSize(colorTypeButton.getSelectedIndex() == 1 ? new Dimension(0, 60) : new Dimension(0, 0));
}
@Override
protected String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Chart_Series");
}
public void populate(ThemedChartStyle chartStyle) {
if (chartStyle.getThemedChartSeriesColor().isCombineColor()) {
colorTypeButton.setSelectedIndex(0);
} else {
colorTypeButton.setSelectedIndex(1);
gradientBar.updateColor(chartStyle.getThemedChartSeriesColor().getBeginColor(), chartStyle.getThemedChartSeriesColor().getEndColor());
}
checkTypeButton();
}
public void populateGradientBar(List<Color> colors) {
gradientBar.updateColor(colors.get(0), colors.get(1));
this.repaint();
}
public void update(ThemedChartStyle chartStyle) {
chartStyle.getThemedChartSeriesColor().setCombineColor(colorTypeButton.getSelectedIndex() == 0);
chartStyle.getThemedChartSeriesColor().setBeginColor(gradientBar.getSelectColorPointBtnP1().getColorInner());
chartStyle.getThemedChartSeriesColor().setEndColor(gradientBar.getSelectColorPointBtnP2().getColorInner());
}
}

42
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartBackgroundStylePane.java → designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStylePane.java

@ -15,28 +15,38 @@ import com.fr.general.Background;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.util.ArrayList;
import java.util.List;
import java.awt.CardLayout; import java.awt.CardLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
/** /**
* @author Bjorn * @author Bjorn
* @version 10.0 * @version 10.0
* Created by Bjorn on 2020-09-17 * Created by Bjorn on 2020-09-16
*/ */
public class ChartBackgroundStylePane extends AbstractChartStylePane { public class ChartTitleAndBackgroundStylePane extends AbstractChartStylePane {
//字体样式
private ChartFontPane chartFontPane;
private UIComboBox typeComboBox; private UIComboBox typeComboBox;
private List<BackgroundQuickPane> paneList; private List<BackgroundQuickPane> paneList;
private JPanel centerPane; private JPanel centerPane;
//网格线颜色 //网格线颜色
private ColorSelectBox mainGridColor; private ColorSelectBox mainGridColor;
protected void initComponents() { protected void initComponents() {
chartFontPane = new ChartFontPane() {
public String getUILabelText() {
return Toolkit.i18nText("Fine-Design_Chart_Title_Character");
}
};
mainGridColor = new ColorSelectBox(100); mainGridColor = new ColorSelectBox(100);
typeComboBox = new UIComboBox(); typeComboBox = new UIComboBox();
@ -64,8 +74,17 @@ public class ChartBackgroundStylePane extends AbstractChartStylePane {
}); });
} }
private void initList() {
paneList = new ArrayList<>();
paneList.add(new NullBackgroundQuickPane());
paneList.add(new ColorBackgroundQuickPane());
paneList.add(new ImageBackgroundQuickPane(false));
paneList.add(new VanChartGradientPane());
}
protected Component[][] getComponent() { protected Component[][] getComponent() {
return new Component[][]{ return new Component[][]{
new Component[]{chartFontPane, null},
new Component[]{null, null}, new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Area_Background_Color")), typeComboBox}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Area_Background_Color")), typeComboBox},
new Component[]{null, centerPane}, new Component[]{null, centerPane},
@ -74,23 +93,16 @@ public class ChartBackgroundStylePane extends AbstractChartStylePane {
} }
protected double[] getRows(double p) { protected double[] getRows(double p) {
return new double[]{p, p, p, p}; return new double[]{p, p, p, p, p};
}
private void initList() {
paneList = new ArrayList<>();
paneList.add(new NullBackgroundQuickPane());
paneList.add(new ColorBackgroundQuickPane());
paneList.add(new ImageBackgroundQuickPane(false));
paneList.add(new VanChartGradientPane());
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Chart_Background"); return Toolkit.i18nText("Fine-Design_Chart_Title_Background");
} }
public void populate(ThemedChartStyle chartStyle) { public void populate(ThemedChartStyle chartStyle) {
chartFontPane.populate(chartStyle.getTitleFont());
Background background = chartStyle.getChartBackground(); Background background = chartStyle.getChartBackground();
for (int i = 0; i < paneList.size(); i++) { for (int i = 0; i < paneList.size(); i++) {
BackgroundQuickPane pane = paneList.get(i); BackgroundQuickPane pane = paneList.get(i);
@ -103,7 +115,9 @@ public class ChartBackgroundStylePane extends AbstractChartStylePane {
mainGridColor.setSelectObject(chartStyle.getGridMainLineColor()); mainGridColor.setSelectObject(chartStyle.getGridMainLineColor());
} }
public void update(ThemedChartStyle chartStyle) { public void update(ThemedChartStyle chartStyle) {
chartStyle.setTitleFont(chartFontPane.update());
chartStyle.setChartBackground(paneList.get(typeComboBox.getSelectedIndex()).updateBean()); chartStyle.setChartBackground(paneList.get(typeComboBox.getSelectedIndex()).updateBean());
if (chartStyle.getChartBackground() instanceof ImageBackground) { if (chartStyle.getChartBackground() instanceof ImageBackground) {
((ImageBackground) chartStyle.getChartBackground()).setLayout(Constants.IMAGE_EXTEND); ((ImageBackground) chartStyle.getChartBackground()).setLayout(Constants.IMAGE_EXTEND);

49
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleStylePane.java

@ -1,49 +0,0 @@
package com.fr.design.mainframe.theme.edit.chart;
import com.fr.base.theme.settings.ThemedChartStyle;
import com.fr.design.i18n.Toolkit;
import java.awt.Component;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2020-09-16
*/
public class ChartTitleStylePane extends AbstractChartStylePane {
//字体样式
private ChartFontPane chartFontPane;
protected void initComponents() {
chartFontPane = new ChartFontPane() {
public String getUILabelText() {
return Toolkit.i18nText("Fine-Design_Chart_Title_Character");
}
};
}
protected Component[][] getComponent() {
return new Component[][]{
new Component[]{chartFontPane, null}
};
}
protected double[] getRows(double p) {
return new double[]{p};
}
@Override
protected String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Report_Title");
}
public void populate(ThemedChartStyle chartStyle) {
chartFontPane.populate(chartStyle.getTitleFont());
}
public void update(ThemedChartStyle chartStyle) {
chartStyle.setTitleFont(chartFontPane.update());
}
}

53
designer-base/src/main/java/com/fr/design/style/background/gradient/FixedGradientBarWithPopMenu.java

@ -0,0 +1,53 @@
package com.fr.design.style.background.gradient;
import com.fr.base.background.ColorBackground;
import com.fr.design.style.color.NewColorSelectPane;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2021-08-19
*/
public class FixedGradientBarWithPopMenu extends FixedGradientBar {
private NewColorSelectPane colorPane;
public FixedGradientBarWithPopMenu(int minvalue, int maxvalue) {
super(minvalue, maxvalue);
}
protected void clickButton(int select) {
setIndex(select);
showPopupMenu();
}
public JPanel initWindowPane(double preferredWidth) {
// 下拉的时候重新生成面板,刷新最近使用颜色
colorPane = new NewColorSelectPane(false) {
@Override
public void setVisible(boolean b) {
super.setVisible(b);
}
@Override
protected boolean selectRealTime() {
return false;
}
};
colorPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
hidePopupMenu();
setColor(((NewColorSelectPane) e.getSource()).getColor());
getList().get(getIndex()).setColorInner(getColor());
fireDisplayComponent(ColorBackground.getInstance(getColor()));
FixedGradientBarWithPopMenu.this.stateChanged();
}
});
return colorPane;
}
}

45
designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java

@ -5,14 +5,15 @@ import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.style.AbstractPopBox;
import com.fr.design.style.color.ColorCell; import com.fr.design.style.color.ColorCell;
import com.fr.design.style.color.ColorSelectDetailPane; import com.fr.design.style.color.ColorSelectDetailPane;
import com.fr.design.style.color.ColorSelectDialog; import com.fr.design.style.color.ColorSelectDialog;
import com.fr.design.style.color.ColorSelectable; import com.fr.design.style.color.ColorSelectable;
import com.fr.stable.AssistUtils; import com.fr.stable.AssistUtils;
import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.OperatingSystem;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
@ -33,7 +34,7 @@ import java.awt.geom.Point2D;
/** /**
* TODO:面板缩放的功能没有考虑就是尾值过大导致超过界面显示的情况原来的那个实现完全是个BUG要缩放的情况也比较少就干脆以后弄吧 * TODO:面板缩放的功能没有考虑就是尾值过大导致超过界面显示的情况原来的那个实现完全是个BUG要缩放的情况也比较少就干脆以后弄吧
*/ */
public class GradientBar extends JComponent implements UIObserver, ColorSelectable { public class GradientBar extends AbstractPopBox implements UIObserver, ColorSelectable {
/** /**
* *
@ -88,6 +89,22 @@ public class GradientBar extends JComponent implements UIObserver, ColorSelectab
iniListener(); iniListener();
} }
public List<SelectColorPointBtn> getList() {
return list;
}
public void setList(List<SelectColorPointBtn> list) {
this.list = list;
}
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
public void updateColor(Color begin, Color end) { public void updateColor(Color begin, Color end) {
p1.setColorInner(begin); p1.setColorInner(begin);
p2.setColorInner(end); p2.setColorInner(end);
@ -106,6 +123,15 @@ public class GradientBar extends JComponent implements UIObserver, ColorSelectab
} }
if (select >= 0) { if (select >= 0) {
clickButton(select);
}
GradientBar.this.repaint();
}
}
});
}
protected void clickButton(int select) {
ColorSelectDetailPane pane = new ColorSelectDetailPane(Color.WHITE); ColorSelectDetailPane pane = new ColorSelectDetailPane(Color.WHITE);
Color selectColor = list.get(select).getColorInner() == null ? Color.WHITE : list.get(select).getColorInner(); Color selectColor = list.get(select).getColorInner() == null ? Color.WHITE : list.get(select).getColorInner();
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, selectColor, GradientBar.this); ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, selectColor, GradientBar.this);
@ -117,10 +143,9 @@ public class GradientBar extends JComponent implements UIObserver, ColorSelectab
GradientBar.this.repaint(); GradientBar.this.repaint();
} }
} }
GradientBar.this.repaint();
} public JPanel initWindowPane(double preWidth) {
} return null;
});
} }
protected void addMouseDragListener() { protected void addMouseDragListener() {
@ -133,10 +158,10 @@ public class GradientBar extends JComponent implements UIObserver, ColorSelectab
break; break;
} }
} }
if(OperatingSystem.isLinux() && AssistUtils.equals(oldIndex,index)){ if (OperatingSystem.isLinux() && AssistUtils.equals(oldIndex, index)) {
if(Math.abs(p1.getX() - e.getX()) > Math.abs(p2.getX() - e.getX())){ if (Math.abs(p1.getX() - e.getX()) > Math.abs(p2.getX() - e.getX())) {
index = 1; index = 1;
}else{ } else {
index = 0; index = 0;
} }
} }

46
designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java

@ -1,14 +1,14 @@
package com.fr.design.style.color; package com.fr.design.style.color;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.background.ColorBackground; import com.fr.design.DesignerEnvManager;
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.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.VerticalFlowLayout; import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.style.AbstractSelectBox;
import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
@ -76,7 +76,7 @@ public class ColorAdjustPane extends JPanel implements UIObserver {
int size = colorButtons.size(); int size = colorButtons.size();
Color[] colors = new Color[size]; Color[] colors = new Color[size];
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
colors[i] = colorButtons.get(i).getSelectObject(); colors[i] = colorButtons.get(i).getColor();
} }
return colors; return colors;
} }
@ -170,7 +170,7 @@ public class ColorAdjustPane extends JPanel implements UIObserver {
} }
private class AddColorButton extends AbstractSelectBox<Color> { private class AddColorButton extends JComponent implements ColorSelectable {
BufferedImage image = BaseUtils.readImageWithCache("/com/fr/design/images/buttonicon/add.png"); BufferedImage image = BaseUtils.readImageWithCache("/com/fr/design/images/buttonicon/add.png");
@ -196,39 +196,37 @@ public class ColorAdjustPane extends JPanel implements UIObserver {
return new MouseAdapter() { return new MouseAdapter() {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
showPopupMenu(); //打开颜色选择面板
showDialog();
} }
}; };
} }
public JPanel initWindowPane(double preferredWidth) { private void showDialog() {
// 下拉的时候重新生成面板,刷新最近使用颜色 ColorSelectDetailPane pane = new ColorSelectDetailPane(getColor());
NewColorSelectPane colorPane = new NewColorSelectPane(false, !DesignerContext.getDesignerFrame().isServerConfig()) { ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, getColor(), this, true);
Color color = this.getColor();
protected boolean selectRealTime() { if (color != null) {
return false; DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color);
} }
}; }
colorPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) { @Override
hidePopupMenu(); public void setColor(Color color) {
Color color = ((NewColorSelectPane) e.getSource()).getColor(); if (colorButtons.size() < MAX_BUTTON) {
fireDisplayComponent(ColorBackground.getInstance(color));
if(colorButtons.size() < MAX_BUTTON) {
colorButtons.add(createColorButton(color)); colorButtons.add(createColorButton(color));
} }
ColorAdjustPane.this.stateChanged(); ColorAdjustPane.this.stateChanged();
relayout(); relayout();
} }
});
return colorPane;
}
public Color getSelectObject() { @Override
return null; public Color getColor() {
return Color.WHITE;
} }
public void setSelectObject(Color color) { @Override
public void colorSetted(ColorCell colorCell) {
} }
} }

62
designer-base/src/main/java/com/fr/design/style/color/ColorButton.java

@ -1,12 +1,10 @@
package com.fr.design.style.color; package com.fr.design.style.color;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.background.ColorBackground; import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.style.AbstractSelectBox;
import javax.swing.JPanel; import javax.swing.JComponent;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
@ -23,7 +21,7 @@ import java.awt.image.BufferedImage;
* @version 10.0 * @version 10.0
* Created by Bjorn on 2020-03-06 * Created by Bjorn on 2020-03-06
*/ */
public class ColorButton extends AbstractSelectBox<Color> { public class ColorButton extends JComponent implements ColorSelectable {
private static final double DEL_WIDTH = 7; private static final double DEL_WIDTH = 7;
@ -35,8 +33,6 @@ public class ColorButton extends AbstractSelectBox<Color> {
private boolean isMoveOn = false; private boolean isMoveOn = false;
private NewColorSelectPane colorPane;
private boolean lastButton; private boolean lastButton;
private ChangeListener changeListener; private ChangeListener changeListener;
@ -112,32 +108,20 @@ public class ColorButton extends AbstractSelectBox<Color> {
} }
if (e.getX() >= bounds.getWidth() - DEL_WIDTH && e.getY() <= DEL_WIDTH) { if (e.getX() >= bounds.getWidth() - DEL_WIDTH && e.getY() <= DEL_WIDTH) {
deleteButton(); deleteButton();
hidePopupMenu();
return; return;
} }
} }
//打开颜色选择面板 //打开颜色选择面板
showPopupMenu(); showDialog();
} }
public JPanel initWindowPane(double preferredWidth) { private void showDialog() {
// 下拉的时候重新生成面板,刷新最近使用颜色 ColorSelectDetailPane pane = new ColorSelectDetailPane(getColor());
colorPane = new NewColorSelectPane(false, !DesignerContext.getDesignerFrame().isServerConfig()) { ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, getColor(), this, true);
Color color = this.getColor();
@Override if (color != null) {
protected boolean selectRealTime() { DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color);
return false;
}
};
colorPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
hidePopupMenu();
color = ((NewColorSelectPane) e.getSource()).getColor();
fireDisplayComponent(ColorBackground.getInstance(color));
ColorButton.this.stateChanged();
} }
});
return colorPane;
} }
public void stateChanged() { public void stateChanged() {
@ -150,26 +134,18 @@ public class ColorButton extends AbstractSelectBox<Color> {
this.changeListener = changeListener; this.changeListener = changeListener;
} }
@Override
public void setColor(Color color) {
this.color = color;
this.stateChanged();
}
/** @Override
* 获取当前选中的颜色 public Color getColor() {
*
* @return 当前选中的颜色
*/
public Color getSelectObject() {
return this.color; return this.color;
} }
/** @Override
* 设置选中的颜色 public void colorSetted(ColorCell colorCell) {
*
* @param color 颜色
*/
public void setSelectObject(Color color) {
this.color = color;
colorPane.setColor(color);
fireDisplayComponent(ColorBackground.getInstance(color));
} }
} }

2
designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java

@ -3,6 +3,7 @@ package com.fr.design.chart;
import com.fr.base.chart.BaseChartCollection; import com.fr.base.chart.BaseChartCollection;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.chart.MiddleChartDialog; import com.fr.design.gui.chart.MiddleChartDialog;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
@ -110,6 +111,7 @@ public class ChartDialog extends MiddleChartDialog {
if (cc == null) { if (cc == null) {
return; return;
} }
cc.setThemeStyle(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplateTheme());
this.cc = cc; this.cc = cc;
} }

1
designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java

@ -146,7 +146,6 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
return; return;
} }
chartCollection4Design.setPredefinedStyleName(getGlobalPredefinedStyleName(), false);
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
if (this.isOpaque()) { if (this.isOpaque()) {

4
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java

@ -7,6 +7,7 @@ import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chart.web.ChartHyperPoplink; import com.fr.chart.web.ChartHyperPoplink;
import com.fr.chartx.attr.ChartProvider; import com.fr.chartx.attr.ChartProvider;
import com.fr.design.chart.gui.ChartComponent; import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.hyperlink.AbstractHyperLinkPane; import com.fr.design.hyperlink.AbstractHyperLinkPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -14,9 +15,9 @@ import com.fr.design.mainframe.chart.ChartHyperEditPane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import java.util.HashMap;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension; import java.awt.Dimension;
import java.util.HashMap;
/** /**
* 类说明: 图表超链 -- 弹出 悬浮窗. * 类说明: 图表超链 -- 弹出 悬浮窗.
@ -64,6 +65,7 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane<ChartHyperPopli
private ChartCollection createChartCollection() { private ChartCollection createChartCollection() {
ChartCollection cc = new ChartCollection(); ChartCollection cc = new ChartCollection();
cc.setThemeStyle(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplateTheme());
ChartProvider chart = ChartTypeManager.getInstanceWithCheck().getFirstChart(); ChartProvider chart = ChartTypeManager.getInstanceWithCheck().getFirstChart();
if (chart != null) { if (chart != null) {

40
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithPreStyle.java → designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithThemeStyle.java

@ -7,10 +7,11 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -19,7 +20,7 @@ import java.awt.event.ActionListener;
* @version 10.0 * @version 10.0
* Created by Bjorn on 2020-09-03 * Created by Bjorn on 2020-09-03
*/ */
public class ChartTextAttrPaneWithPreStyle extends ChartTextAttrPane { public class ChartTextAttrPaneWithThemeStyle extends ChartTextAttrPane {
private static final int PREDEFINED_STYLE = 0; private static final int PREDEFINED_STYLE = 0;
private static final int CUSTOM = 1; private static final int CUSTOM = 1;
@ -27,27 +28,26 @@ public class ChartTextAttrPaneWithPreStyle extends ChartTextAttrPane {
private UIButtonGroup<Integer> preButton; private UIButtonGroup<Integer> preButton;
private JPanel textFontPane; private JPanel textFontPane;
public ChartTextAttrPaneWithPreStyle() { public ChartTextAttrPaneWithThemeStyle() {
initListener(); initListener();
} }
protected JPanel getContentPane(JPanel buttonPane) { protected JPanel getContentPane(JPanel buttonPane) {
preButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Predefined"), JPanel panel = new JPanel(new BorderLayout(0, 10));
preButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Follow_Theme"),
Toolkit.i18nText("Fine-Design_Chart_Custom")}); Toolkit.i18nText("Fine-Design_Chart_Custom")});
double f = TableLayout.FILL; double f = TableLayout.FILL;
double e = getEdithAreaWidth(); double e = getEdithAreaWidth();
double[] columnSize = {f, e};
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
textFontPane = TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), getRowSize(), columnSize); double[] columnSize = {f, e};
double[] rowSize = {p, p, p};
UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT);
Component[][] components = { JPanel preButtonPane = TableLayout4VanChartHelper.createGapTableLayoutPane(new Component[][]{new Component[]{text, preButton}}, new double[]{p}, columnSize);
new Component[]{null, null}, textFontPane = TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), getRowSize(), columnSize);
new Component[]{text, preButton}, panel.add(preButtonPane, BorderLayout.CENTER);
new Component[]{textFontPane, null}, panel.add(textFontPane, BorderLayout.SOUTH);
}; panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); return panel;
} }
protected double getEdithAreaWidth() { protected double getEdithAreaWidth() {
@ -72,11 +72,15 @@ public class ChartTextAttrPaneWithPreStyle extends ChartTextAttrPane {
private void checkPreButton() { private void checkPreButton() {
textFontPane.setVisible(preButton.getSelectedIndex() == CUSTOM); textFontPane.setVisible(preButton.getSelectedIndex() == CUSTOM);
textFontPane.setPreferredSize(preButton.getSelectedIndex() == CUSTOM ? new Dimension(0, 60) : new Dimension(0, 0)); }
protected double[] getRowSize() {
double p = TableLayout.PREFERRED;
return new double[]{p, p};
} }
public void populate(TextAttr textAttr) { public void populate(TextAttr textAttr) {
if (textAttr.isPredefinedStyle()) { if (textAttr.isThemed()) {
preButton.setSelectedIndex(PREDEFINED_STYLE); preButton.setSelectedIndex(PREDEFINED_STYLE);
} else { } else {
preButton.setSelectedIndex(CUSTOM); preButton.setSelectedIndex(CUSTOM);
@ -88,9 +92,9 @@ public class ChartTextAttrPaneWithPreStyle extends ChartTextAttrPane {
public void update(TextAttr textAttr) { public void update(TextAttr textAttr) {
int selectedIndex = preButton.getSelectedIndex(); int selectedIndex = preButton.getSelectedIndex();
if (selectedIndex == PREDEFINED_STYLE) { if (selectedIndex == PREDEFINED_STYLE) {
textAttr.setPredefinedStyle(true); textAttr.setThemed(true);
} else { } else {
textAttr.setPredefinedStyle(false); textAttr.setThemed(false);
} }
super.update(textAttr); super.update(textAttr);
} }

18
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ColorSelectBoxWithPreStyle.java → designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ColorSelectBoxWithThemeStyle.java

@ -1,6 +1,6 @@
package com.fr.design.mainframe.chart.gui.style; package com.fr.design.mainframe.chart.gui.style;
import com.fr.chart.base.ColorWithPreStyle; import com.fr.chart.base.ColorWithThemeStyle;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
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.gui.ilable.UILabel;
@ -22,7 +22,7 @@ import java.awt.event.ActionListener;
* @version 10.0 * @version 10.0
* Created by Bjorn on 2020-09-07 * Created by Bjorn on 2020-09-07
*/ */
public class ColorSelectBoxWithPreStyle extends BasicPane { public class ColorSelectBoxWithThemeStyle extends BasicPane {
private static final int PREDEFINED_STYLE = 0; private static final int PREDEFINED_STYLE = 0;
private static final int CUSTOM = 1; private static final int CUSTOM = 1;
@ -30,8 +30,8 @@ public class ColorSelectBoxWithPreStyle extends BasicPane {
private UIButtonGroup<Integer> preButton; private UIButtonGroup<Integer> preButton;
private ColorSelectBox colorSelectBox; private ColorSelectBox colorSelectBox;
public ColorSelectBoxWithPreStyle(int preferredWidth) { public ColorSelectBoxWithThemeStyle(int preferredWidth) {
preButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Predefined"), preButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Follow_Theme"),
Toolkit.i18nText("Fine-Design_Chart_Custom")}); Toolkit.i18nText("Fine-Design_Chart_Custom")});
colorSelectBox = new ColorSelectBox(preferredWidth); colorSelectBox = new ColorSelectBox(preferredWidth);
initContent(); initContent();
@ -73,15 +73,15 @@ public class ColorSelectBoxWithPreStyle extends BasicPane {
return null; return null;
} }
public void populate(ColorWithPreStyle colorWithPreStyle) { public void populate(ColorWithThemeStyle colorWithPreStyle) {
preButton.setSelectedIndex(colorWithPreStyle.isPredefinedStyle() ? PREDEFINED_STYLE : CUSTOM); preButton.setSelectedIndex(colorWithPreStyle.isThemed() ? PREDEFINED_STYLE : CUSTOM);
colorSelectBox.setSelectObject(colorWithPreStyle.getColor()); colorSelectBox.setSelectObject(colorWithPreStyle.getColor());
checkPreButton(); checkPreButton();
} }
public ColorWithPreStyle update() { public ColorWithThemeStyle update() {
ColorWithPreStyle colorWithPreStyle = new ColorWithPreStyle(); ColorWithThemeStyle colorWithPreStyle = new ColorWithThemeStyle();
colorWithPreStyle.setPredefinedStyle(preButton.getSelectedIndex() == PREDEFINED_STYLE); colorWithPreStyle.setThemed(preButton.getSelectedIndex() == PREDEFINED_STYLE);
colorWithPreStyle.setColor(colorSelectBox.getSelectObject()); colorWithPreStyle.setColor(colorSelectBox.getSelectObject());
return colorWithPreStyle; return colorWithPreStyle;
} }

39
designer-chart/src/main/java/com/fr/design/module/ChartPreStyleListPane.java

@ -8,13 +8,10 @@ import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ShortCut4JControlPane; import com.fr.design.gui.controlpane.ShortCut4JControlPane;
import com.fr.design.gui.ilist.ModNameActionListener;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
@ -25,14 +22,6 @@ import java.util.Iterator;
*/ */
public class ChartPreStyleListPane extends JListControlPane { public class ChartPreStyleListPane extends JListControlPane {
ChartPreStyleManagerPane chartPreStyleManagerPane;
public ChartPreStyleListPane(ChartPreStyleManagerPane chartPreStyleManagerPane) {
super();
this.chartPreStyleManagerPane = chartPreStyleManagerPane;
initListener();
}
/** /**
* 创建有名字的creator * 创建有名字的creator
* *
@ -53,13 +42,7 @@ public class ChartPreStyleListPane extends JListControlPane {
@Override @Override
public BasicBeanPane createPaneByCreators(NameableCreator creator) { public BasicBeanPane createPaneByCreators(NameableCreator creator) {
return new ChartPreStylePane() { return new ChartPreStylePane();
@Override
protected void refreshWhenStyleChange(ChartColorMatching preStyle) {
super.refreshWhenStyleChange(preStyle);
chartPreStyleManagerPane.refreshDefaultColorBox();
}
};
} }
@ -82,21 +65,6 @@ public class ChartPreStyleListPane extends JListControlPane {
return shortCut4JControlPane; return shortCut4JControlPane;
} }
public void initListener() {
nameableList.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
chartPreStyleManagerPane.refreshDefaultColorBox();
}
});
nameableList.addModNameActionListener(new ModNameActionListener() {
@Override
public void nameModed(int index, String oldName, String newName) {
chartPreStyleManagerPane.refreshDefaultColorBox(oldName, newName);
}
});
}
public void populateBean() { public void populateBean() {
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance().mirror(); ChartPreStyleConfig config = ChartPreStyleConfig.getInstance().mirror();
ArrayList list = new ArrayList(); ArrayList list = new ArrayList();
@ -111,15 +79,10 @@ public class ChartPreStyleListPane extends JListControlPane {
Nameable[] values = (Nameable[]) list.toArray(new Nameable[list.size()]); Nameable[] values = (Nameable[]) list.toArray(new Nameable[list.size()]);
populate(values); populate(values);
if (config.containsName(config.getCurrentStyle())) {
this.setSelectedName(config.getCurrentStyle());
}
} }
public void updateBean() { public void updateBean() {
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
Nameable[] values = update(); Nameable[] values = update();
config.clearAllPreStyle(); config.clearAllPreStyle();

76
designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java

@ -1,24 +1,10 @@
package com.fr.design.module; package com.fr.design.module;
import com.fr.base.ChartColorMatching;
import com.fr.base.ChartPreStyleConfig;
import com.fr.design.gui.icombobox.ColorSchemeComboBox;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils;
import com.fr.general.NameObject;
import com.fr.stable.Nameable;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension;
/** /**
* 图表预定义管理 界面, 在工具栏-服务器管理中. * 图表预定义管理 界面, 在工具栏-服务器管理中.
@ -28,8 +14,6 @@ import java.awt.Dimension;
*/ */
public class ChartPreStyleManagerPane extends BasicPane { public class ChartPreStyleManagerPane extends BasicPane {
private ColorSchemeComboBox defaultColorBox;
private ChartPreStyleListPane chartPreStyleListPane; private ChartPreStyleListPane chartPreStyleListPane;
public ChartPreStyleManagerPane() { public ChartPreStyleManagerPane() {
@ -38,78 +22,20 @@ public class ChartPreStyleManagerPane extends BasicPane {
private void initComponent() { private void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel colorBoxPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); chartPreStyleListPane = new ChartPreStyleListPane();
chartPreStyleListPane = new ChartPreStyleListPane(this);
initDefaultColorBox();
colorBoxPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Match_Default_Color_Scheme") + ":"));
colorBoxPane.add(defaultColorBox);
this.add(colorBoxPane, BorderLayout.NORTH);
this.add(chartPreStyleListPane, BorderLayout.CENTER); this.add(chartPreStyleListPane, BorderLayout.CENTER);
} }
private void initDefaultColorBox() {
Map<String, ColorSchemeComboBox.ColorInfo> colorSchemes = new LinkedHashMap<>();
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
Iterator names = config.names();
while (names.hasNext()) {
Object key = names.next();
ColorSchemeComboBox.ColorInfo colorInfo = new ColorSchemeComboBox.ColorInfo();
ChartColorMatching colorMatching = (ChartColorMatching) config.getPreStyle(key);
colorInfo.setGradient(colorMatching.getGradient());
colorInfo.setColors(colorMatching.getColorList());
colorSchemes.put(colorMatching.getId(), colorInfo);
}
defaultColorBox = new ColorSchemeComboBox(colorSchemes);
defaultColorBox.setPreferredSize(new Dimension(TableLayout4VanChartHelper.EDIT_AREA_WIDTH, 20));
}
private void refreshColorSchemes() {
Nameable[] nameables = chartPreStyleListPane.update();
Map<String, ColorSchemeComboBox.ColorInfo> colorSchemes = new LinkedHashMap<>();
for (Nameable value : nameables) {
String name = value.getName();
ChartColorMatching colorMatching = (ChartColorMatching) ((NameObject) value).getObject();
ColorSchemeComboBox.ColorInfo colorInfo = new ColorSchemeComboBox.ColorInfo();
colorInfo.setGradient(colorMatching.getGradient());
colorInfo.setColors(colorMatching.getColorList());
colorSchemes.put(name, colorInfo);
}
defaultColorBox.refresh(colorSchemes);
}
public void refreshDefaultColorBox() {
Object selectedItem = defaultColorBox.getSelectedItem();
refreshColorSchemes();
defaultColorBox.setSelectedItem(selectedItem);
}
public void refreshDefaultColorBox(String oldName, String newName) {
Object selectedItem = defaultColorBox.getSelectedItem();
if (ComparatorUtils.equals(selectedItem, oldName)) {
selectedItem = newName;
}
refreshColorSchemes();
defaultColorBox.setSelectedItem(selectedItem);
}
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Report_ServerM_Predefined_Styles"); return Toolkit.i18nText("Fine-Design_Report_ServerM_Predefined_Styles");
} }
public void populateBean() { public void populateBean() {
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
String currentStyle = config.getCurrentStyle();
defaultColorBox.setSelectedItem(currentStyle);
chartPreStyleListPane.populateBean(); chartPreStyleListPane.populateBean();
} }
public void updateBean() { public void updateBean() {
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
config.setCurrentStyle(GeneralUtils.objectToString(defaultColorBox.getSelectedItem()));
chartPreStyleListPane.updateBean(); chartPreStyleListPane.updateBean();
} }
} }

4
designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java

@ -71,9 +71,7 @@ public class VanChartColumnSeriesPane extends VanChartAbstractPlotSeriesPane {
//边框(有圆角) //边框(有圆角)
protected VanChartBorderPane createDiffBorderPane() { protected VanChartBorderPane createDiffBorderPane() {
return new VanChartBorderWithRadiusPane(); return new VanChartBorderWithRadiusPane(true);
//TODO Bjorn 边框自动回退
//return new VanChartBorderWithRadiusPane(true);
} }
private JPanel createSeriesStylePane(double[] row, double[] col) { private JPanel createSeriesStylePane(double[] row, double[] col) {

22
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java

@ -26,16 +26,8 @@ public class VanChartFillStylePane extends ColorFillStylePane implements Designe
DesignerContext.setDesignerBean(name, this); DesignerContext.setDesignerBean(name, this);
} }
protected void styleSelectBoxChange() {
//TODO Bjorn 配色预定义回退
//getCustomPane().setVisible(getStyleSelectBox().getSelectedIndex() != 0);
super.styleSelectBoxChange();
}
protected ColorSchemeComboBox createColorSchemeComboBox() { protected ColorSchemeComboBox createColorSchemeComboBox() {
return new ColorSchemeComboBox(); return new ColorSchemeComboBox(null, true);
//TODO Bjorn 配色预定义回退
//return new ColorSchemeComboBox(null, true);
} }
protected void initLayout() { protected void initLayout() {
@ -63,21 +55,19 @@ public class VanChartFillStylePane extends ColorFillStylePane implements Designe
} }
public void populateBean(AttrFillStyle condition) { public void populateBean(AttrFillStyle condition) {
/* if (condition.isPredefinedStyle()) { if (condition.isThemed()) {
getStyleSelectBox().setSelectType(ColorSchemeComboBox.SelectType.DEFAULT); getStyleSelectBox().setSelectType(ColorSchemeComboBox.SelectType.DEFAULT);
return; return;
}*/ }
//TODO Bjorn 配色预定义回退
populateBean(condition.getColorFillStyle()); populateBean(condition.getColorFillStyle());
} }
public void updateBean(AttrFillStyle attrFillStyle) { public void updateBean(AttrFillStyle attrFillStyle) {
/* if (getStyleSelectBox().getSelectedIndex() == 0) { if (getStyleSelectBox().getSelectedIndex() == 0) {
attrFillStyle.setPredefinedStyle(true); attrFillStyle.setThemed(true);
return; return;
} }
attrFillStyle.setPredefinedStyle(false);*/ attrFillStyle.setThemed(false);
//TODO Bjorn 配色预定义回退
attrFillStyle.setColorFillStyle(updateBean()); attrFillStyle.setColorFillStyle(updateBean());
} }

11
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java

@ -1,10 +1,12 @@
package com.fr.van.chart.designer.component; package com.fr.van.chart.designer.component;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.type.TextAlign; import com.fr.plugin.chart.type.TextAlign;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout;
public class VanChartLabelContentPane extends VanChartTooltipContentPane { public class VanChartLabelContentPane extends VanChartTooltipContentPane {
@ -22,12 +24,11 @@ public class VanChartLabelContentPane extends VanChartTooltipContentPane {
return new AttrTooltipContent(TextAlign.CENTER); return new AttrTooltipContent(TextAlign.CENTER);
} }
//TODO Bjorn 标签面板回退 public JPanel createCommonStylePane() {
/* public JPanel createCommonStylePane() {
if (isInCondition()) { if (isInCondition()) {
return super.createCommonStylePane(); return super.createCommonStylePane();
} }
setTextAttrPane(new ChartTextAttrPaneWithPreStyle()); setTextAttrPane(new ChartTextAttrPaneWithThemeStyle());
JPanel stylePanel = new JPanel(new BorderLayout()); JPanel stylePanel = new JPanel(new BorderLayout());
stylePanel.add(getTextAttrPane(), BorderLayout.CENTER); stylePanel.add(getTextAttrPane(), BorderLayout.CENTER);
@ -42,9 +43,9 @@ public class VanChartLabelContentPane extends VanChartTooltipContentPane {
} }
if (hasTextStylePane()) { if (hasTextStylePane()) {
this.getTextAttrPane().update(attrTooltipContent.getTextAttr()); this.getTextAttrPane().update(attrTooltipContent.getTextAttr());
if (!attrTooltipContent.getTextAttr().isPredefinedStyle()) { if (!attrTooltipContent.getTextAttr().isThemed()) {
attrTooltipContent.setCustom(true); attrTooltipContent.setCustom(true);
} }
} }
}*/ }
} }

14
designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithPreStyle.java → designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithThemeStyle.java

@ -1,6 +1,6 @@
package com.fr.van.chart.designer.component.background; package com.fr.van.chart.designer.component.background;
import com.fr.chart.base.BackgroundWithPreStyle; import com.fr.chart.base.BackgroundWithThemeStyle;
import com.fr.chart.chartglyph.GeneralInfo; import com.fr.chart.chartglyph.GeneralInfo;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane;
@ -13,7 +13,7 @@ import com.fr.design.mainframe.backgroundpane.VanChartGradientPane;
* @version 10.0 * @version 10.0
* Created by Bjorn on 2020-09-08 * Created by Bjorn on 2020-09-08
*/ */
public class VanChartBackgroundPaneWithPreStyle extends VanChartBackgroundPane { public class VanChartBackgroundPaneWithThemeStyle extends VanChartBackgroundPane {
private static final int PREDEFINED_STYLE = 0; private static final int PREDEFINED_STYLE = 0;
@ -21,7 +21,7 @@ public class VanChartBackgroundPaneWithPreStyle extends VanChartBackgroundPane {
protected void initList() { protected void initList() {
paneList.add(new NullBackgroundQuickPane() { paneList.add(new NullBackgroundQuickPane() {
public String title4PopupWindow() { public String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Chart_Predefined"); return Toolkit.i18nText("Fine-Design_Chart_Follow_Theme");
} }
}); });
paneList.add(new NullBackgroundQuickPane()); paneList.add(new NullBackgroundQuickPane());
@ -31,8 +31,8 @@ public class VanChartBackgroundPaneWithPreStyle extends VanChartBackgroundPane {
} }
public void populateBackground(GeneralInfo attr, int begin) { public void populateBackground(GeneralInfo attr, int begin) {
BackgroundWithPreStyle backgroundWithPreStyle = attr.getBackgroundWithPreStyle(); BackgroundWithThemeStyle backgroundWithPreStyle = attr.getBackgroundWithPreStyle();
if (backgroundWithPreStyle.isPredefinedStyle()) { if (backgroundWithPreStyle.isThemed()) {
typeComboBox.setSelectedIndex(PREDEFINED_STYLE); typeComboBox.setSelectedIndex(PREDEFINED_STYLE);
return; return;
} }
@ -41,10 +41,10 @@ public class VanChartBackgroundPaneWithPreStyle extends VanChartBackgroundPane {
public void updateBackground(GeneralInfo attr) { public void updateBackground(GeneralInfo attr) {
if (typeComboBox.getSelectedIndex() == PREDEFINED_STYLE) { if (typeComboBox.getSelectedIndex() == PREDEFINED_STYLE) {
attr.getBackgroundWithPreStyle().setPredefinedStyle(true); attr.getBackgroundWithPreStyle().setThemed(true);
return; return;
} }
attr.getBackgroundWithPreStyle().setPredefinedStyle(false); attr.getBackgroundWithPreStyle().setThemed(false);
super.updateBackground(attr); super.updateBackground(attr);
} }

12
designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPaneWithPreStyle.java

@ -4,7 +4,7 @@ import com.fr.chart.chartglyph.GeneralInfo;
import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.style.ColorSelectBoxWithPreStyle; import com.fr.design.mainframe.chart.gui.style.ColorSelectBoxWithThemeStyle;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
@ -18,7 +18,7 @@ import java.awt.Component;
*/ */
public class VanChartBorderPaneWithPreStyle extends VanChartBorderPane { public class VanChartBorderPaneWithPreStyle extends VanChartBorderPane {
private ColorSelectBoxWithPreStyle colorSelectBoxWithPreStyle; private ColorSelectBoxWithThemeStyle colorSelectBoxWithThemeStyle;
public VanChartBorderPaneWithPreStyle() { public VanChartBorderPaneWithPreStyle() {
super(); super();
@ -26,7 +26,7 @@ public class VanChartBorderPaneWithPreStyle extends VanChartBorderPane {
protected void initComponents() { protected void initComponents() {
currentLineCombo = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); currentLineCombo = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
colorSelectBoxWithPreStyle = new ColorSelectBoxWithPreStyle(100); colorSelectBoxWithThemeStyle = new ColorSelectBoxWithThemeStyle(100);
} }
protected Component[][] getUseComponent() { protected Component[][] getUseComponent() {
@ -35,7 +35,7 @@ public class VanChartBorderPaneWithPreStyle extends VanChartBorderPane {
return new Component[][]{ return new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{lineStyleLabel, UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo)}, new Component[]{lineStyleLabel, UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo)},
new Component[]{colorSelectBoxWithPreStyle, null}, new Component[]{colorSelectBoxWithThemeStyle, null},
}; };
} }
@ -44,7 +44,7 @@ public class VanChartBorderPaneWithPreStyle extends VanChartBorderPane {
if (attr == null) { if (attr == null) {
return; return;
} }
colorSelectBoxWithPreStyle.populate(attr.getColorWithPreStyle()); colorSelectBoxWithThemeStyle.populate(attr.getColorWithPreStyle());
} }
public void update(GeneralInfo attr) { public void update(GeneralInfo attr) {
@ -52,6 +52,6 @@ public class VanChartBorderPaneWithPreStyle extends VanChartBorderPane {
if (attr == null) { if (attr == null) {
attr = new GeneralInfo(); attr = new GeneralInfo();
} }
attr.setColorWithPreStyle(colorSelectBoxWithPreStyle.update()); attr.setColorWithPreStyle(colorSelectBoxWithThemeStyle.update());
} }
} }

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/MapRangeLegendPane.java

@ -20,8 +20,6 @@ public class MapRangeLegendPane extends VanChartRangeLegendPane {
@Override @Override
protected VanChartBackgroundPane creatBackgroundPane() { protected VanChartBackgroundPane creatBackgroundPane() {
//TODO Bjorn 地图图例背景自动逻辑 return new VanChartBackgroundWithOutImagePane(true);
return new VanChartBackgroundWithOutImagePane();
//return new VanChartBackgroundWithOutImagePane(true);
} }
} }

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

@ -15,6 +15,7 @@ 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.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartLegend; import com.fr.plugin.chart.attr.VanChartLegend;
import com.fr.plugin.chart.type.LayoutType; import com.fr.plugin.chart.type.LayoutType;
@ -287,9 +288,7 @@ public class VanChartPlotLegendPane extends BasicPane {
} }
private JPanel createTitleStylePane() { private JPanel createTitleStylePane() {
//TODO Bjorn 图例预定义逻辑 textAttrPane = new ChartTextAttrPaneWithThemeStyle();
//textAttrPane = new ChartTextAttrPaneWithPreStyle();
textAttrPane = new ChartTextAttrPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane);
} }

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

@ -17,7 +17,7 @@ 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;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartTitle; import com.fr.plugin.chart.attr.VanChartTitle;
@ -57,7 +57,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private JPanel titlePane; private JPanel titlePane;
private TinyFormulaPane titleContent; private TinyFormulaPane titleContent;
private ChartTextAttrPane textAttrPane; private ChartTextAttrPaneWithThemeStyle textAttrPane;
private UIButtonGroup<Integer> alignmentPane; private UIButtonGroup<Integer> alignmentPane;
private VanChartBackgroundWithOutShadowWithRadiusPane backgroundPane; private VanChartBackgroundWithOutShadowWithRadiusPane backgroundPane;
private UIToggleButton useHtml; private UIToggleButton useHtml;
@ -188,9 +188,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
} }
private JPanel createTitleStylePane() { private JPanel createTitleStylePane() {
//TODO Bjorn 标题预定义逻辑 textAttrPane = new ChartTextAttrPaneWithThemeStyle();
//textAttrPane = new ChartTextAttrPaneWithPreStyle();
textAttrPane = new ChartTextAttrPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane);
} }

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitleWithAutoBackground.java

@ -14,8 +14,6 @@ public class VanChartTitleWithAutoBackground extends VanChartTitlePane {
} }
protected VanChartBackgroundWithOutShadowWithRadiusPane createBackgroundPane() { protected VanChartBackgroundWithOutShadowWithRadiusPane createBackgroundPane() {
//TODO Bjorn 地图标题背景自动逻辑 return new VanChartBackgroundWithOutShadowWithRadiusPane(true);
//return new VanChartBackgroundWithOutShadowWithRadiusPane(true);
return new VanChartBackgroundWithOutShadowWithRadiusPane();
} }
} }

38
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

@ -20,7 +20,8 @@ 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.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
import com.fr.design.mainframe.chart.gui.style.ColorSelectBoxWithThemeStyle;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
@ -85,9 +86,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected LineComboBox axisLineStyle; protected LineComboBox axisLineStyle;
//TODO Bjorn 坐标轴面板回退 protected ColorSelectBoxWithThemeStyle axisLineColor;
protected ColorSelectBox axisLineColor;
//protected ColorSelectBoxWithPreStyle axisLineColor;
protected UIButtonGroup<AxisTickLineType> mainTick; protected UIButtonGroup<AxisTickLineType> mainTick;
protected UIButtonGroup<AxisTickLineType> secondTick; protected UIButtonGroup<AxisTickLineType> secondTick;
@ -381,31 +380,16 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
} }
protected ChartTextAttrPane getChartTextAttrPane() { protected ChartTextAttrPane getChartTextAttrPane() {
//TODO Bjorn 坐标轴面板回退 return new ChartTextAttrPaneWithThemeStyle() {
/* return new ChartTextAttrPaneWithPreStyle() {
protected double getEdithAreaWidth() { protected double getEdithAreaWidth() {
return TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; return TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
} }
};*/
return new ChartTextAttrPane() {
@Override
protected JPanel getContentPane(JPanel buttonPane) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p};
return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), rowSize, columnSize);
}
}; };
} }
protected JPanel createLineStylePane(double[] row, double[] col) { protected JPanel createLineStylePane(double[] row, double[] col) {
axisLineStyle = createLineComboBox(); axisLineStyle = createLineComboBox();
//TODO Bjorn 坐标轴面板回退 axisLineColor = new ColorSelectBoxWithThemeStyle(100);
//axisLineColor = new ColorSelectBoxWithPreStyle(100);
axisLineColor = new ColorSelectBox(100);
String[] strings = new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")}; String[] strings = new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")};
AxisTickLineType[] values = new AxisTickLineType[]{AxisTickLineType.TICK_LINE_OUTSIDE, AxisTickLineType.TICK_LINE_NONE}; AxisTickLineType[] values = new AxisTickLineType[]{AxisTickLineType.TICK_LINE_OUTSIDE, AxisTickLineType.TICK_LINE_NONE};
mainTick = new UIButtonGroup<AxisTickLineType>(strings, values); mainTick = new UIButtonGroup<AxisTickLineType>(strings, values);
@ -423,9 +407,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
return new Component[][]{ return new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle},
//TODO Bjorn 坐标轴面板回退 new Component[]{axisLineColor, null},
//new Component[]{axisLineColor, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Main_Graduation_Line")), mainTick}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Main_Graduation_Line")), mainTick},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Second_Graduation_Line")), secondTick}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Second_Graduation_Line")), secondTick},
}; };
@ -735,9 +717,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
axisLineStyle.setSelectedLineStyle(axis.getAxisStyle()); axisLineStyle.setSelectedLineStyle(axis.getAxisStyle());
} }
if (axisLineColor != null) { if (axisLineColor != null) {
axisLineColor.setSelectObject(axis.getAxisColor()); axisLineColor.populate(axis.getLineColorWithPreStyle());
//TODO Bjorn 坐标轴面板回退
//axisLineColor.populate(axis.getLineColorWithPreStyle());
} }
if (mainTick != null) { if (mainTick != null) {
mainTick.setSelectedItem(axis.getMainTickLine()); mainTick.setSelectedItem(axis.getMainTickLine());
@ -880,9 +860,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
axis.setAxisStyle(axisLineStyle.getSelectedLineStyle()); axis.setAxisStyle(axisLineStyle.getSelectedLineStyle());
} }
if (axisLineColor != null) { if (axisLineColor != null) {
axis.setAxisColor(axisLineColor.getSelectObject()); axis.setLineColorWithPreStyle(axisLineColor.update());
//TODO Bjorn 坐标轴面板回退
//axis.setLineColorWithPreStyle(axisLineColor.update());
} }
if (mainTick != null) { if (mainTick != null) {
axis.setMainTickLine(mainTick.getSelectedItem()); axis.setMainTickLine(mainTick.getSelectedItem());

5
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java

@ -8,6 +8,7 @@ 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.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartGaugeAxis; import com.fr.plugin.chart.attr.axis.VanChartGaugeAxis;
@ -102,9 +103,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane {
if (isMulti(gaugeStyle)) { if (isMulti(gaugeStyle)) {
return new ChartTextAttrPaneWithAuto(FontAutoType.SIZE_AND_COLOR); return new ChartTextAttrPaneWithAuto(FontAutoType.SIZE_AND_COLOR);
} else { } else {
return new ChartTextAttrPane(); return new ChartTextAttrPaneWithThemeStyle();
//TODO Bjorn 坐标轴面板回退
//return new ChartTextAttrPaneWithPreStyle();
} }
} }

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java

@ -46,9 +46,7 @@ public class VanChartRadarXAxisPane extends VanChartBaseAxisPane {
return new Component[][]{ return new Component[][]{
new Component[]{null,null} , new Component[]{null,null} ,
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle},
//TODO Bjorn 坐标轴面板回退 new Component[]{axisLineColor, null},
//new Component[]{axisLineColor, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor},
}; };
} }

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java

@ -90,9 +90,7 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane {
return new Component[][]{ return new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle},
//TODO Bjorn 坐标轴面板回退 new Component[]{axisLineColor, null},
//new Component[]{axisLineColor, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor},
}; };
} }

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

@ -11,6 +11,7 @@ import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.van.chart.designer.AbstractVanChartScrollPane; import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.background.VanChartBackgroundPane; import com.fr.van.chart.designer.component.background.VanChartBackgroundPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundPaneWithThemeStyle;
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;
@ -45,13 +46,11 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
protected JPanel createContentPane() { protected JPanel createContentPane() {
contentPane = new JPanel(new BorderLayout()); contentPane = new JPanel(new BorderLayout());
chartBorderPane = new VanChartBorderWithRadiusPane(); chartBorderPane = new VanChartBorderWithRadiusPane();
chartBackgroundPane = new VanChartBackgroundPane(); if(isPlot) {
//TODO Bjorn 背景面板回退
/* if(isPlot) {
chartBackgroundPane = new VanChartBackgroundPane(); chartBackgroundPane = new VanChartBackgroundPane();
} else { } else {
chartBackgroundPane = new VanChartBackgroundPaneWithPreStyle(); chartBackgroundPane = new VanChartBackgroundPaneWithThemeStyle();
}*/ }
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;

36
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java

@ -7,6 +7,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; 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.gui.style.ColorSelectBoxWithThemeStyle;
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.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.VanChartAttrHelper;
@ -43,11 +44,8 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
private LineTypeComboBox horizonLineType; private LineTypeComboBox horizonLineType;
private LineTypeComboBox verticalLineType; private LineTypeComboBox verticalLineType;
private ColorSelectBox horizontalColorBox; private ColorSelectBoxWithThemeStyle horizontalColorBox;
private ColorSelectBox verticalColorBox; private ColorSelectBoxWithThemeStyle verticalColorBox;
//TODO Bjorn 背景坐标轴面板回退
/* private ColorSelectBoxWithPreStyle horizontalColorBox;
private ColorSelectBoxWithPreStyle verticalColorBox;*/
private JPanel horizontalColorPane; private JPanel horizontalColorPane;
private JPanel verticalColorPane; private JPanel verticalColorPane;
@ -56,11 +54,8 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
} }
private void initComponents() { private void initComponents() {
horizontalColorBox = new ColorSelectBox(PREFERRED_WIDTH); horizontalColorBox = new ColorSelectBoxWithThemeStyle(PREFERRED_WIDTH);
verticalColorBox = new ColorSelectBox(PREFERRED_WIDTH); verticalColorBox = new ColorSelectBoxWithThemeStyle(PREFERRED_WIDTH);
//TODO Bjorn 背景坐标轴面板回退
/* horizontalColorBox = new ColorSelectBoxWithPreStyle(PREFERRED_WIDTH);
verticalColorBox = new ColorSelectBoxWithPreStyle(PREFERRED_WIDTH);*/
horizonLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); horizonLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED});
verticalLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); verticalLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED});
@ -93,18 +88,15 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
} }
protected void initGridLineComponents() { protected void initGridLineComponents() {
//TODO Bjorn 背景坐标轴面板回退
Component[][] upComponent = new Component[][]{ Component[][] upComponent = new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{null, horizontalColorBox} new Component[]{horizontalColorBox, null}
//new Component[]{horizontalColorBox, null}
}; };
horizontalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(upComponent); horizontalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(upComponent);
Component[][] downComponent = new Component[][]{ Component[][] downComponent = new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{null, verticalColorBox} new Component[]{verticalColorBox, null}
//new Component[]{verticalColorBox, null}
}; };
verticalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(downComponent); verticalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(downComponent);
@ -228,16 +220,13 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
VanChartAxis defaultXAxis = rectanglePlot.getDefaultXAxis(); VanChartAxis defaultXAxis = rectanglePlot.getDefaultXAxis();
VanChartAxis defaultYAxis = rectanglePlot.getDefaultYAxis(); VanChartAxis defaultYAxis = rectanglePlot.getDefaultYAxis();
//TODO Bjorn 背景坐标轴面板回退
if (defaultXAxis != null) { if (defaultXAxis != null) {
//verticalColorBox.populate(defaultXAxis.getMainGridColorWithPreStyle()); verticalColorBox.populate(defaultXAxis.getMainGridColorWithPreStyle());
verticalColorBox.setSelectObject(defaultXAxis.getMainGridColor());
verticalLineType.setSelectedItem(defaultXAxis.getGridLineType()); verticalLineType.setSelectedItem(defaultXAxis.getGridLineType());
} }
if (defaultYAxis != null) { if (defaultYAxis != null) {
//horizontalColorBox.populate(defaultYAxis.getMainGridColorWithPreStyle()); horizontalColorBox.populate(defaultYAxis.getMainGridColorWithPreStyle());
horizontalColorBox.setSelectObject(defaultYAxis.getMainGridColor());
horizonLineType.setSelectedItem(defaultYAxis.getGridLineType()); horizonLineType.setSelectedItem(defaultYAxis.getGridLineType());
} }
} }
@ -264,16 +253,13 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
VanChartAxis defaultXAxis = rectanglePlot.getDefaultXAxis(); VanChartAxis defaultXAxis = rectanglePlot.getDefaultXAxis();
VanChartAxis defaultYAxis = rectanglePlot.getDefaultYAxis(); VanChartAxis defaultYAxis = rectanglePlot.getDefaultYAxis();
//TODO Bjorn 背景坐标轴面板回退
if (defaultXAxis != null) { if (defaultXAxis != null) {
//defaultXAxis.setMainGridColorWithPreStyle(verticalColorBox.update()); defaultXAxis.setMainGridColorWithPreStyle(verticalColorBox.update());
defaultXAxis.setMainGridColor(verticalColorBox.getSelectObject());
defaultXAxis.setGridLineType((LineType) verticalLineType.getSelectedItem()); defaultXAxis.setGridLineType((LineType) verticalLineType.getSelectedItem());
} }
if (defaultYAxis != null) { if (defaultYAxis != null) {
//defaultYAxis.setMainGridColorWithPreStyle(horizontalColorBox.update()); defaultYAxis.setMainGridColorWithPreStyle(horizontalColorBox.update());
defaultYAxis.setMainGridColor(horizontalColorBox.getSelectObject());
defaultYAxis.setGridLineType((LineType) horizonLineType.getSelectedItem()); defaultYAxis.setGridLineType((LineType) horizonLineType.getSelectedItem());
} }
} }

9
designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanChartDataSheetPane.java

@ -10,6 +10,7 @@ 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.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.VanChartAttrHelper;
@ -19,6 +20,7 @@ import com.fr.plugin.chart.type.AxisType;
import com.fr.van.chart.designer.AbstractVanChartScrollPane; import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.border.VanChartBorderPane; import com.fr.van.chart.designer.component.border.VanChartBorderPane;
import com.fr.van.chart.designer.component.border.VanChartBorderPaneWithPreStyle;
import com.fr.van.chart.designer.component.format.FormatPaneWithNormalType; import com.fr.van.chart.designer.component.format.FormatPaneWithNormalType;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -103,15 +105,12 @@ public class VanChartDataSheetPane extends AbstractVanChartScrollPane<Chart> {
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
} }
//TODO Bjorn 数据表面板回退
protected VanChartBorderPane createBorderPanePane() { protected VanChartBorderPane createBorderPanePane() {
return new VanChartBorderPane(); return new VanChartBorderPaneWithPreStyle();
//return new VanChartBorderPaneWithPreStyle();
} }
protected ChartTextAttrPane createChartTextAttrPane() { protected ChartTextAttrPane createChartTextAttrPane() {
return new ChartTextAttrPane(); return new ChartTextAttrPaneWithThemeStyle();
//return new ChartTextAttrPaneWithPreStyle();
} }
@Override @Override

5
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java

@ -49,11 +49,6 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe
return getGaugeStyle() == GaugeStyle.RING || getGaugeStyle() == GaugeStyle.SLOT; return getGaugeStyle() == GaugeStyle.RING || getGaugeStyle() == GaugeStyle.SLOT;
} }
//TODO Bjorn 仪表盘自动逻辑
protected boolean isFontColorAuto() {
return getGaugeStyle() == GaugeStyle.RING || getGaugeStyle() == GaugeStyle.SLOT;
}
protected boolean hasLabelPosition(Plot plot) { protected boolean hasLabelPosition(Plot plot) {
switch (getGaugeStyle()) { switch (getGaugeStyle()) {
case RING: case RING:

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java

@ -79,10 +79,8 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
return false; return false;
} }
//TODO Bjorn 仪表盘自动逻辑
protected boolean isFontColorAuto() { protected boolean isFontColorAuto() {
return false; return true;
//return true;
} }
private FontAutoType getFontAutoType() { private FontAutoType getFontAutoType() {

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java

@ -271,9 +271,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
} }
protected VanChartBorderPane createDiffBorderPane() { protected VanChartBorderPane createDiffBorderPane() {
return new VanChartBorderPane(); return new VanChartBorderPane(true);
//TODO Bjorn 边框自动回退
//return new VanChartBorderPane(true);
} }

7
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java

@ -6,6 +6,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.i18n.Toolkit; 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.backgroundpane.ColorBackgroundQuickPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
@ -75,15 +76,13 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
} }
}; };
//TODO Bjorn 钻取地图钻取目录背景自动逻辑 backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(true) {
/*backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(true) {
@Override @Override
protected void initList() { protected void initList() {
paneList.add(new ColorBackgroundQuickPane()); paneList.add(new ColorBackgroundQuickPane());
} }
};*/ };
backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow();
selectBackgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow() { selectBackgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow() {
protected String labelName() { protected String labelName() {
return Toolkit.i18nText("Fine-Design_Chart_Select_Color"); return Toolkit.i18nText("Fine-Design_Chart_Select_Color");

34
designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java

@ -78,8 +78,7 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f}; double[] columnSize = {f};
//TODO Bjorn double[] rowSize = {p, p, p, p, p, p, p, p, p, p};
double[] rowSize = {p, p, p, p, p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createGaugeLayoutPane()}, new Component[]{createGaugeLayoutPane()},
new Component[]{createGaugeStylePane(rowSize, new double[]{f, e})}, new Component[]{createGaugeStylePane(rowSize, new double[]{f, e})},
@ -221,14 +220,12 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
private Component[][] getDiffComponentsWithGaugeStyle() { private Component[][] getDiffComponentsWithGaugeStyle() {
GaugeStyle style = getGaugeStyle(); GaugeStyle style = getGaugeStyle();
switch (style) { switch (style) {
//TODO Bjorn 仪表盘样式自动逻辑
case RING: case RING:
initRotate(); initRotate();
return new Component[][]{ return new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
getPaneBackgroundColor(), getPaneBackgroundColorAuto(),
/* getPaneBackgroundColorAuto(), new Component[]{null, paneBackgroundColor},
new Component[]{null, paneBackgroundColor},*/
getInnerPaneBackgroundColor(), getInnerPaneBackgroundColor(),
new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null}, new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null},
getChutePercent() getChutePercent()
@ -237,9 +234,8 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
return new Component[][]{ return new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
getNeedleColor(), getNeedleColor(),
getSlotBackgroundColor(), getSlotBackgroundColorAuto(),
/* getSlotBackgroundColorAuto(), new Component[]{null, slotBackgroundColor},
new Component[]{null, slotBackgroundColor},*/
new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null}, new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null},
getChutePercent() getChutePercent()
}; };
@ -247,33 +243,25 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
return new Component[][]{ return new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
getNeedleColor(), getNeedleColor(),
getSlotBackgroundColor(), getSlotBackgroundColorAuto(),
/*getSlotBackgroundColorAuto(), new Component[]{null, slotBackgroundColor},
new Component[]{null, slotBackgroundColor},*/
new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Length_Set")), null}, new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Length_Set")), null},
getThermometerWidth() getThermometerWidth()
}; };
default: default:
return new Component[][]{ return new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
getHingeColor(), getHingeColorAuto(),
/* getHingeColorAuto(), new Component[]{null, hingeColor},
new Component[]{null, hingeColor},*/
getHingeBackgroundColor(), getHingeBackgroundColor(),
getNeedleColor(), getNeedleColor(),
getPaneBackgroundColor(), getPaneBackgroundColorAuto(),
/* getPaneBackgroundColorAuto(), new Component[]{null, paneBackgroundColor},
new Component[]{null, paneBackgroundColor},*/
new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null} new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null}
}; };
} }
} }
private Component[] getHingeColor() {
hingeColor = new ColorSelectBox(120);
return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Hinge")), hingeColor};
}
private Component[] getHingeColorAuto() { private Component[] getHingeColorAuto() {
hingeColor = new ColorSelectBox(120); hingeColor = new ColorSelectBox(120);
hingeColorAuto = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), hingeColorAuto = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"),

21
designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java

@ -337,9 +337,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
} }
protected JPanel createAreaPane() { protected JPanel createAreaPane() {
//TODO Bjorn 地图背景自动 borderWithAlphaPane = new VanChartBorderWithAlphaPane(true);
//borderWithAlphaPane = new VanChartBorderWithAlphaPane(true);
borderWithAlphaPane = new VanChartBorderWithAlphaPane();
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
@ -355,8 +353,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
} }
protected JPanel createNullValueColorPane() { protected JPanel createNullValueColorPane() {
//TODO Bjorn 地图空值背景自动 nullValueAuto = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"),
/* nullValueAuto = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"),
Toolkit.i18nText("Fine-Design_Chart_Custom")}); Toolkit.i18nText("Fine-Design_Chart_Custom")});
initNullValueListener(); initNullValueListener();
nullValueColorBox = new ColorSelectBox(80); nullValueColorBox = new ColorSelectBox(80);
@ -373,10 +370,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
new Component[]{text, nullValueAuto}, new Component[]{text, nullValueAuto},
new Component[]{null, nullValueColorBox}, new Component[]{null, nullValueColorBox},
}; };
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);*/ return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
nullValueColorBox = new ColorSelectBox(80);
return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_NULL_Value_Color"), nullValueColorBox);
} }
@ -593,15 +587,13 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
markerTypeCom.setSelectedItem(mapPlot.getMapMarkerType().toLocalString()); markerTypeCom.setSelectedItem(mapPlot.getMapMarkerType().toLocalString());
} }
if (nullValueColorBox != null) { if (nullValueColorBox != null) {
//TODO Bjorn 地图空值背景自动 if (((VanChartMapPlot) plot).isAutoNullValue()) {
/* if (((VanChartMapPlot) plot).isAutoNullValue()) {
nullValueAuto.setSelectedIndex(0); nullValueAuto.setSelectedIndex(0);
} else { } else {
nullValueAuto.setSelectedIndex(1); nullValueAuto.setSelectedIndex(1);
} }
nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor()); nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor());
checkNullValueButton();*/ checkNullValueButton();
nullValueColorBox.setSelectObject(mapPlot.getNullValueColor());
} }
//大数据模式 恢复用注释。下面3行删除。 //大数据模式 恢复用注释。下面3行删除。
if (lineMapLargeDataModelGroup != null) { if (lineMapLargeDataModelGroup != null) {
@ -623,8 +615,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
} }
} }
if (nullValueColorBox != null) { if (nullValueColorBox != null) {
//TODO Bjorn 地图空值背景自动 ((VanChartMapPlot) plot).setAutoNullValue(nullValueAuto.getSelectedIndex() == 0);
//((VanChartMapPlot) plot).setAutoNullValue(nullValueAuto.getSelectedIndex() == 0);
mapPlot.setNullValueColor(nullValueColorBox.getSelectObject()); mapPlot.setNullValueColor(nullValueColorBox.getSelectObject());
} }
//大数据模式 恢复用注释。下面3行删除。 //大数据模式 恢复用注释。下面3行删除。

42
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java

@ -73,12 +73,17 @@ public class GisLayerPane extends JPanel implements UIObserver {
} }
private boolean isStandardGis() { private boolean isStandardGis() {
return gisButton.getSelectedIndex() == 1;
}
private boolean isAuto() {
return gisButton.getSelectedIndex() == 0; return gisButton.getSelectedIndex() == 0;
} }
private JPanel createGISLayerPane() { private JPanel createGISLayerPane() {
gisButton = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Form_Widget_Style_Standard"), Toolkit.i18nText("Fine-Design_Chart_Custom")}); gisButton = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Mode_Auto"),
Toolkit.i18nText("Fine-Design_Form_Widget_Style_Standard"), Toolkit.i18nText("Fine-Design_Chart_Custom")});
gisButton.setSelectedIndex(0); gisButton.setSelectedIndex(0);
gisGaoDeLayer = new UIComboBox(MapLayerConfigManager.getGaoDeLayerItems()); gisGaoDeLayer = new UIComboBox(MapLayerConfigManager.getGaoDeLayerItems());
gisButton.addActionListener(event -> { gisButton.addActionListener(event -> {
@ -94,6 +99,9 @@ public class GisLayerPane extends JPanel implements UIObserver {
layerPaneCheckPane = new JPanel(new CardLayout()) { layerPaneCheckPane = new JPanel(new CardLayout()) {
@Override @Override
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
if (isAuto()) {
return new Dimension(0, 0);
}
if (isStandardGis()) { if (isStandardGis()) {
return gisGaoDeLayer.getPreferredSize(); return gisGaoDeLayer.getPreferredSize();
} else { } else {
@ -101,6 +109,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
} }
} }
}; };
layerPaneCheckPane.add(new JPanel(), "auto");
layerPaneCheckPane.add(gisGaoDeLayer, "standard"); layerPaneCheckPane.add(gisGaoDeLayer, "standard");
layerPaneCheckPane.add(gisLayer, "custom"); layerPaneCheckPane.add(gisLayer, "custom");
@ -129,7 +138,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
layerCardPane = new JPanel(new CardLayout()) { layerCardPane = new JPanel(new CardLayout()) {
@Override @Override
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
if (isStandardGis()) { if (isStandardGis() || isAuto()) {
return new Dimension(0, 0); return new Dimension(0, 0);
} }
String itemName = Utils.objectToString(gisLayer.getSelectedItem()); String itemName = Utils.objectToString(gisLayer.getSelectedItem());
@ -188,7 +197,9 @@ public class GisLayerPane extends JPanel implements UIObserver {
private void refreshZoomLevel() { private void refreshZoomLevel() {
//gis图层不同,对应的缩放等级不同。 //gis图层不同,对应的缩放等级不同。
ZoomLevel[] levels; ZoomLevel[] levels;
if (isStandardGis()) { if (isAuto()) {
levels = MapStatusPane.ZOOM_LEVELS;
} else if (isStandardGis()) {
if (gisGaoDeLayer.getSelectedIndex() == gisGaoDeLayer.getItemCount() - 1) { if (gisGaoDeLayer.getSelectedIndex() == gisGaoDeLayer.getItemCount() - 1) {
levels = MapStatusPane.ZOOM_LEVELS; levels = MapStatusPane.ZOOM_LEVELS;
} else { } else {
@ -209,7 +220,14 @@ public class GisLayerPane extends JPanel implements UIObserver {
private void checkLayerCardPane() { private void checkLayerCardPane() {
CardLayout cardLayout = (CardLayout) layerPaneCheckPane.getLayout(); CardLayout cardLayout = (CardLayout) layerPaneCheckPane.getLayout();
cardLayout.show(layerPaneCheckPane, isStandardGis() ? "standard" : "custom"); if (isAuto()) {
cardLayout.show(layerPaneCheckPane, "auto");
} else if (isStandardGis()) {
cardLayout.show(layerPaneCheckPane, "standard");
} else {
cardLayout.show(layerPaneCheckPane, "custom");
}
} }
private void checkCustomLayerCardPane() { private void checkCustomLayerCardPane() {
@ -218,10 +236,6 @@ public class GisLayerPane extends JPanel implements UIObserver {
} }
public void resetGisLayer(VanChartMapPlot mapPlot) { public void resetGisLayer(VanChartMapPlot mapPlot) {
//TODO Bjorn 地图gis图层自动逻辑
/* mapPlot.getGisLayer().setGisLayerType(GISLayerType.AUTO);
mapPlot.getGisLayer().setLayerName(GISLayerType.getLocString(GISLayerType.AUTO));*/
GisLayer defaultGisLayer = mapPlot.getDefaultGisLayer(); GisLayer defaultGisLayer = mapPlot.getDefaultGisLayer();
mapPlot.setGisLayer(defaultGisLayer); mapPlot.setGisLayer(defaultGisLayer);
populate(defaultGisLayer); populate(defaultGisLayer);
@ -229,6 +243,9 @@ public class GisLayerPane extends JPanel implements UIObserver {
public void populate(GisLayer layer) { public void populate(GisLayer layer) {
switch (layer.getGisLayerType()) { switch (layer.getGisLayerType()) {
case AUTO:
gisButton.setSelectedIndex(0);
break;
case GAO_DE_API: case GAO_DE_API:
case LAYER_NULL: case LAYER_NULL:
populateStandardGis(layer); populateStandardGis(layer);
@ -243,7 +260,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
} }
private void populateStandardGis(GisLayer layer) { private void populateStandardGis(GisLayer layer) {
gisButton.setSelectedIndex(0); gisButton.setSelectedIndex(1);
if (layer.getGisLayerType() == GISLayerType.LAYER_NULL) { if (layer.getGisLayerType() == GISLayerType.LAYER_NULL) {
gisGaoDeLayer.setSelectedIndex(gisGaoDeLayer.getItemCount() - 1); gisGaoDeLayer.setSelectedIndex(gisGaoDeLayer.getItemCount() - 1);
} else { } else {
@ -252,7 +269,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
} }
private void populateCustomGis(GisLayer layer) { private void populateCustomGis(GisLayer layer) {
gisButton.setSelectedIndex(1); gisButton.setSelectedIndex(2);
gisLayer.setSelectedItem(layer.getShowItemName()); gisLayer.setSelectedItem(layer.getShowItemName());
switch (layer.getGisLayerType()) { switch (layer.getGisLayerType()) {
@ -266,7 +283,10 @@ public class GisLayerPane extends JPanel implements UIObserver {
} }
public void update(GisLayer layer) { public void update(GisLayer layer) {
if (isStandardGis()) { if (isAuto()) {
layer.setGisLayerType(GISLayerType.AUTO);
layer.setLayerName(GISLayerType.getLocString(GISLayerType.AUTO));
} else if (isStandardGis()) {
updateStandardGis(layer); updateStandardGis(layer);
} else { } else {
updateCustomGis(layer); updateCustomGis(layer);

12
designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java

@ -1,10 +1,13 @@
package com.fr.van.chart.scatter; package com.fr.van.chart.scatter;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.van.chart.designer.component.VanChartHtmlLabelPane; import com.fr.van.chart.designer.component.VanChartHtmlLabelPane;
import com.fr.van.chart.designer.component.VanChartHtmlLabelPaneWithBackGroundLabel; import com.fr.van.chart.designer.component.VanChartHtmlLabelPaneWithBackGroundLabel;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout;
/** /**
* 散点图标签界面 * 散点图标签界面
@ -21,12 +24,11 @@ public class VanChartScatterLabelContentPane extends VanChartScatterTooltipCont
return new VanChartHtmlLabelPaneWithBackGroundLabel(); return new VanChartHtmlLabelPaneWithBackGroundLabel();
} }
//TODO Bjorn 散点图标签预定义样式 public JPanel createCommonStylePane() {
/* public JPanel createCommonStylePane() {
if (isInCondition()) { if (isInCondition()) {
return super.createCommonStylePane(); return super.createCommonStylePane();
} }
setTextAttrPane(new ChartTextAttrPaneWithPreStyle()); setTextAttrPane(new ChartTextAttrPaneWithThemeStyle());
JPanel stylePanel = new JPanel(new BorderLayout()); JPanel stylePanel = new JPanel(new BorderLayout());
stylePanel.add(getTextAttrPane(), BorderLayout.CENTER); stylePanel.add(getTextAttrPane(), BorderLayout.CENTER);
@ -41,9 +43,9 @@ public class VanChartScatterLabelContentPane extends VanChartScatterTooltipCont
} }
if (hasTextStylePane()) { if (hasTextStylePane()) {
this.getTextAttrPane().update(attrTooltipContent.getTextAttr()); this.getTextAttrPane().update(attrTooltipContent.getTextAttr());
if (!attrTooltipContent.getTextAttr().isPredefinedStyle()) { if (!attrTooltipContent.getTextAttr().isThemed()) {
attrTooltipContent.setCustom(true); attrTooltipContent.setCustom(true);
} }
} }
}*/ }
} }

4
designer-realize/src/main/java/com/fr/poly/PolyUtils.java

@ -5,6 +5,7 @@ package com.fr.poly;
import com.fr.base.ScreenResolution; import com.fr.base.ScreenResolution;
import com.fr.base.chart.BaseChartCollection; import com.fr.base.chart.BaseChartCollection;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.poly.creator.BlockCreator; import com.fr.poly.creator.BlockCreator;
import com.fr.poly.creator.ChartBlockCreator; import com.fr.poly.creator.ChartBlockCreator;
@ -14,10 +15,10 @@ import com.fr.report.poly.PolyChartBlock;
import com.fr.report.poly.PolyECBlock; import com.fr.report.poly.PolyECBlock;
import com.fr.report.poly.TemplateBlock; import com.fr.report.poly.TemplateBlock;
import java.awt.Point;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.awt.Point;
/** /**
* @author richer * @author richer
@ -55,6 +56,7 @@ public class PolyUtils {
} }
public static BlockCreator createCreator(BaseChartCollection cc) { public static BlockCreator createCreator(BaseChartCollection cc) {
cc.setThemeStyle(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplateTheme());
TemplateBlock block = new PolyChartBlock(cc); TemplateBlock block = new PolyChartBlock(cc);
return createCreator(block); return createCreator(block);
} }

Loading…
Cancel
Save