Browse Source

消除一波插件警告

feature/x
obo 1 year 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. 70
      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; import java.awt.event.ActionEvent;
/** /**
* 控件主题显示增强菜单action
*
* @author Bruce.Deng * @author Bruce.Deng
* @since 11.0 * @since 11.0
* Created on 2022/11/28 * 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; import java.awt.Color;
/** /**
* 控件主题显示增强配置窗口
*
* @author Bruce.Deng * @author Bruce.Deng
* @since 11.0 * @since 11.0
* Created on 2022/11/28 * Created on 2022/11/28

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

@ -17,11 +17,21 @@ import java.util.List;
import java.util.Set; import java.util.Set;
/** /**
* 参数面板背景编辑窗口
*
* @author Bruce.Deng * @author Bruce.Deng
* @since 11.0 * @since 11.0
* Created on 2023/1/5 * Created on 2023/1/5
*/ */
public class ParamContainerBackgroundPane extends BackgroundPane { public class ParamContainerBackgroundPane extends BackgroundPane {
private NullBackgroundQuickPane nullBackgroundPane;
private ColorBackgroundQuickPane colorBackgroundPane;
private ImageBackgroundQuickPane imageBackgroundPane;
private GradientBackgroundQuickPane gradientBackgroundPane;
private TextureBackgroundQuickPane textureBackgroundPane;
private PatternBackgroundQuickPane patternBackgroundPane;
public ParamContainerBackgroundPane() { public ParamContainerBackgroundPane() {
super(); super();
} }
@ -29,51 +39,29 @@ public class ParamContainerBackgroundPane extends BackgroundPane {
@Override @Override
protected BackgroundQuickPane[] supportKindsOfBackgroundUI() { protected BackgroundQuickPane[] supportKindsOfBackgroundUI() {
NullBackgroundQuickPane nullBackgroundPane = new NullBackgroundQuickPane(); nullBackgroundPane = new NullBackgroundQuickPane();
ColorBackgroundQuickPane colorBackgroundPane = new ColorBackgroundQuickPane(true); colorBackgroundPane = new ColorBackgroundQuickPane(true);
colorBackgroundPane.registerChangeListener(new UIObserverListener() { colorBackgroundPane.registerChangeListener(this::fireStateChanged);
@Override
public void doChange() {
fireStateChanged();
}
});
ImageBackgroundQuickPane imageBackgroundPane = new ImageBackgroundQuickPane(); imageBackgroundPane = new ImageBackgroundQuickPane();
imageBackgroundPane.registerChangeListener(new UIObserverListener() { imageBackgroundPane.registerChangeListener(this::fireStateChanged);
@Override
public void doChange() {
fireStateChanged();
}
});
GradientBackgroundQuickPane gradientBackgroundPane = createGradientBackgroundQuickPane(); gradientBackgroundPane = createGradientBackgroundQuickPane();
gradientBackgroundPane.registerChangeListener(new UIObserverListener() { gradientBackgroundPane.registerChangeListener(this::fireStateChanged);
@Override
public void doChange() {
fireStateChanged();
}
});
TextureBackgroundQuickPane textureBackgroundPane = new TextureBackgroundQuickPane(); textureBackgroundPane = new TextureBackgroundQuickPane();
textureBackgroundPane.registerChangeListener(new UIObserverListener() { textureBackgroundPane.registerChangeListener(this::fireStateChanged);
@Override
public void doChange() {
fireStateChanged();
}
});
PatternBackgroundQuickPane patternBackgroundPane = new PatternBackgroundQuickPane(); patternBackgroundPane = new PatternBackgroundQuickPane();
patternBackgroundPane.registerChangeListener(new UIObserverListener() { patternBackgroundPane.registerChangeListener(this::fireStateChanged);
@Override
public void doChange() {
fireStateChanged();
}
});
return createBackgroundQuickPanes();
}
List<BackgroundQuickPane> kinds = new ArrayList<BackgroundQuickPane>(); private BackgroundQuickPane[] createBackgroundQuickPanes() {
List<BackgroundQuickPane> kinds = new ArrayList<>();
kinds.add(nullBackgroundPane); kinds.add(nullBackgroundPane);
kinds.add(colorBackgroundPane); kinds.add(colorBackgroundPane);
@ -85,18 +73,14 @@ public class ParamContainerBackgroundPane extends BackgroundPane {
Set<BackgroundQuickUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(BackgroundQuickUIProvider.MARK_STRING); Set<BackgroundQuickUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(BackgroundQuickUIProvider.MARK_STRING);
for (BackgroundQuickUIProvider provider : providers) { for (BackgroundQuickUIProvider provider : providers) {
BackgroundQuickPane newTypePane = provider.appearanceForBackground(); BackgroundQuickPane newTypePane = provider.appearanceForBackground();
newTypePane.registerChangeListener(new UIObserverListener() { newTypePane.registerChangeListener(this::fireStateChanged);
@Override
public void doChange() {
fireStateChanged();
}
});
kinds.add(newTypePane); kinds.add(newTypePane);
} }
return kinds.toArray(new BackgroundQuickPane[kinds.size()]); return kinds.toArray(new BackgroundQuickPane[kinds.size()]);
} }
protected GradientBackgroundQuickPane createGradientBackgroundQuickPane() { protected GradientBackgroundQuickPane createGradientBackgroundQuickPane() {
// 使用默认的150宽度构建渐变条 // 使用默认的150宽度构建渐变条
return new GradientBackgroundQuickPane(); 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[][]{ 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_Color")), colorSelectBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Style")), stylePane}, 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_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_Border_Radius")), borderRadiusSpinner},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Font_Size")), fontSizeComoBox}, 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() { private ChartCollection initColumnChart() {
try { try {
VanChart chart = (VanChart) ChartTypeManager.getInstance().getCharts(VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID)[0].clone(); VanChart chart = (VanChart) ChartTypeManager.getInstance().getCharts(VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID)[0].clone();
chart.getTitle().setTitleVisible(false); initChart(chart);
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"));
Object[] category = { Object[] category = {
Toolkit.i18nText("Fine-Design_Chart_Category") + "1", Toolkit.i18nText("Fine-Design_Chart_Category") + "1",
Toolkit.i18nText("Fine-Design_Chart_Category") + "2", Toolkit.i18nText("Fine-Design_Chart_Category") + "2",
@ -185,6 +154,47 @@ public class WidgetDisplayFormThemePreviewPane extends TemplateThemePreviewPane<
return null; 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