Browse Source

Pull request #9931: KERNEL-12366 设计器插件图标支持SVG

Merge in DESIGN/design from ~LINK.ZHAO/design:feature/x to feature/x

* commit '2601845c3b3a4697de67c0937bc06df524d94bd1':
  KERNEL-12366 设计器插件图标支持SVG 1、改下控件图标读icon时用的接口
feature/x
Link.Zhao-赵展 2 years ago
parent
commit
8bcfff2226
  1. 4
      designer-base/src/main/java/com/fr/design/ExtraDesignClassManager.java
  2. 2
      designer-base/src/main/java/com/fr/design/gui/core/WidgetOptionFactory.java
  3. 6
      designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java

4
designer-base/src/main/java/com/fr/design/ExtraDesignClassManager.java

@ -114,7 +114,7 @@ public class ExtraDesignClassManager extends AbstractExtraClassManager implement
for (ParameterWidgetOptionProvider provider : set) {
WidgetOption option = WidgetOptionFactory.createByWidgetClass(
provider.nameForWidget(),
IOUtils.readIcon(provider.iconPathForWidget()),
provider.iconPathForWidget(),
provider.classForWidget()
);
result.add(option);
@ -186,7 +186,7 @@ public class ExtraDesignClassManager extends AbstractExtraClassManager implement
if (provider.isContainer() == isContainer) {
WidgetOption option = WidgetOptionFactory.createByWidgetClass(
provider.nameForWidget(),
BaseUtils.readIcon(provider.iconPathForWidget()),
provider.iconPathForWidget(),
provider.classForWidget()
);
result.add(option);

2
designer-base/src/main/java/com/fr/design/gui/core/WidgetOptionFactory.java

@ -4,7 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.form.ui.Widget;
import javax.swing.*;
import javax.swing.Icon;
public class WidgetOptionFactory {

6
designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java

@ -4,6 +4,7 @@
package com.fr.design.designer.creator;
import com.fr.base.chart.BaseChartCollection;
import com.fr.base.svg.IconUtils;
import com.fr.base.theme.FineColorSynchronizer;
import com.fr.base.theme.FormTheme;
import com.fr.base.theme.TemplateTheme;
@ -72,7 +73,6 @@ import com.fr.form.ui.container.cardlayout.WCardTitleLayout;
import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.invoke.Reflect;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginContext;
@ -85,13 +85,13 @@ import com.fr.report.fit.ReportFitAttr;
import com.fr.report.fit.ReportFitConfig;
import com.fr.stable.StringUtils;
import com.fr.third.javax.annotation.Nonnull;
import java.util.Set;
import org.jetbrains.annotations.Nullable;
import javax.swing.Icon;
import java.awt.Container;
import java.awt.Dimension;
import java.util.List;
import java.util.Set;
/**
* XCreator的相关处理
@ -363,7 +363,7 @@ public class XCreatorUtils {
if (StringUtils.isEmpty(iconPath)) {
return null;
}
return IOUtils.readIcon(iconPath);
return IconUtils.readIcon(iconPath);
}
public static boolean containComponent(Container ancestor, Container xCreator) {

Loading…
Cancel
Save