Browse Source

消除一波插件警告

feature/x
obo 12 months ago
parent
commit
33d0443441
  1. 2
      designer-base/src/main/java/com/fr/widgettheme/designer/WidgetThemeDisplayAction.java
  2. 2
      designer-base/src/main/java/com/fr/widgettheme/designer/WidgetThemeDisplayConfigPane.java
  3. 88
      designer-base/src/main/java/com/fr/widgettheme/theme/edit/ParamContainerBackgroundPane.java
  4. 1
      designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java
  5. 74
      designer-base/src/main/java/com/fr/widgettheme/theme/panel/WidgetDisplayFormThemePreviewPane.java

2
designer-base/src/main/java/com/fr/widgettheme/designer/WidgetThemeDisplayAction.java

@ -14,6 +14,8 @@ import com.fr.widgettheme.control.attr.WidgetDisplayEnhanceMarkAttr;
import java.awt.event.ActionEvent;
/**
* 控件主题显示增强菜单action
*
* @author Bruce.Deng
* @since 11.0
* Created on 2022/11/28

2
designer-base/src/main/java/com/fr/widgettheme/designer/WidgetThemeDisplayConfigPane.java

@ -12,6 +12,8 @@ import javax.swing.JPanel;
import java.awt.Color;
/**
* 控件主题显示增强配置窗口
*
* @author Bruce.Deng
* @since 11.0
* Created on 2022/11/28

88
designer-base/src/main/java/com/fr/widgettheme/theme/edit/ParamContainerBackgroundPane.java

@ -17,63 +17,51 @@ import java.util.List;
import java.util.Set;
/**
* 参数面板背景编辑窗口
*
* @author Bruce.Deng
* @since 11.0
* Created on 2023/1/5
*/
public class ParamContainerBackgroundPane extends BackgroundPane {
public ParamContainerBackgroundPane(){
private NullBackgroundQuickPane nullBackgroundPane;
private ColorBackgroundQuickPane colorBackgroundPane;
private ImageBackgroundQuickPane imageBackgroundPane;
private GradientBackgroundQuickPane gradientBackgroundPane;
private TextureBackgroundQuickPane textureBackgroundPane;
private PatternBackgroundQuickPane patternBackgroundPane;
public ParamContainerBackgroundPane() {
super();
}
@Override
protected BackgroundQuickPane[] supportKindsOfBackgroundUI() {
NullBackgroundQuickPane nullBackgroundPane = new NullBackgroundQuickPane();
ColorBackgroundQuickPane colorBackgroundPane = new ColorBackgroundQuickPane(true);
colorBackgroundPane.registerChangeListener(new UIObserverListener() {
@Override
public void doChange() {
fireStateChanged();
}
});
ImageBackgroundQuickPane imageBackgroundPane = new ImageBackgroundQuickPane();
imageBackgroundPane.registerChangeListener(new UIObserverListener() {
@Override
public void doChange() {
fireStateChanged();
}
});
GradientBackgroundQuickPane gradientBackgroundPane = createGradientBackgroundQuickPane();
gradientBackgroundPane.registerChangeListener(new UIObserverListener() {
@Override
public void doChange() {
fireStateChanged();
}
});
TextureBackgroundQuickPane textureBackgroundPane = new TextureBackgroundQuickPane();
textureBackgroundPane.registerChangeListener(new UIObserverListener() {
@Override
public void doChange() {
fireStateChanged();
}
});
PatternBackgroundQuickPane patternBackgroundPane = new PatternBackgroundQuickPane();
patternBackgroundPane.registerChangeListener(new UIObserverListener() {
@Override
public void doChange() {
fireStateChanged();
}
});
List<BackgroundQuickPane> kinds = new ArrayList<BackgroundQuickPane>();
nullBackgroundPane = new NullBackgroundQuickPane();
colorBackgroundPane = new ColorBackgroundQuickPane(true);
colorBackgroundPane.registerChangeListener(this::fireStateChanged);
imageBackgroundPane = new ImageBackgroundQuickPane();
imageBackgroundPane.registerChangeListener(this::fireStateChanged);
gradientBackgroundPane = createGradientBackgroundQuickPane();
gradientBackgroundPane.registerChangeListener(this::fireStateChanged);
textureBackgroundPane = new TextureBackgroundQuickPane();
textureBackgroundPane.registerChangeListener(this::fireStateChanged);
patternBackgroundPane = new PatternBackgroundQuickPane();
patternBackgroundPane.registerChangeListener(this::fireStateChanged);
return createBackgroundQuickPanes();
}
private BackgroundQuickPane[] createBackgroundQuickPanes() {
List<BackgroundQuickPane> kinds = new ArrayList<>();
kinds.add(nullBackgroundPane);
kinds.add(colorBackgroundPane);
@ -85,18 +73,14 @@ public class ParamContainerBackgroundPane extends BackgroundPane {
Set<BackgroundQuickUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(BackgroundQuickUIProvider.MARK_STRING);
for (BackgroundQuickUIProvider provider : providers) {
BackgroundQuickPane newTypePane = provider.appearanceForBackground();
newTypePane.registerChangeListener(new UIObserverListener() {
@Override
public void doChange() {
fireStateChanged();
}
});
newTypePane.registerChangeListener(this::fireStateChanged);
kinds.add(newTypePane);
}
return kinds.toArray(new BackgroundQuickPane[kinds.size()]);
}
protected GradientBackgroundQuickPane createGradientBackgroundQuickPane() {
// 使用默认的150宽度构建渐变条
return new GradientBackgroundQuickPane();

1
designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java

@ -54,7 +54,6 @@ public class DesktopWidgetStyleEditPane<T extends TemplateTheme> extends WidgetS
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Color")), colorSelectBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Style")), stylePane},
// todo 预览
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Line")), lineComboBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Radius")), borderRadiusSpinner},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Font_Size")), fontSizeComoBox},

74
designer-base/src/main/java/com/fr/widgettheme/theme/panel/WidgetDisplayFormThemePreviewPane.java

@ -129,38 +129,7 @@ public class WidgetDisplayFormThemePreviewPane extends TemplateThemePreviewPane<
private ChartCollection initColumnChart() {
try {
VanChart chart = (VanChart) ChartTypeManager.getInstance().getCharts(VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID)[0].clone();
chart.getTitle().setTitleVisible(false);
VanChartTools vanChartTools = chart.getVanChartTools();
vanChartTools.setSort(false);
vanChartTools.setExport(false);
vanChartTools.setFullScreen(false);
VanChartColumnPlot plot = chart.getPlot();
AttrLabel defaultAttrLabel = plot.getDefaultAttrLabel();
defaultAttrLabel.setEnable(true);
defaultAttrLabel.getAttrLabelDetail().getBorder().setBorderStyle(0);
defaultAttrLabel.getAttrLabelDetail().getBackground().setBackground(null);
plot.getConditionCollection().getDefaultAttr().addDataSeriesCondition(defaultAttrLabel);
plot.getLegend().setPosition(Constants.TOP);
plot.getGradientStyle().setGradientType(GradientType.NONE);
plot.setSeriesOverlapPercent(30);
plot.setCategoryIntervalPercent(30);
VanChartAxis defaultYAxis = plot.getDefaultYAxis();
Title title = new Title();
title.setTextObject(Toolkit.i18nText("Fine-Design_Chart_Axis_Title"));
title.getTextAttr().setRotation(-90);
title.getTextAttr().setThemed(true);
defaultYAxis.setTitle(title);
defaultYAxis.setShowAxisTitle(true);
defaultYAxis.setCustomMaxValue(true);
defaultYAxis.setCustomMinValue(true);
defaultYAxis.setCustomMainUnit(true);
defaultYAxis.setMaxValue(BaseFormula.createFormulaBuilder().build("=600"));
defaultYAxis.setMinValue(BaseFormula.createFormulaBuilder().build("=0"));
defaultYAxis.setMainUnit(BaseFormula.createFormulaBuilder().build("=200"));
initChart(chart);
Object[] category = {
Toolkit.i18nText("Fine-Design_Chart_Category") + "1",
Toolkit.i18nText("Fine-Design_Chart_Category") + "2",
@ -185,6 +154,47 @@ public class WidgetDisplayFormThemePreviewPane extends TemplateThemePreviewPane<
return null;
}
private void initChart(VanChart chart) {
chart.getTitle().setTitleVisible(false);
initVanChartsTools(chart.getVanChartTools());
VanChartColumnPlot plot = chart.getPlot();
AttrLabel defaultAttrLabel = plot.getDefaultAttrLabel();
initDefaultAttrLabel(defaultAttrLabel);
initPlot(plot);
plot.getConditionCollection().getDefaultAttr().addDataSeriesCondition(defaultAttrLabel);
VanChartAxis defaultYAxis = plot.getDefaultYAxis();
Title title = new Title();
title.setTextObject(Toolkit.i18nText("Fine-Design_Chart_Axis_Title"));
title.getTextAttr().setRotation(-90);
title.getTextAttr().setThemed(true);
defaultYAxis.setTitle(title);
defaultYAxis.setShowAxisTitle(true);
defaultYAxis.setCustomMaxValue(true);
defaultYAxis.setCustomMinValue(true);
defaultYAxis.setCustomMainUnit(true);
defaultYAxis.setMaxValue(BaseFormula.createFormulaBuilder().build("=600"));
defaultYAxis.setMinValue(BaseFormula.createFormulaBuilder().build("=0"));
defaultYAxis.setMainUnit(BaseFormula.createFormulaBuilder().build("=200"));
}
private void initVanChartsTools(VanChartTools vanChartTools) {
vanChartTools.setSort(false);
vanChartTools.setExport(false);
vanChartTools.setFullScreen(false);
}
private void initDefaultAttrLabel(AttrLabel defaultAttrLabel) {
defaultAttrLabel.setEnable(true);
defaultAttrLabel.getAttrLabelDetail().getBorder().setBorderStyle(0);
defaultAttrLabel.getAttrLabelDetail().getBackground().setBackground(null);
}
private void initPlot(VanChartColumnPlot plot) {
plot.getLegend().setPosition(Constants.TOP);
plot.getGradientStyle().setGradientType(GradientType.NONE);
plot.setSeriesOverlapPercent(30);
plot.setCategoryIntervalPercent(30);
}
/**
* 初始化饼图
*

Loading…
Cancel
Save