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. 57
      designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java
  12. 54
      designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java
  13. 66
      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.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.chart.base.ChartConstants;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.i18n.Toolkit;
import com.fr.general.GeneralUtils;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JLabel;
import javax.swing.JList;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
@ -65,7 +69,21 @@ public class ColorSchemeComboBox extends UIComboBox {
Iterator names = config.names();
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 {
//添加默认的方案和第一个方案
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.chartdata.CallbackEvent;
import com.fr.base.chart.result.WebChartIDInfo;
import com.fr.chart.base.ChartPreStyleProvider;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.config.predefined.PredefinedStyle;
import com.fr.design.gui.chart.MiddleChartComponent;
import com.fr.general.Background;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.script.Calculator;
import com.fr.stable.core.PropertyChangeListener;
import javax.swing.BorderFactory;
import java.util.List;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
@ -79,13 +76,13 @@ public class ChartPreStylePreView extends MiddleChartComponent {
}
public void refresh(PredefinedStyle style) {
VanChart vanChart = chartCollection.getSelectedChartProvider(VanChart.class);
List<ChartPreStyleProvider> chartPreStyleProviders = vanChart.getChartPreStyleProvider();
for (ChartPreStyleProvider chartPreStyleProvider : chartPreStyleProviders) {
chartPreStyleProvider.updatePreDefinedStyle(style);
/*VanChart vanChart = chartCollection.getSelectedChartProvider(VanChart.class);
List<ChartThemeStyleProvider> chartThemeStyleProviders = vanChart.getChartPreStyleProvider();
for (ChartThemeStyleProvider chartThemeStyleProvider : chartThemeStyleProviders) {
chartThemeStyleProvider.updateThemeStyle(style);
}
componentBackground = style.getComponentStyle().getBorderStyle().getBackground();
vanChart.attrChange();
vanChart.attrChange();*/
}
@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.edit.CellStyleListEditPane;
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.ColorListPane;
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.general.FRFont;
import com.fr.log.FineLoggerFactory;
@ -39,6 +39,7 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
@ -51,7 +52,6 @@ import java.awt.event.FocusEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
import java.util.List;
/**
* @author Starryi
@ -267,7 +267,9 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
colorListPane.addColorChangeListener(new ChangeListener() {
@Override
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.design.dialog.BasicPane;
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.ChartDataSheetStylePane;
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.ChartSeriesStylePane;
import com.fr.design.mainframe.theme.edit.chart.ChartTitleAndBackgroundStylePane;
import javax.swing.BorderFactory;
import java.util.ArrayList;
import java.util.List;
import java.awt.Color;
/**
* @author Bjorn
@ -21,12 +22,12 @@ import java.util.List;
*/
public class ChartStyleEditPane extends MultiTabPane<ThemedChartStyle> {
private ChartTitleStylePane chartTitleStylePane;
private ChartSeriesStylePane chartSeriesStylePane;
private ChartLegendStylePane chartLegendStylePane;
private ChartLabelStylePane chartLabelPane;
private ChartAxisStylePane chartAxisStylePane;
private ChartDataSheetStylePane chartDataSheetStylePane;
private ChartBackgroundStylePane chartBackgroundStylePane;
private ChartTitleAndBackgroundStylePane chartTitleAndBackgroundStylePane;
public ChartStyleEditPane() {
}
@ -39,30 +40,30 @@ public class ChartStyleEditPane extends MultiTabPane<ThemedChartStyle> {
@Override
protected List<BasicPane> initPaneList() {
this.chartTitleStylePane = new ChartTitleStylePane();
this.chartSeriesStylePane = new ChartSeriesStylePane();
this.chartLegendStylePane = new ChartLegendStylePane();
this.chartLabelPane = new ChartLabelStylePane();
this.chartAxisStylePane = new ChartAxisStylePane();
this.chartDataSheetStylePane = new ChartDataSheetStylePane();
this.chartBackgroundStylePane = new ChartBackgroundStylePane();
this.chartTitleAndBackgroundStylePane = new ChartTitleAndBackgroundStylePane();
paneList = new ArrayList<>();
paneList.add(this.chartTitleStylePane);
paneList.add(this.chartSeriesStylePane);
paneList.add(this.chartLegendStylePane);
paneList.add(this.chartLabelPane);
paneList.add(this.chartAxisStylePane);
paneList.add(this.chartDataSheetStylePane);
paneList.add(this.chartBackgroundStylePane);
paneList.add(this.chartTitleAndBackgroundStylePane);
return paneList;
}
@Override
public void populateBean(ThemedChartStyle ob) {
chartTitleStylePane.populate(ob);
chartSeriesStylePane.populate(ob);
chartLegendStylePane.populate(ob);
chartLabelPane.populate(ob);
chartAxisStylePane.populate(ob);
chartDataSheetStylePane.populate(ob);
chartBackgroundStylePane.populate(ob);
chartTitleAndBackgroundStylePane.populate(ob);
}
@Override
@ -74,15 +75,18 @@ public class ChartStyleEditPane extends MultiTabPane<ThemedChartStyle> {
@Override
public ThemedChartStyle updateBean() {
ThemedChartStyle chartStyle = new ThemedChartStyle();
chartTitleStylePane.update(chartStyle);
chartSeriesStylePane.update(chartStyle);
chartLegendStylePane.update(chartStyle);
chartLabelPane.update(chartStyle);
chartAxisStylePane.update(chartStyle);
chartDataSheetStylePane.update(chartStyle);
chartBackgroundStylePane.update(chartStyle);
chartTitleAndBackgroundStylePane.update(chartStyle);
return chartStyle;
}
public void populateGradientBar(List<Color> colors) {
chartSeriesStylePane.populateGradientBar(colors);
}
@Override
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() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
double e1 = 75;
double e = 155;
double p = TableLayout.PREFERRED;
double[] columnSize = {p, e};
double[] columnSize = {e1, e};
JPanel gapTableLayoutPane = TableLayoutHelper.createGapTableLayoutPane(getComponent(), getRows(p), columnSize, 20, LayoutConstants.VGAP_LARGE);
gapTableLayoutPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
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) {
double e1 = 75;
double e = 155;
double p = TableLayout.PREFERRED;
double[] rows = {p, p, p};
double[] columnSize = {p, e};
double[] columnSize = {e1, e};
UILabel text = new UILabel(getUILabelText(), SwingConstants.LEFT);
Component[][] components = {
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 javax.swing.JPanel;
import java.util.ArrayList;
import java.util.List;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
/**
* @author Bjorn
* @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 List<BackgroundQuickPane> paneList;
private JPanel centerPane;
//网格线颜色
private ColorSelectBox mainGridColor;
protected void initComponents() {
chartFontPane = new ChartFontPane() {
public String getUILabelText() {
return Toolkit.i18nText("Fine-Design_Chart_Title_Character");
}
};
mainGridColor = new ColorSelectBox(100);
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() {
return new Component[][]{
new Component[]{chartFontPane, null},
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Area_Background_Color")), typeComboBox},
new Component[]{null, centerPane},
@ -74,23 +93,16 @@ public class ChartBackgroundStylePane extends AbstractChartStylePane {
}
protected double[] getRows(double p) {
return new double[]{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());
return new double[]{p, p, p, p, p};
}
@Override
protected String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Chart_Background");
return Toolkit.i18nText("Fine-Design_Chart_Title_Background");
}
public void populate(ThemedChartStyle chartStyle) {
chartFontPane.populate(chartStyle.getTitleFont());
Background background = chartStyle.getChartBackground();
for (int i = 0; i < paneList.size(); i++) {
BackgroundQuickPane pane = paneList.get(i);
@ -103,7 +115,9 @@ public class ChartBackgroundStylePane extends AbstractChartStylePane {
mainGridColor.setSelectObject(chartStyle.getGridMainLineColor());
}
public void update(ThemedChartStyle chartStyle) {
chartStyle.setTitleFont(chartFontPane.update());
chartStyle.setChartBackground(paneList.get(typeComboBox.getSelectedIndex()).updateBean());
if (chartStyle.getChartBackground() instanceof ImageBackground) {
((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;
}
}

57
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.gui.itextfield.UINumberField;
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.ColorSelectDetailPane;
import com.fr.design.style.color.ColorSelectDialog;
import com.fr.design.style.color.ColorSelectable;
import com.fr.stable.AssistUtils;
import com.fr.stable.os.OperatingSystem;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
@ -33,7 +34,7 @@ import java.awt.geom.Point2D;
/**
* 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();
}
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) {
p1.setColorInner(begin);
p2.setColorInner(end);
@ -106,16 +123,7 @@ public class GradientBar extends JComponent implements UIObserver, ColorSelectab
}
if (select >= 0) {
ColorSelectDetailPane pane = new ColorSelectDetailPane(Color.WHITE);
Color selectColor = list.get(select).getColorInner() == null ? Color.WHITE : list.get(select).getColorInner();
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, selectColor, GradientBar.this);
Color color = GradientBar.this.getColor();
if (color != null) {
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color);
list.get(select).setColorInner(color);
stateChanged();
GradientBar.this.repaint();
}
clickButton(select);
}
GradientBar.this.repaint();
}
@ -123,6 +131,23 @@ public class GradientBar extends JComponent implements UIObserver, ColorSelectab
});
}
protected void clickButton(int select) {
ColorSelectDetailPane pane = new ColorSelectDetailPane(Color.WHITE);
Color selectColor = list.get(select).getColorInner() == null ? Color.WHITE : list.get(select).getColorInner();
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, selectColor, GradientBar.this);
Color color = GradientBar.this.getColor();
if (color != null) {
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(color);
list.get(select).setColorInner(color);
stateChanged();
GradientBar.this.repaint();
}
}
public JPanel initWindowPane(double preWidth) {
return null;
}
protected void addMouseDragListener() {
this.addMouseMotionListener(new MouseAdapter() {
public void mouseDragged(MouseEvent e) {
@ -133,10 +158,10 @@ public class GradientBar extends JComponent implements UIObserver, ColorSelectab
break;
}
}
if(OperatingSystem.isLinux() && AssistUtils.equals(oldIndex,index)){
if(Math.abs(p1.getX() - e.getX()) > Math.abs(p2.getX() - e.getX())){
if (OperatingSystem.isLinux() && AssistUtils.equals(oldIndex, index)) {
if (Math.abs(p1.getX() - e.getX()) > Math.abs(p2.getX() - e.getX())) {
index = 1;
}else{
} else {
index = 0;
}
}

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

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

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

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

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.chart.chartattr.ChartCollection;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.chart.MiddleChartDialog;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit;
@ -110,6 +111,7 @@ public class ChartDialog extends MiddleChartDialog {
if (cc == null) {
return;
}
cc.setThemeStyle(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplateTheme());
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;
}
chartCollection4Design.setPredefinedStyleName(getGlobalPredefinedStyleName(), false);
Graphics2D g2d = (Graphics2D) g;
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.chartx.attr.ChartProvider;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.hyperlink.AbstractHyperLinkPane;
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.log.FineLoggerFactory;
import java.util.HashMap;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.HashMap;
/**
* 类说明: 图表超链 -- 弹出 悬浮窗.
@ -64,6 +65,7 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane<ChartHyperPopli
private ChartCollection createChartCollection() {
ChartCollection cc = new ChartCollection();
cc.setThemeStyle(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplateTheme());
ChartProvider chart = ChartTypeManager.getInstanceWithCheck().getFirstChart();
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.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -19,7 +20,7 @@ import java.awt.event.ActionListener;
* @version 10.0
* 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 CUSTOM = 1;
@ -27,27 +28,26 @@ public class ChartTextAttrPaneWithPreStyle extends ChartTextAttrPane {
private UIButtonGroup<Integer> preButton;
private JPanel textFontPane;
public ChartTextAttrPaneWithPreStyle() {
public ChartTextAttrPaneWithThemeStyle() {
initListener();
}
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")});
double f = TableLayout.FILL;
double e = getEdithAreaWidth();
double[] columnSize = {f, e};
double p = TableLayout.PREFERRED;
textFontPane = TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), getRowSize(), columnSize);
double[] rowSize = {p, p, p};
double[] columnSize = {f, e};
UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT);
Component[][] components = {
new Component[]{null, null},
new Component[]{text, preButton},
new Component[]{textFontPane, null},
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
JPanel preButtonPane = TableLayout4VanChartHelper.createGapTableLayoutPane(new Component[][]{new Component[]{text, preButton}}, new double[]{p}, columnSize);
textFontPane = TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), getRowSize(), columnSize);
panel.add(preButtonPane, BorderLayout.CENTER);
panel.add(textFontPane, BorderLayout.SOUTH);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
return panel;
}
protected double getEdithAreaWidth() {
@ -72,11 +72,15 @@ public class ChartTextAttrPaneWithPreStyle extends ChartTextAttrPane {
private void checkPreButton() {
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) {
if (textAttr.isPredefinedStyle()) {
if (textAttr.isThemed()) {
preButton.setSelectedIndex(PREDEFINED_STYLE);
} else {
preButton.setSelectedIndex(CUSTOM);
@ -88,9 +92,9 @@ public class ChartTextAttrPaneWithPreStyle extends ChartTextAttrPane {
public void update(TextAttr textAttr) {
int selectedIndex = preButton.getSelectedIndex();
if (selectedIndex == PREDEFINED_STYLE) {
textAttr.setPredefinedStyle(true);
textAttr.setThemed(true);
} else {
textAttr.setPredefinedStyle(false);
textAttr.setThemed(false);
}
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;
import com.fr.chart.base.ColorWithPreStyle;
import com.fr.chart.base.ColorWithThemeStyle;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
@ -22,7 +22,7 @@ import java.awt.event.ActionListener;
* @version 10.0
* 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 CUSTOM = 1;
@ -30,8 +30,8 @@ public class ColorSelectBoxWithPreStyle extends BasicPane {
private UIButtonGroup<Integer> preButton;
private ColorSelectBox colorSelectBox;
public ColorSelectBoxWithPreStyle(int preferredWidth) {
preButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Predefined"),
public ColorSelectBoxWithThemeStyle(int preferredWidth) {
preButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Follow_Theme"),
Toolkit.i18nText("Fine-Design_Chart_Custom")});
colorSelectBox = new ColorSelectBox(preferredWidth);
initContent();
@ -73,15 +73,15 @@ public class ColorSelectBoxWithPreStyle extends BasicPane {
return null;
}
public void populate(ColorWithPreStyle colorWithPreStyle) {
preButton.setSelectedIndex(colorWithPreStyle.isPredefinedStyle() ? PREDEFINED_STYLE : CUSTOM);
public void populate(ColorWithThemeStyle colorWithPreStyle) {
preButton.setSelectedIndex(colorWithPreStyle.isThemed() ? PREDEFINED_STYLE : CUSTOM);
colorSelectBox.setSelectObject(colorWithPreStyle.getColor());
checkPreButton();
}
public ColorWithPreStyle update() {
ColorWithPreStyle colorWithPreStyle = new ColorWithPreStyle();
colorWithPreStyle.setPredefinedStyle(preButton.getSelectedIndex() == PREDEFINED_STYLE);
public ColorWithThemeStyle update() {
ColorWithThemeStyle colorWithPreStyle = new ColorWithThemeStyle();
colorWithPreStyle.setThemed(preButton.getSelectedIndex() == PREDEFINED_STYLE);
colorWithPreStyle.setColor(colorSelectBox.getSelectObject());
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.NameableCreator;
import com.fr.design.gui.controlpane.ShortCut4JControlPane;
import com.fr.design.gui.ilist.ModNameActionListener;
import com.fr.design.menu.ShortCut;
import com.fr.general.NameObject;
import com.fr.stable.Nameable;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.util.ArrayList;
import java.util.Iterator;
@ -25,14 +22,6 @@ import java.util.Iterator;
*/
public class ChartPreStyleListPane extends JListControlPane {
ChartPreStyleManagerPane chartPreStyleManagerPane;
public ChartPreStyleListPane(ChartPreStyleManagerPane chartPreStyleManagerPane) {
super();
this.chartPreStyleManagerPane = chartPreStyleManagerPane;
initListener();
}
/**
* 创建有名字的creator
*
@ -53,13 +42,7 @@ public class ChartPreStyleListPane extends JListControlPane {
@Override
public BasicBeanPane createPaneByCreators(NameableCreator creator) {
return new ChartPreStylePane() {
@Override
protected void refreshWhenStyleChange(ChartColorMatching preStyle) {
super.refreshWhenStyleChange(preStyle);
chartPreStyleManagerPane.refreshDefaultColorBox();
}
};
return new ChartPreStylePane();
}
@ -82,21 +65,6 @@ public class ChartPreStyleListPane extends JListControlPane {
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() {
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance().mirror();
ArrayList list = new ArrayList();
@ -111,15 +79,10 @@ public class ChartPreStyleListPane extends JListControlPane {
Nameable[] values = (Nameable[]) list.toArray(new Nameable[list.size()]);
populate(values);
if (config.containsName(config.getCurrentStyle())) {
this.setSelectedName(config.getCurrentStyle());
}
}
public void updateBean() {
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
Nameable[] values = update();
config.clearAllPreStyle();

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

@ -1,24 +1,10 @@
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.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
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.Dimension;
/**
* 图表预定义管理 界面, 在工具栏-服务器管理中.
@ -28,8 +14,6 @@ import java.awt.Dimension;
*/
public class ChartPreStyleManagerPane extends BasicPane {
private ColorSchemeComboBox defaultColorBox;
private ChartPreStyleListPane chartPreStyleListPane;
public ChartPreStyleManagerPane() {
@ -38,78 +22,20 @@ public class ChartPreStyleManagerPane extends BasicPane {
private void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel colorBoxPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
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);
chartPreStyleListPane = new ChartPreStyleListPane();
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
protected String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Report_ServerM_Predefined_Styles");
}
public void populateBean() {
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
String currentStyle = config.getCurrentStyle();
defaultColorBox.setSelectedItem(currentStyle);
chartPreStyleListPane.populateBean();
}
public void updateBean() {
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
config.setCurrentStyle(GeneralUtils.objectToString(defaultColorBox.getSelectedItem()));
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() {
return new VanChartBorderWithRadiusPane();
//TODO Bjorn 边框自动回退
//return new VanChartBorderWithRadiusPane(true);
return new VanChartBorderWithRadiusPane(true);
}
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);
}
protected void styleSelectBoxChange() {
//TODO Bjorn 配色预定义回退
//getCustomPane().setVisible(getStyleSelectBox().getSelectedIndex() != 0);
super.styleSelectBoxChange();
}
protected ColorSchemeComboBox createColorSchemeComboBox() {
return new ColorSchemeComboBox();
//TODO Bjorn 配色预定义回退
//return new ColorSchemeComboBox(null, true);
return new ColorSchemeComboBox(null, true);
}
protected void initLayout() {
@ -63,21 +55,19 @@ public class VanChartFillStylePane extends ColorFillStylePane implements Designe
}
public void populateBean(AttrFillStyle condition) {
/* if (condition.isPredefinedStyle()) {
if (condition.isThemed()) {
getStyleSelectBox().setSelectType(ColorSchemeComboBox.SelectType.DEFAULT);
return;
}*/
//TODO Bjorn 配色预定义回退
}
populateBean(condition.getColorFillStyle());
}
public void updateBean(AttrFillStyle attrFillStyle) {
/* if (getStyleSelectBox().getSelectedIndex() == 0) {
attrFillStyle.setPredefinedStyle(true);
if (getStyleSelectBox().getSelectedIndex() == 0) {
attrFillStyle.setThemed(true);
return;
}
attrFillStyle.setPredefinedStyle(false);*/
//TODO Bjorn 配色预定义回退
attrFillStyle.setThemed(false);
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;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.type.TextAlign;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
public class VanChartLabelContentPane extends VanChartTooltipContentPane {
@ -22,12 +24,11 @@ public class VanChartLabelContentPane extends VanChartTooltipContentPane {
return new AttrTooltipContent(TextAlign.CENTER);
}
//TODO Bjorn 标签面板回退
/* public JPanel createCommonStylePane() {
public JPanel createCommonStylePane() {
if (isInCondition()) {
return super.createCommonStylePane();
}
setTextAttrPane(new ChartTextAttrPaneWithPreStyle());
setTextAttrPane(new ChartTextAttrPaneWithThemeStyle());
JPanel stylePanel = new JPanel(new BorderLayout());
stylePanel.add(getTextAttrPane(), BorderLayout.CENTER);
@ -42,9 +43,9 @@ public class VanChartLabelContentPane extends VanChartTooltipContentPane {
}
if (hasTextStylePane()) {
this.getTextAttrPane().update(attrTooltipContent.getTextAttr());
if (!attrTooltipContent.getTextAttr().isPredefinedStyle()) {
if (!attrTooltipContent.getTextAttr().isThemed()) {
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;
import com.fr.chart.base.BackgroundWithPreStyle;
import com.fr.chart.base.BackgroundWithThemeStyle;
import com.fr.chart.chartglyph.GeneralInfo;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane;
@ -13,7 +13,7 @@ import com.fr.design.mainframe.backgroundpane.VanChartGradientPane;
* @version 10.0
* Created by Bjorn on 2020-09-08
*/
public class VanChartBackgroundPaneWithPreStyle extends VanChartBackgroundPane {
public class VanChartBackgroundPaneWithThemeStyle extends VanChartBackgroundPane {
private static final int PREDEFINED_STYLE = 0;
@ -21,7 +21,7 @@ public class VanChartBackgroundPaneWithPreStyle extends VanChartBackgroundPane {
protected void initList() {
paneList.add(new NullBackgroundQuickPane() {
public String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Chart_Predefined");
return Toolkit.i18nText("Fine-Design_Chart_Follow_Theme");
}
});
paneList.add(new NullBackgroundQuickPane());
@ -31,8 +31,8 @@ public class VanChartBackgroundPaneWithPreStyle extends VanChartBackgroundPane {
}
public void populateBackground(GeneralInfo attr, int begin) {
BackgroundWithPreStyle backgroundWithPreStyle = attr.getBackgroundWithPreStyle();
if (backgroundWithPreStyle.isPredefinedStyle()) {
BackgroundWithThemeStyle backgroundWithPreStyle = attr.getBackgroundWithPreStyle();
if (backgroundWithPreStyle.isThemed()) {
typeComboBox.setSelectedIndex(PREDEFINED_STYLE);
return;
}
@ -41,10 +41,10 @@ public class VanChartBackgroundPaneWithPreStyle extends VanChartBackgroundPane {
public void updateBackground(GeneralInfo attr) {
if (typeComboBox.getSelectedIndex() == PREDEFINED_STYLE) {
attr.getBackgroundWithPreStyle().setPredefinedStyle(true);
attr.getBackgroundWithPreStyle().setThemed(true);
return;
}
attr.getBackgroundWithPreStyle().setPredefinedStyle(false);
attr.getBackgroundWithPreStyle().setThemed(false);
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.ilable.UILabel;
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.widget.FRWidgetFactory;
import com.fr.stable.CoreConstants;
@ -18,7 +18,7 @@ import java.awt.Component;
*/
public class VanChartBorderPaneWithPreStyle extends VanChartBorderPane {
private ColorSelectBoxWithPreStyle colorSelectBoxWithPreStyle;
private ColorSelectBoxWithThemeStyle colorSelectBoxWithThemeStyle;
public VanChartBorderPaneWithPreStyle() {
super();
@ -26,7 +26,7 @@ public class VanChartBorderPaneWithPreStyle extends VanChartBorderPane {
protected void initComponents() {
currentLineCombo = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
colorSelectBoxWithPreStyle = new ColorSelectBoxWithPreStyle(100);
colorSelectBoxWithThemeStyle = new ColorSelectBoxWithThemeStyle(100);
}
protected Component[][] getUseComponent() {
@ -35,7 +35,7 @@ public class VanChartBorderPaneWithPreStyle extends VanChartBorderPane {
return new Component[][]{
new Component[]{null, null},
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) {
return;
}
colorSelectBoxWithPreStyle.populate(attr.getColorWithPreStyle());
colorSelectBoxWithThemeStyle.populate(attr.getColorWithPreStyle());
}
public void update(GeneralInfo attr) {
@ -52,6 +52,6 @@ public class VanChartBorderPaneWithPreStyle extends VanChartBorderPane {
if (attr == null) {
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
protected VanChartBackgroundPane creatBackgroundPane() {
//TODO Bjorn 地图图例背景自动逻辑
return new VanChartBackgroundWithOutImagePane();
//return new VanChartBackgroundWithOutImagePane(true);
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.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.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartLegend;
import com.fr.plugin.chart.type.LayoutType;
@ -287,9 +288,7 @@ public class VanChartPlotLegendPane extends BasicPane {
}
private JPanel createTitleStylePane() {
//TODO Bjorn 图例预定义逻辑
//textAttrPane = new ChartTextAttrPaneWithPreStyle();
textAttrPane = new ChartTextAttrPane();
textAttrPane = new ChartTextAttrPaneWithThemeStyle();
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.TableLayoutHelper;
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.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartTitle;
@ -57,7 +57,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private JPanel titlePane;
private TinyFormulaPane titleContent;
private ChartTextAttrPane textAttrPane;
private ChartTextAttrPaneWithThemeStyle textAttrPane;
private UIButtonGroup<Integer> alignmentPane;
private VanChartBackgroundWithOutShadowWithRadiusPane backgroundPane;
private UIToggleButton useHtml;
@ -188,9 +188,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
}
private JPanel createTitleStylePane() {
//TODO Bjorn 标题预定义逻辑
//textAttrPane = new ChartTextAttrPaneWithPreStyle();
textAttrPane = new ChartTextAttrPane();
textAttrPane = new ChartTextAttrPaneWithThemeStyle();
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() {
//TODO Bjorn 地图标题背景自动逻辑
//return new VanChartBackgroundWithOutShadowWithRadiusPane(true);
return new VanChartBackgroundWithOutShadowWithRadiusPane();
return new VanChartBackgroundWithOutShadowWithRadiusPane(true);
}
}

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.mainframe.chart.PaneTitleConstants;
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.widget.FRWidgetFactory;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
@ -85,9 +86,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected LineComboBox axisLineStyle;
//TODO Bjorn 坐标轴面板回退
protected ColorSelectBox axisLineColor;
//protected ColorSelectBoxWithPreStyle axisLineColor;
protected ColorSelectBoxWithThemeStyle axisLineColor;
protected UIButtonGroup<AxisTickLineType> mainTick;
protected UIButtonGroup<AxisTickLineType> secondTick;
@ -381,31 +380,16 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
}
protected ChartTextAttrPane getChartTextAttrPane() {
//TODO Bjorn 坐标轴面板回退
/* return new ChartTextAttrPaneWithPreStyle() {
return new ChartTextAttrPaneWithThemeStyle() {
protected double getEdithAreaWidth() {
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) {
axisLineStyle = createLineComboBox();
//TODO Bjorn 坐标轴面板回退
//axisLineColor = new ColorSelectBoxWithPreStyle(100);
axisLineColor = new ColorSelectBox(100);
axisLineColor = new ColorSelectBoxWithThemeStyle(100);
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};
mainTick = new UIButtonGroup<AxisTickLineType>(strings, values);
@ -423,9 +407,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
return new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle},
//TODO Bjorn 坐标轴面板回退
//new Component[]{axisLineColor, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor},
new Component[]{axisLineColor, null},
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},
};
@ -735,9 +717,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
axisLineStyle.setSelectedLineStyle(axis.getAxisStyle());
}
if (axisLineColor != null) {
axisLineColor.setSelectObject(axis.getAxisColor());
//TODO Bjorn 坐标轴面板回退
//axisLineColor.populate(axis.getLineColorWithPreStyle());
axisLineColor.populate(axis.getLineColorWithPreStyle());
}
if (mainTick != null) {
mainTick.setSelectedItem(axis.getMainTickLine());
@ -880,9 +860,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
axis.setAxisStyle(axisLineStyle.getSelectedLineStyle());
}
if (axisLineColor != null) {
axis.setAxisColor(axisLineColor.getSelectObject());
//TODO Bjorn 坐标轴面板回退
//axis.setLineColorWithPreStyle(axisLineColor.update());
axis.setLineColorWithPreStyle(axisLineColor.update());
}
if (mainTick != null) {
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.gui.style.ChartTextAttrPane;
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.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartGaugeAxis;
@ -102,9 +103,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane {
if (isMulti(gaugeStyle)) {
return new ChartTextAttrPaneWithAuto(FontAutoType.SIZE_AND_COLOR);
} else {
return new ChartTextAttrPane();
//TODO Bjorn 坐标轴面板回退
//return new ChartTextAttrPaneWithPreStyle();
return new ChartTextAttrPaneWithThemeStyle();
}
}

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[][]{
new Component[]{null,null} ,
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle},
//TODO Bjorn 坐标轴面板回退
//new Component[]{axisLineColor, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor},
new Component[]{axisLineColor, null},
};
}

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[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle},
//TODO Bjorn 坐标轴面板回退
//new Component[]{axisLineColor, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor},
new Component[]{axisLineColor, null},
};
}

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.TableLayout4VanChartHelper;
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.style.background.radar.VanChartRadarAxisAreaPane;
@ -45,13 +46,11 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
protected JPanel createContentPane() {
contentPane = new JPanel(new BorderLayout());
chartBorderPane = new VanChartBorderWithRadiusPane();
chartBackgroundPane = new VanChartBackgroundPane();
//TODO Bjorn 背景面板回退
/* if(isPlot) {
if(isPlot) {
chartBackgroundPane = new VanChartBackgroundPane();
} else {
chartBackgroundPane = new VanChartBackgroundPaneWithPreStyle();
}*/
chartBackgroundPane = new VanChartBackgroundPaneWithThemeStyle();
}
double p = TableLayout.PREFERRED;
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.layout.TableLayout;
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.general.ComparatorUtils;
import com.fr.plugin.chart.VanChartAttrHelper;
@ -43,11 +44,8 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
private LineTypeComboBox horizonLineType;
private LineTypeComboBox verticalLineType;
private ColorSelectBox horizontalColorBox;
private ColorSelectBox verticalColorBox;
//TODO Bjorn 背景坐标轴面板回退
/* private ColorSelectBoxWithPreStyle horizontalColorBox;
private ColorSelectBoxWithPreStyle verticalColorBox;*/
private ColorSelectBoxWithThemeStyle horizontalColorBox;
private ColorSelectBoxWithThemeStyle verticalColorBox;
private JPanel horizontalColorPane;
private JPanel verticalColorPane;
@ -56,11 +54,8 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
}
private void initComponents() {
horizontalColorBox = new ColorSelectBox(PREFERRED_WIDTH);
verticalColorBox = new ColorSelectBox(PREFERRED_WIDTH);
//TODO Bjorn 背景坐标轴面板回退
/* horizontalColorBox = new ColorSelectBoxWithPreStyle(PREFERRED_WIDTH);
verticalColorBox = new ColorSelectBoxWithPreStyle(PREFERRED_WIDTH);*/
horizontalColorBox = new ColorSelectBoxWithThemeStyle(PREFERRED_WIDTH);
verticalColorBox = new ColorSelectBoxWithThemeStyle(PREFERRED_WIDTH);
horizonLineType = 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() {
//TODO Bjorn 背景坐标轴面板回退
Component[][] upComponent = new Component[][]{
new Component[]{null, null},
new Component[]{null, horizontalColorBox}
//new Component[]{horizontalColorBox, null}
new Component[]{horizontalColorBox, null}
};
horizontalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(upComponent);
Component[][] downComponent = new Component[][]{
new Component[]{null, null},
new Component[]{null, verticalColorBox}
//new Component[]{verticalColorBox, null}
new Component[]{verticalColorBox, null}
};
verticalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(downComponent);
@ -228,16 +220,13 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
VanChartAxis defaultXAxis = rectanglePlot.getDefaultXAxis();
VanChartAxis defaultYAxis = rectanglePlot.getDefaultYAxis();
//TODO Bjorn 背景坐标轴面板回退
if (defaultXAxis != null) {
//verticalColorBox.populate(defaultXAxis.getMainGridColorWithPreStyle());
verticalColorBox.setSelectObject(defaultXAxis.getMainGridColor());
verticalColorBox.populate(defaultXAxis.getMainGridColorWithPreStyle());
verticalLineType.setSelectedItem(defaultXAxis.getGridLineType());
}
if (defaultYAxis != null) {
//horizontalColorBox.populate(defaultYAxis.getMainGridColorWithPreStyle());
horizontalColorBox.setSelectObject(defaultYAxis.getMainGridColor());
horizontalColorBox.populate(defaultYAxis.getMainGridColorWithPreStyle());
horizonLineType.setSelectedItem(defaultYAxis.getGridLineType());
}
}
@ -264,16 +253,13 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
VanChartAxis defaultXAxis = rectanglePlot.getDefaultXAxis();
VanChartAxis defaultYAxis = rectanglePlot.getDefaultYAxis();
//TODO Bjorn 背景坐标轴面板回退
if (defaultXAxis != null) {
//defaultXAxis.setMainGridColorWithPreStyle(verticalColorBox.update());
defaultXAxis.setMainGridColor(verticalColorBox.getSelectObject());
defaultXAxis.setMainGridColorWithPreStyle(verticalColorBox.update());
defaultXAxis.setGridLineType((LineType) verticalLineType.getSelectedItem());
}
if (defaultYAxis != null) {
//defaultYAxis.setMainGridColorWithPreStyle(horizontalColorBox.update());
defaultYAxis.setMainGridColor(horizontalColorBox.getSelectObject());
defaultYAxis.setMainGridColorWithPreStyle(horizontalColorBox.update());
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.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.general.ComparatorUtils;
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.TableLayout4VanChartHelper;
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 javax.swing.JPanel;
@ -103,15 +105,12 @@ public class VanChartDataSheetPane extends AbstractVanChartScrollPane<Chart> {
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
}
//TODO Bjorn 数据表面板回退
protected VanChartBorderPane createBorderPanePane() {
return new VanChartBorderPane();
//return new VanChartBorderPaneWithPreStyle();
return new VanChartBorderPaneWithPreStyle();
}
protected ChartTextAttrPane createChartTextAttrPane() {
return new ChartTextAttrPane();
//return new ChartTextAttrPaneWithPreStyle();
return new ChartTextAttrPaneWithThemeStyle();
}
@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;
}
//TODO Bjorn 仪表盘自动逻辑
protected boolean isFontColorAuto() {
return getGaugeStyle() == GaugeStyle.RING || getGaugeStyle() == GaugeStyle.SLOT;
}
protected boolean hasLabelPosition(Plot plot) {
switch (getGaugeStyle()) {
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;
}
//TODO Bjorn 仪表盘自动逻辑
protected boolean isFontColorAuto() {
return false;
//return true;
return true;
}
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() {
return new VanChartBorderPane();
//TODO Bjorn 边框自动回退
//return new VanChartBorderPane(true);
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.layout.TableLayout;
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.plugin.chart.attr.plot.VanChartPlot;
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
protected void initList() {
paneList.add(new ColorBackgroundQuickPane());
}
};*/
};
backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow();
selectBackgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow() {
protected String labelName() {
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 e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f};
//TODO Bjorn
double[] rowSize = {p, p, p, p, p, p, p};
double[] rowSize = {p, p, p, p, p, p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{createGaugeLayoutPane()},
new Component[]{createGaugeStylePane(rowSize, new double[]{f, e})},
@ -221,14 +220,12 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
private Component[][] getDiffComponentsWithGaugeStyle() {
GaugeStyle style = getGaugeStyle();
switch (style) {
//TODO Bjorn 仪表盘样式自动逻辑
case RING:
initRotate();
return new Component[][]{
new Component[]{null, null},
getPaneBackgroundColor(),
/* getPaneBackgroundColorAuto(),
new Component[]{null, paneBackgroundColor},*/
getPaneBackgroundColorAuto(),
new Component[]{null, paneBackgroundColor},
getInnerPaneBackgroundColor(),
new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null},
getChutePercent()
@ -237,9 +234,8 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
return new Component[][]{
new Component[]{null, null},
getNeedleColor(),
getSlotBackgroundColor(),
/* getSlotBackgroundColorAuto(),
new Component[]{null, slotBackgroundColor},*/
getSlotBackgroundColorAuto(),
new Component[]{null, slotBackgroundColor},
new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null},
getChutePercent()
};
@ -247,33 +243,25 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
return new Component[][]{
new Component[]{null, null},
getNeedleColor(),
getSlotBackgroundColor(),
/*getSlotBackgroundColorAuto(),
new Component[]{null, slotBackgroundColor},*/
getSlotBackgroundColorAuto(),
new Component[]{null, slotBackgroundColor},
new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Length_Set")), null},
getThermometerWidth()
};
default:
return new Component[][]{
new Component[]{null, null},
getHingeColor(),
/* getHingeColorAuto(),
new Component[]{null, hingeColor},*/
getHingeColorAuto(),
new Component[]{null, hingeColor},
getHingeBackgroundColor(),
getNeedleColor(),
getPaneBackgroundColor(),
/* getPaneBackgroundColorAuto(),
new Component[]{null, paneBackgroundColor},*/
getPaneBackgroundColorAuto(),
new Component[]{null, paneBackgroundColor},
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() {
hingeColor = new ColorSelectBox(120);
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() {
//TODO Bjorn 地图背景自动
//borderWithAlphaPane = new VanChartBorderWithAlphaPane(true);
borderWithAlphaPane = new VanChartBorderWithAlphaPane();
borderWithAlphaPane = new VanChartBorderWithAlphaPane(true);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
@ -355,8 +353,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
}
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")});
initNullValueListener();
nullValueColorBox = new ColorSelectBox(80);
@ -373,10 +370,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
new Component[]{text, nullValueAuto},
new Component[]{null, nullValueColorBox},
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);*/
nullValueColorBox = new ColorSelectBox(80);
return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_NULL_Value_Color"), nullValueColorBox);
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
}
@ -593,15 +587,13 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
markerTypeCom.setSelectedItem(mapPlot.getMapMarkerType().toLocalString());
}
if (nullValueColorBox != null) {
//TODO Bjorn 地图空值背景自动
/* if (((VanChartMapPlot) plot).isAutoNullValue()) {
if (((VanChartMapPlot) plot).isAutoNullValue()) {
nullValueAuto.setSelectedIndex(0);
} else {
nullValueAuto.setSelectedIndex(1);
}
nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor());
checkNullValueButton();*/
nullValueColorBox.setSelectObject(mapPlot.getNullValueColor());
checkNullValueButton();
}
//大数据模式 恢复用注释。下面3行删除。
if (lineMapLargeDataModelGroup != null) {
@ -623,8 +615,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
}
}
if (nullValueColorBox != null) {
//TODO Bjorn 地图空值背景自动
//((VanChartMapPlot) plot).setAutoNullValue(nullValueAuto.getSelectedIndex() == 0);
((VanChartMapPlot) plot).setAutoNullValue(nullValueAuto.getSelectedIndex() == 0);
mapPlot.setNullValueColor(nullValueColorBox.getSelectObject());
}
//大数据模式 恢复用注释。下面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() {
return gisButton.getSelectedIndex() == 1;
}
private boolean isAuto() {
return gisButton.getSelectedIndex() == 0;
}
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);
gisGaoDeLayer = new UIComboBox(MapLayerConfigManager.getGaoDeLayerItems());
gisButton.addActionListener(event -> {
@ -94,6 +99,9 @@ public class GisLayerPane extends JPanel implements UIObserver {
layerPaneCheckPane = new JPanel(new CardLayout()) {
@Override
public Dimension getPreferredSize() {
if (isAuto()) {
return new Dimension(0, 0);
}
if (isStandardGis()) {
return gisGaoDeLayer.getPreferredSize();
} else {
@ -101,6 +109,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
}
}
};
layerPaneCheckPane.add(new JPanel(), "auto");
layerPaneCheckPane.add(gisGaoDeLayer, "standard");
layerPaneCheckPane.add(gisLayer, "custom");
@ -129,7 +138,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
layerCardPane = new JPanel(new CardLayout()) {
@Override
public Dimension getPreferredSize() {
if (isStandardGis()) {
if (isStandardGis() || isAuto()) {
return new Dimension(0, 0);
}
String itemName = Utils.objectToString(gisLayer.getSelectedItem());
@ -188,7 +197,9 @@ public class GisLayerPane extends JPanel implements UIObserver {
private void refreshZoomLevel() {
//gis图层不同,对应的缩放等级不同。
ZoomLevel[] levels;
if (isStandardGis()) {
if (isAuto()) {
levels = MapStatusPane.ZOOM_LEVELS;
} else if (isStandardGis()) {
if (gisGaoDeLayer.getSelectedIndex() == gisGaoDeLayer.getItemCount() - 1) {
levels = MapStatusPane.ZOOM_LEVELS;
} else {
@ -209,7 +220,14 @@ public class GisLayerPane extends JPanel implements UIObserver {
private void checkLayerCardPane() {
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() {
@ -218,10 +236,6 @@ public class GisLayerPane extends JPanel implements UIObserver {
}
public void resetGisLayer(VanChartMapPlot mapPlot) {
//TODO Bjorn 地图gis图层自动逻辑
/* mapPlot.getGisLayer().setGisLayerType(GISLayerType.AUTO);
mapPlot.getGisLayer().setLayerName(GISLayerType.getLocString(GISLayerType.AUTO));*/
GisLayer defaultGisLayer = mapPlot.getDefaultGisLayer();
mapPlot.setGisLayer(defaultGisLayer);
populate(defaultGisLayer);
@ -229,6 +243,9 @@ public class GisLayerPane extends JPanel implements UIObserver {
public void populate(GisLayer layer) {
switch (layer.getGisLayerType()) {
case AUTO:
gisButton.setSelectedIndex(0);
break;
case GAO_DE_API:
case LAYER_NULL:
populateStandardGis(layer);
@ -243,7 +260,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
}
private void populateStandardGis(GisLayer layer) {
gisButton.setSelectedIndex(0);
gisButton.setSelectedIndex(1);
if (layer.getGisLayerType() == GISLayerType.LAYER_NULL) {
gisGaoDeLayer.setSelectedIndex(gisGaoDeLayer.getItemCount() - 1);
} else {
@ -252,7 +269,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
}
private void populateCustomGis(GisLayer layer) {
gisButton.setSelectedIndex(1);
gisButton.setSelectedIndex(2);
gisLayer.setSelectedItem(layer.getShowItemName());
switch (layer.getGisLayerType()) {
@ -266,7 +283,10 @@ public class GisLayerPane extends JPanel implements UIObserver {
}
public void update(GisLayer layer) {
if (isStandardGis()) {
if (isAuto()) {
layer.setGisLayerType(GISLayerType.AUTO);
layer.setLayerName(GISLayerType.getLocString(GISLayerType.AUTO));
} else if (isStandardGis()) {
updateStandardGis(layer);
} else {
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;
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.VanChartHtmlLabelPaneWithBackGroundLabel;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
/**
* 散点图标签界面
@ -21,12 +24,11 @@ public class VanChartScatterLabelContentPane extends VanChartScatterTooltipCont
return new VanChartHtmlLabelPaneWithBackGroundLabel();
}
//TODO Bjorn 散点图标签预定义样式
/* public JPanel createCommonStylePane() {
public JPanel createCommonStylePane() {
if (isInCondition()) {
return super.createCommonStylePane();
}
setTextAttrPane(new ChartTextAttrPaneWithPreStyle());
setTextAttrPane(new ChartTextAttrPaneWithThemeStyle());
JPanel stylePanel = new JPanel(new BorderLayout());
stylePanel.add(getTextAttrPane(), BorderLayout.CENTER);
@ -41,9 +43,9 @@ public class VanChartScatterLabelContentPane extends VanChartScatterTooltipCont
}
if (hasTextStylePane()) {
this.getTextAttrPane().update(attrTooltipContent.getTextAttr());
if (!attrTooltipContent.getTextAttr().isPredefinedStyle()) {
if (!attrTooltipContent.getTextAttr().isThemed()) {
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.chart.BaseChartCollection;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.log.FineLoggerFactory;
import com.fr.poly.creator.BlockCreator;
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.TemplateBlock;
import java.awt.Point;
import java.lang.reflect.Constructor;
import java.util.HashMap;
import java.util.Map;
import java.awt.Point;
/**
* @author richer
@ -55,6 +56,7 @@ public class PolyUtils {
}
public static BlockCreator createCreator(BaseChartCollection cc) {
cc.setThemeStyle(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplateTheme());
TemplateBlock block = new PolyChartBlock(cc);
return createCreator(block);
}

Loading…
Cancel
Save