diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java index 453e4bc94..c57dfe00d 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java @@ -710,7 +710,7 @@ public class DBTableDataPane extends AbstractTableDataPane { strategyConfig = StrategyConfigAttrUtils.getStrategyConfig(dsName); - if (useGlobal(getTableData(), strategyConfig, tplPath)) { + if (useGlobal(getTableData(), strategyConfig)) { //使用全局配置 strategyConfig = StrategyConfigHelper.createStrategyConfig(true); } else if (getTableData().isShare()) { @@ -722,14 +722,13 @@ public class DBTableDataPane extends AbstractTableDataPane { return strategyConfig; } - private boolean useGlobal(DBTableData dbTableData, StrategyConfig strategyConfig, String tplPath) { + private boolean useGlobal(DBTableData dbTableData, StrategyConfig strategyConfig) { //非共享且配置为空或者指定使用全局配置时,检查是否全局开启 - if (!dbTableData.isShare() && (strategyConfig == null || strategyConfig.isUseGlobal())) { - //模版里面没有配置,检查模版是否被开启 - return StrategyConfigService.isTemplateEnabled(tplPath); + if (strategyConfig == null) { + return !dbTableData.isShare(); + } else { + return strategyConfig.isUseGlobal(); } - - return false; } @Override diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index 582fcb8d1..52807a6cb 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -5,6 +5,7 @@ import com.fr.base.BaseUtils; import com.fr.base.Parameter; import com.fr.base.ParameterMapNameSpace; import com.fr.base.TableDataNameSpace; +import com.fr.base.Utils; import com.fr.base.io.IOFile; import com.fr.data.TableDataSource; import com.fr.design.actions.UpdateAction; @@ -39,7 +40,7 @@ import com.fr.parser.BlockIntervalLiteral; import com.fr.parser.ColumnRowRangeInPage; import com.fr.parser.FRLexer; import com.fr.parser.FRParser; -import com.fr.parser.FunctionCall; +import com.fr.parser.NumberLiteral; import com.fr.parser.SheetIntervalLiteral; import com.fr.report.core.namespace.SimpleCellValueNameSpace; import com.fr.script.Calculator; @@ -54,6 +55,7 @@ import com.fr.stable.EssentialUtils; import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; import com.fr.stable.UtilEvalError; +import com.fr.stable.script.CRAddress; import com.fr.stable.script.ColumnRowRange; import com.fr.stable.script.Expression; import com.fr.stable.script.Node; @@ -99,6 +101,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringReader; +import java.text.NumberFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -729,15 +732,16 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { @Override public void actionPerformed(ActionEvent e) { String formulaText = formulaTextArea.getText().trim(); - if (containsUnsupportedSimulationFormulas(formulaText)) { + String formulaValidMessage = getFormulaValidMessage(formulaText); + String unSupportFormula = containsUnsupportedSimulationFormulas(formulaText); + if (unSupportFormula != null) { FineJOptionPane.showMessageDialog( FormulaPane.this, - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula_Unsupported_Formulas"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula_Unsupported_Formulas") + ":" + unSupportFormula, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.INFORMATION_MESSAGE); return; } - String formulaValidMessage = getFormulaValidMessage(formulaText); String messageTips; if (formulaValidMessage.equals(INVALID_FORMULA)) { messageTips = INVALID_FORMULA; @@ -777,20 +781,21 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { } }; - private boolean containsUnsupportedSimulationFormulas(String formulaText) { + private String containsUnsupportedSimulationFormulas(String formulaText) { try { Expression expression = Calculator.createCalculator().parse(formulaText); - String name = ((FunctionCall) expression.getConditionalExpression()).getName(); - if (UnsupportedSimulationFormulaHunter.isUnsupportedFomula(name)) { - return true; + UnsupportedFormulaScanner scanner = new UnsupportedFormulaScanner(); + if (!scanner.travelFormula(expression.getConditionalExpression())) { + return scanner.getUnSupportFormula(); } - UnsupportedSimulationFormulaHunter unsupportedSimulationFormulaHunter = new UnsupportedSimulationFormulaHunter(); + + UnsupportedSimulationNodeHunter unsupportedSimulationFormulaHunter = new UnsupportedSimulationNodeHunter(); expression.traversal4Tiny(unsupportedSimulationFormulaHunter); - return !unsupportedSimulationFormulaHunter.isSupported(); + return unsupportedSimulationFormulaHunter.isSupported() ? null : unsupportedSimulationFormulaHunter.getUnSupportedNode(); } catch (Exception e) { FineLoggerFactory.getLogger().error("", e); } - return true; + return null; } private Map setParamsIfExist(String formulaText) { @@ -814,11 +819,27 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { }).setVisible(true); //过滤出数组参数,如:[1,2] for (Map.Entry entry : parameterMap.entrySet()) { - if (entry.getValue().toString().startsWith("[") && entry.getValue().toString().startsWith("]")) { + if (entry.getValue().toString().startsWith("[") && entry.getValue().toString().endsWith("]")) { Expression parse = calculator.parse(entry.getValue()); ArrayExpression arrayExpression = (ArrayExpression) parse.getConditionalExpression(); - FArray fArray = new FArray<>(arrayExpression.getArrays()); + Node[] arrays = arrayExpression.getArrays(); + List arrayList = new ArrayList<>(); + for (Node array : arrays) { + if (array instanceof NumberLiteral) { + arrayList.add(NumberFormat.getInstance().parse(array.toString())); + } else { + arrayList.add(array); + } + } + FArray fArray = new FArray<>(arrayList); parameterMap.put(entry.getKey(), fArray); + } else if (Utils.isNumeric(entry.getValue().toString())) { + try { + Number number = NumberFormat.getInstance().parse(entry.getValue().toString()); + parameterMap.put(entry.getKey(), number); + } catch (Exception e) { + FineLoggerFactory.getLogger().warn("", e); + } } } } catch (Exception e) { @@ -838,34 +859,45 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { public void hunter4Tiny(Tiny tiny) { String statement = tiny.getStatement(); if (StringUtils.isNotBlank(statement) && statement.startsWith(ScriptConstants.DETAIL_TAG)) { - parameterList.add(new Parameter(statement.substring(1))); - } else if (tiny.getClass() == ColumnRowRange.class || tiny.getClass() == ColumnRowRangeInPage.class || + if (statement.startsWith(ScriptConstants.SUMMARY_TAG)) { + parameterList.add(new Parameter(statement)); + } else { + parameterList.add(new Parameter(statement.substring(1))); + } + } else if (tiny.getClass() == ColumnRowRange.class || tiny.getClass() == SheetIntervalLiteral.class || tiny.getClass() == BlockIntervalLiteral.class) { parameterList.add(new Parameter(tiny.toString())); } } } - private static class UnsupportedSimulationFormulaHunter extends TinyHunter { - public final static String[] UNSUPPORTED_FORMULAS = new String[]{"PROPORTION", "TOIMAGE", - "WEBIMAGE", "SORT", "CROSSLAYERTOTAL", "CIRCULAR", "LAYERTOTAL", "MOM", "HIERARCHY"}; + private static class UnsupportedSimulationNodeHunter extends TinyHunter { private boolean supported = true; + private String unSupportedNode; + + private String[] curReportVariables; + + public UnsupportedSimulationNodeHunter() { + curReportVariables = VariableResolver.DEFAULT.resolveCurReportVariables(); + } + public boolean isSupported() { return supported; } + public String getUnSupportedNode() { + return unSupportedNode; + } + public void hunter4Tiny(Tiny tiny) { - String statement = tiny.getStatement().toUpperCase(); - if (Arrays.asList(UNSUPPORTED_FORMULAS).contains(statement)) { + if (tiny.getClass() == ColumnRowRangeInPage.class || tiny.getClass() == CRAddress.class + || Arrays.asList(curReportVariables).contains(tiny.toString())) { supported = false; + unSupportedNode = tiny.toString(); } } - - public static boolean isUnsupportedFomula(String formula) { - return Arrays.asList(UNSUPPORTED_FORMULAS).contains(formula); - } } public class VariableTreeAndDescriptionArea extends JPanel { diff --git a/designer-base/src/main/java/com/fr/design/formula/UnsupportedFormulaScanner.java b/designer-base/src/main/java/com/fr/design/formula/UnsupportedFormulaScanner.java new file mode 100644 index 000000000..88f7a24b3 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/formula/UnsupportedFormulaScanner.java @@ -0,0 +1,54 @@ +package com.fr.design.formula; + +import com.fr.parser.BinaryExpression; +import com.fr.parser.DatasetFunctionCall; +import com.fr.parser.FunctionCall; +import com.fr.stable.script.Node; + +import java.util.Arrays; + +/** + * @author Hoky + * @date 2021/8/30 + */ +public class UnsupportedFormulaScanner { + public final static String[] UNSUPPORTED_FORMULAS = new String[]{"PROPORTION", "TOIMAGE", + "WEBIMAGE", "SORT", "CROSSLAYERTOTAL", "CIRCULAR", "LAYERTOTAL", "MOM", "HIERARCHY", + "FILENAME", "FILESIZE", "FILETYPE", "TREELAYER", "GETUSERDEPARTMENTS", "GETUSERJOBTITLES"}; + + private String unSupportFormula = ""; + + public boolean travelFormula(Node node) { + if (node instanceof FunctionCall) { + if (isUnsupportedFomula(((FunctionCall) node).getName())) { + unSupportFormula = ((FunctionCall) node).getName(); + return false; + } else { + for (Node argument : ((FunctionCall) node).getArguments()) { + if (!travelFormula(argument)) { + return false; + } + } + } + } else if (node instanceof BinaryExpression) { + for (Node array : ((BinaryExpression) node).getNodes()) { + if (!travelFormula(array)) { + return false; + } + } + } else if (node instanceof DatasetFunctionCall) { + DatasetFunctionCall datasetFunctionCall = (DatasetFunctionCall) node; + unSupportFormula = datasetFunctionCall.getSourceName() + "." + datasetFunctionCall.getFnName() + "()"; + return false; + } + return true; + } + + public String getUnSupportFormula() { + return unSupportFormula; + } + + private static boolean isUnsupportedFomula(String formula) { + return Arrays.asList(UNSUPPORTED_FORMULAS).contains(formula.toUpperCase()); + } +} diff --git a/designer-base/src/main/java/com/fr/design/fun/PcFitProvider.java b/designer-base/src/main/java/com/fr/design/fun/PcFitProvider.java new file mode 100644 index 000000000..46437917e --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/PcFitProvider.java @@ -0,0 +1,19 @@ +package com.fr.design.fun; + +import com.fr.stable.fun.mark.Mutable; + + +public interface PcFitProvider extends Mutable { + String XML_TAG = "PcFitProvider"; + int CURRENT_LEVEL = 1; + + //设计器上看到的选项 + String getContentDisplayValue(); + + //返回给前端的值 + int getContentDisplayKey(); + + //设计器上的提示信息 + String getContentDisplayTip(); + +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractPcFitProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractPcFitProvider.java new file mode 100644 index 000000000..b3a43754e --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractPcFitProvider.java @@ -0,0 +1,19 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.PcFitProvider; +import com.fr.stable.fun.mark.API; + + +@API(level = PcFitProvider.CURRENT_LEVEL) +public abstract class AbstractPcFitProvider implements PcFitProvider { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/EditTextField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/EditTextField.java index 694c3e507..9ed906827 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/EditTextField.java +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/EditTextField.java @@ -13,6 +13,9 @@ import javax.swing.text.PlainDocument; * Number Field. */ public class EditTextField extends UIGridTextField { + + private static final String I18NProperty = "i18n"; + private int maxLength = 24; public EditTextField() { @@ -39,7 +42,11 @@ public class EditTextField extends UIGridTextField { } class TextDocument extends PlainDocument { + + private Object defaultI18NProperty; + public TextDocument() { + defaultI18NProperty = getProperty(I18NProperty); } @Override @@ -49,6 +56,7 @@ public class EditTextField extends UIGridTextField { Toolkit.getDefaultToolkit().beep(); return; } + putProperty(I18NProperty, defaultI18NProperty); super.insertString(offset, s, a); } } diff --git a/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java b/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java index 33420ded7..b7499fc14 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java @@ -307,7 +307,7 @@ public class ComponentTitleStylePane extends AbstractBorderPackerPane { if (component != null) { container.add(component, BorderLayout.NORTH); JPanel nextContainer = new JPanel(FRGUIPaneFactory.createBorderLayout()); - component.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0)); + nextContainer.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0)); container.add(nextContainer, BorderLayout.CENTER); container = nextContainer; } diff --git a/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java b/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java index c7c1da0ef..55f4612a2 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java @@ -114,10 +114,7 @@ public class FollowingThemePane extends BasicPane implements UIObserver { public TemplateTheme getUsingTheme() { JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (template != null) { - TemplateTheme theme = template.getTemplateTheme(); - if (theme instanceof FormTheme) { - return theme; - } + return template.getTemplateTheme(); } return null; } diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/DoubleSplashMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/DoubleSplashMark.java new file mode 100644 index 000000000..78ee72b50 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/DoubleSplashMark.java @@ -0,0 +1,33 @@ +package com.fr.design.locale.impl; + +import com.fr.design.DesignerEnvManager; +import com.fr.general.locale.LocaleMark; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/9/2 + */ +public class DoubleSplashMark implements LocaleMark { + + private final Map map = new HashMap(); + private static final String SPLASH_PATH_X2 = "/com/fr/design/images/splash@2x.png"; + private static final String SPLASH_PATH_EN_X2 = "/com/fr/design/images/splash_en@2x.png"; + + public DoubleSplashMark() { + map.put(Locale.CHINA, SPLASH_PATH_X2); + map.put(Locale.KOREA, SPLASH_PATH_EN_X2); + map.put(Locale.JAPAN, SPLASH_PATH_EN_X2); + map.put(Locale.US, SPLASH_PATH_EN_X2); + map.put(Locale.TAIWAN, SPLASH_PATH_EN_X2); + } + + @Override + public String getValue() { + String result = map.get(DesignerEnvManager.getEnvManager().getLanguage()); + return result == null ? SPLASH_PATH_EN_X2 : result; + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/SplashMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/SplashMark.java index 8cf75c058..93995eedd 100644 --- a/designer-base/src/main/java/com/fr/design/locale/impl/SplashMark.java +++ b/designer-base/src/main/java/com/fr/design/locale/impl/SplashMark.java @@ -15,8 +15,8 @@ import java.util.Map; public class SplashMark implements LocaleMark { private Map map = new HashMap(); - private static final String SPLASH_PATH = "/com/fr/design/images/splash_10.png"; - private static final String SPLASH_EN_PATH = "/com/fr/design/images/splash_10_en.png"; + private static final String SPLASH_PATH = "/com/fr/design/images/splash.png"; + private static final String SPLASH_EN_PATH = "/com/fr/design/images/splash_en.png"; public SplashMark() { map.put(Locale.CHINA, SPLASH_PATH); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 84993411e..588b4e256 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -458,6 +458,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { for (PropertyItem item : propertyItemMap.values()) { item.onResize(); } + super.onResize(); } public EastRegionContainerPane(JPanel leftPane, JPanel rightPane) { @@ -1006,7 +1007,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { button.setToolTipText(title); } - public void processSnapChat(){ + public void processSnapChat() { if (snapChat != null && !snapChat.hasRead()) { snapChat.markRead(); if (promptWindow != null) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 843f76030..ed156aecd 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -189,13 +189,13 @@ public abstract class JTemplate> designModel = createDesignModel(parameters); } addCenterPane(); - this.undoState = createUndoState(); - - initAndStartPlugin(); - if (isNewFile) { + // REPORT-58486: 必须在初始的UndoState创建前设置主题,使得初始的UndoState就包含了主题效果 setUpTheme4NewTemplate(); } + this.undoState = createUndoState(); + + initAndStartPlugin(); startListenThemeConfig(); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java index 9f10ba829..fded31818 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java @@ -88,4 +88,8 @@ public class LogMessageBar extends JPanel { } THIS = null; } + + public JFrame getLogFrame() { + return dlg; + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/AsyncThemeFetcher.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/AsyncThemeFetcher.java index 265043283..3df87ac65 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/AsyncThemeFetcher.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/AsyncThemeFetcher.java @@ -5,6 +5,7 @@ import com.fr.base.theme.TemplateThemeConfig; import com.fr.concurrent.NamedThreadFactory; import com.fr.module.ModuleContext; +import javax.swing.SwingUtilities; import java.util.concurrent.ExecutorService; /** @@ -48,7 +49,13 @@ public class AsyncThemeFetcher { return; } if (callback != null) { - callback.afterCachedFetch(theme); + // 后续任务不要在工作线程中执行,从而确保只在EDT线程操作UI + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + callback.afterCachedFetch(theme); + } + }); } } }); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java index ef35f7e02..ef99423be 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java @@ -1,20 +1,18 @@ package com.fr.design.mainframe.theme; -import com.fr.base.theme.FineColorManager; -import com.fr.base.theme.TemplateThemeConfig; import com.fr.base.theme.FormTheme; +import com.fr.base.theme.TemplateThemeConfig; import com.fr.base.theme.settings.ThemedComponentStyle; import com.fr.base.theme.settings.ThemedFormBodyStyle; import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.theme.edit.ChartStyleFormEditPane; import com.fr.design.mainframe.theme.edit.ComponentStyleEditPane; import com.fr.design.mainframe.theme.edit.FormBodyStyleEditPane; import com.fr.design.mainframe.theme.preview.FormThemePreviewPane; import javax.swing.JPanel; -import java.awt.Color; -import java.util.List; - import static com.fr.design.i18n.Toolkit.i18nText; /** @@ -53,17 +51,11 @@ public class FormThemeProfilePane extends TemplateThemeProfilePane { } @Override - public void onColorSchemeChanged(List colors) { - super.onColorSchemeChanged(colors); - FineColorManager.FineColorReplaceByColorScheme replaceByColorScheme = new FineColorManager.FineColorReplaceByColorScheme(colors); - - ThemedFormBodyStyle formBodyStyle = formBodyStyleSettingPane.updateBean(); - FineColorManager.traverse(formBodyStyle, replaceByColorScheme); - formBodyStyleSettingPane.populateBean(formBodyStyle); - - ThemedComponentStyle componentStyle = componentStyleSettingPane.updateBean(); - FineColorManager.traverse(componentStyle, replaceByColorScheme); - componentStyleSettingPane.populateBean(componentStyle); + protected JPanel createChartStyleSettingPane() { + JPanel container = FRGUIPaneFactory.createBorderLayout_S_Pane(); + chartStyleSettingPane = new ChartStyleFormEditPane(); + container.add(chartStyleSettingPane); + return container; } @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java index 091262b58..59f3ace8c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java @@ -39,17 +39,6 @@ public class ReportThemeProfilePane extends TemplateThemeProfilePane colors) { - super.onColorSchemeChanged(colors); - - FineColorManager.FineColorReplaceByColorScheme replaceByColorScheme = new FineColorManager.FineColorReplaceByColorScheme(colors); - - ThemedReportBodyStyle bodyStyle = reportBodyStyleSettingPane.updateBean(); - FineColorManager.traverse(bodyStyle, replaceByColorScheme); - reportBodyStyleSettingPane.populateBean(bodyStyle); - } - @Override public void populateBean(ReportTheme theme) { super.populateBean(theme); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java index 933ce2ad3..e00bc445c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java @@ -16,7 +16,6 @@ import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.Icon; -import javax.swing.ImageIcon; import javax.swing.JPanel; import javax.swing.SwingUtilities; import java.awt.BorderLayout; @@ -27,10 +26,10 @@ import java.awt.Graphics2D; import java.awt.Image; import java.awt.Rectangle; import java.awt.RenderingHints; +import java.awt.Toolkit; import java.awt.Window; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.util.concurrent.ExecutorService; /** * @author Starryi @@ -51,7 +50,7 @@ public class TemplateThemeBlock extends JPanel { private final Icon profileIcon = IOUtils.readIcon("/com/fr/design/icon/icon_edit.png"); private final boolean displayTheme4NewTemplateMarker; - private UILabel thumbnailLabel; + private final ThumbnailPane thumbnailPane; // UIButton会影响Block的手势监听,这里使用UILabel代替,点击事件也有Block代为处理 private UILabel profileButton; private boolean selected = false; @@ -67,6 +66,7 @@ public class TemplateThemeBlock extends JPanel { this.displayTheme4NewTemplateMarker = displayTheme4NewTemplateMarker; this.config = config; this.profilePane = profilePane; + this.thumbnailPane = new ThumbnailPane(); initializePane(); addMouseListener(new MouseAdapter() { @@ -100,8 +100,8 @@ public class TemplateThemeBlock extends JPanel { setPreferredSize(new Dimension(getPreferredSize().width, HEIGHT)); setBackground(Color.WHITE); - thumbnailLabel = new UILabel(); - thumbnailLabel.setPreferredSize(new Dimension(getPreferredSize().width, THUMBNAIL_HEIGHT)); + thumbnailPane.setBackground(Color.WHITE); + thumbnailPane.setPreferredSize(new Dimension(getPreferredSize().width, THUMBNAIL_HEIGHT)); JPanel infoPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); infoPane.setBackground(Color.WHITE); @@ -115,23 +115,20 @@ public class TemplateThemeBlock extends JPanel { addProfileButton(infoPane); } - add(thumbnailLabel, BorderLayout.CENTER); + add(thumbnailPane, BorderLayout.CENTER); add(infoPane, BorderLayout.SOUTH); } public void setTheme(T theme) { this.theme = theme; - thumbnailLabel.setIcon(null); + Image image = null; if (theme != null) { ThemeThumbnail thumbnail = theme.getThumbnail(); if (thumbnail != null) { - Image image = thumbnail.getImage(); - if (image != null) { - thumbnailLabel.setIcon(new ImageIcon(image)); - } + image = thumbnail.getImage(); } } - repaint(); + thumbnailPane.setThumbnail(image); } public T getTheme() { @@ -158,7 +155,7 @@ public class TemplateThemeBlock extends JPanel { int y = e.getY(); int profileButtonX = profileButton.getX(); - int profileButtonY = thumbnailLabel.getHeight() + profileButton.getY(); + int profileButtonY = thumbnailPane.getHeight() + profileButton.getY(); boolean inX = profileButtonX <= x && x <= profileButtonX + profileButton.getWidth(); boolean inY = profileButtonY <= y && y <= profileButtonY + profileButton.getHeight(); @@ -205,4 +202,58 @@ public class TemplateThemeBlock extends JPanel { GraphHelper.draw(g, rectangle, Constants.LINE_MEDIUM); } } + + private static class ThumbnailPane extends JPanel { + private static final Image LOADING_IMAGE = Toolkit.getDefaultToolkit().createImage(ThumbnailPane.class.getResource("/com/fr/design/images/mainframe/loading.gif")); + private Image thumbnail = null; + + @Override + public void paint(Graphics g) { + super.paint(g); + Graphics2D g2d = (Graphics2D) g; + Color oldColor = g2d.getColor(); + g2d.setColor(Color.WHITE); + g2d.fillRect(0, 0, getWidth(), getHeight()); + g2d.setColor(oldColor); + + paintCenterImage(g2d, thumbnail != null ? thumbnail : LOADING_IMAGE); + } + + private void paintCenterImage(Graphics2D g2d, Image image) { + if (image == null) { + return; + } + + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + + int width = getWidth(); + int height = getHeight(); + int imgWidth = image.getWidth(null); + int imgHeight = image.getHeight(null); + + if (width <= 0 || height <= 0 || imgWidth <= 0 || imgHeight <= 0) { + return; + } + + float imgAspect = 1.0F * imgWidth / imgHeight; + + if (1.0F * width / height > 1.0F * imgWidth / imgHeight) { + imgHeight = height; + imgWidth = (int) (1.0F * imgHeight * imgAspect); + } else { + imgWidth = width; + imgHeight = (int) (1.0F * imgWidth / imgAspect); + } + int x = (width - imgWidth) / 2; + int y = (height - imgHeight) / 2; + + g2d.drawImage(image, x, y, imgWidth, imgHeight, null); + } + + public void setThumbnail(Image thumbnail) { + this.thumbnail = thumbnail; + invalidate(); + repaint(); + } + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeManagePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeManagePane.java index 8da77c378..bf93c6345 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeManagePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeManagePane.java @@ -17,11 +17,13 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.icon.IconPathConstants; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.theme.dialog.TemplateThemeProfileDialog; +import com.fr.design.mainframe.theme.edit.CellStyleListEditPane; import com.fr.design.menu.MenuDef; import com.fr.design.menu.ToolBarDef; import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; +import com.fr.transaction.CallBackAdaptor; import com.fr.transaction.Configurations; import com.fr.transaction.WorkerFacade; @@ -45,6 +47,8 @@ import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import static com.fr.design.i18n.Toolkit.i18nText; + /** * @author Starryi * @version 1.0 @@ -172,7 +176,16 @@ public class TemplateThemeManagePane extends BasicPane public void actionPerformed(ActionEvent e) { T theme = themeListPane.getSelectedTheme(); if (theme != null) { - config.setThemeName4NewTemplate(theme.getName()); + config.setThemeName4NewTemplate(theme.getName(), new CallBackAdaptor() { + @Override + public void afterRollback() { + super.afterRollback(); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TemplateThemeManagePane.this), + i18nText("Fine-Design_Basic_Template_Theme_Operation_Failed_Tip"), + i18nText("Fine-Design_Basic_Alert"), + JOptionPane.WARNING_MESSAGE); + } + }); } } }); @@ -221,10 +234,14 @@ public class TemplateThemeManagePane extends BasicPane Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Pane_Delete_Tip", theme.getName()), Toolkit.i18nText("Fine-Design_Basic_Delete"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (result == JOptionPane.YES_OPTION) { - Configurations.modify(new WorkerFacade(config.getClass()) { + config.removeTheme(theme.getName(), new CallBackAdaptor() { @Override - public void run() { - config.removeTheme(theme.getName()); + public void afterRollback() { + super.afterRollback(); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TemplateThemeManagePane.this), + i18nText("Fine-Design_Basic_Template_Theme_Operation_Failed_Tip"), + i18nText("Fine-Design_Basic_Alert"), + JOptionPane.WARNING_MESSAGE); } }); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemePreviewPane.java index ef9ad4469..fab425fbe 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemePreviewPane.java @@ -8,6 +8,7 @@ import com.fr.log.FineLoggerFactory; import javax.swing.JPanel; import java.awt.Color; +import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.RenderingHints; @@ -81,4 +82,12 @@ public abstract class TemplateThemePreviewPane extends return null; } + + @Override + public void paintComponent(Graphics g) { + g.clearRect(0, 0, 517, 532); + paintBackground((Graphics2D) g); + } + + protected abstract void paintBackground(Graphics2D g); } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java index cedc63f3f..b7a8db48a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java @@ -7,6 +7,8 @@ import com.fr.base.theme.settings.ThemeThumbnail; import com.fr.base.theme.settings.ThemedCellStyleList; import com.fr.base.theme.settings.ThemedChartStyle; import com.fr.base.theme.settings.ThemedColorScheme; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.UITabbedPane; @@ -25,6 +27,7 @@ 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.Inter; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.transaction.CallBackAdaptor; @@ -34,13 +37,16 @@ import com.fr.transaction.WorkerFacade; import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JDialog; +import javax.swing.JOptionPane; import javax.swing.JPanel; +import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import java.awt.BorderLayout; import java.awt.Color; +import java.awt.Component; import java.awt.Dimension; import java.awt.Image; import java.awt.event.ActionEvent; @@ -51,6 +57,8 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.List; +import static com.fr.design.i18n.Toolkit.i18nText; + /** * @author Starryi * @version 1.0 @@ -85,6 +93,8 @@ public abstract class TemplateThemeProfilePane extends private UIButton saveButton = new UIButton(); private UIButton saveAsButton = new UIButton(); + private boolean refreshingThemedColor = false; + private boolean currentIsNewTheme; private T theme; @@ -144,12 +154,12 @@ public abstract class TemplateThemeProfilePane extends return titleContainer; } private JPanel createRightPane() { - JPanel container = new JPanel(new BorderLayout(0, 12)); + JPanel container = new JPanel(new BorderLayout(0, 0)); container.setPreferredSize(new Dimension(RIGHT_PANE_WIDTH, RIGHT_PANE_HEIGHT)); JPanel nameEditPane = createNameEditPane(); container.add(nameEditPane, BorderLayout.NORTH); - JPanel settingPane = new JPanel(new BorderLayout(0, 10)); + JPanel settingPane = new JPanel(new BorderLayout(0, IntervalConstants.INTERVAL_L1)); container.add(settingPane, BorderLayout.CENTER); settingPane.add(createColorSchemeEditPane(), BorderLayout.NORTH); settingPane.add(createCustomEditorsPane(), BorderLayout.CENTER); @@ -165,13 +175,6 @@ public abstract class TemplateThemeProfilePane extends } private JPanel createNameEditPane() { - JPanel container = new JPanel(new BorderLayout(30, 0)); - container.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); - container.add(LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Name")), BorderLayout.WEST); - - JPanel settingContainer = new JPanel(new BorderLayout(10, 0)); - container.add(settingContainer, BorderLayout.CENTER); - nameErrorLabel = LabelUtils.createLabel(StringUtils.EMPTY, Color.RED); nameErrorLabel.setVisible(false); @@ -182,14 +185,14 @@ public abstract class TemplateThemeProfilePane extends @Override public void insertUpdate(DocumentEvent e) { if (isEnabled()) { - checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, nameTextField, nameErrorLabel, saveButton); + checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, false, currentIsNewTheme, true, nameTextField, nameErrorLabel, saveButton); } } @Override public void removeUpdate(DocumentEvent e) { if (isEnabled()) { - checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, nameTextField, nameErrorLabel, saveButton); + checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, false, currentIsNewTheme, true, nameTextField, nameErrorLabel, saveButton); } } @@ -202,22 +205,26 @@ public abstract class TemplateThemeProfilePane extends @Override public void focusGained(FocusEvent e) { if (isEnabled()) { - checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, nameTextField, nameErrorLabel, saveButton); + checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, false, currentIsNewTheme, true, nameTextField, nameErrorLabel, saveButton); } } @Override public void focusLost(FocusEvent e) { if (isEnabled()) { - checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, nameTextField, nameErrorLabel, saveButton); + checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, true, currentIsNewTheme, true, nameTextField, nameErrorLabel, saveButton); } } }); - settingContainer.add(nameTextField, BorderLayout.WEST); + double p = TableLayout.PREFERRED; - settingContainer.add(nameErrorLabel, BorderLayout.CENTER); + JPanel container = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ + new Component[] { LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Name")), nameTextField }, + new Component[] { null, nameErrorLabel }, + }, new double[] { 20, 20}, new double[] { p, 165}, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_W0); + container.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); return container; } private JPanel createColorSchemeEditPane() { @@ -238,9 +245,12 @@ public abstract class TemplateThemeProfilePane extends JPanel previewLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); previewLabelPane.add(LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Color_Scheme_Preview_Label")), BorderLayout.NORTH); + UILabel tipLabel = LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Color_Scheme_Edit_Tip"), new Color(153, 153, 153)); + tipLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); + JPanel content = TableLayoutHelper.createGapTableLayoutPane(new JComponent[][]{ {LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Color_Scheme_Edit_Label")), colorListPane}, - {null, LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Color_Scheme_Edit_Tip"), new Color(0XC6C6C6), 10)}, + {null, tipLabel}, {previewLabelPane, extendedContainer}, }, rowSize, columnSize, 18, 7); @@ -257,8 +267,13 @@ public abstract class TemplateThemeProfilePane extends colorListPane.addColorChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { + if (refreshingThemedColor) { + return; + } List colors = colorListPane.update(); + refreshingThemedColor = true; onColorSchemeChanged(colors); + refreshingThemedColor = false; } }); @@ -302,13 +317,10 @@ public abstract class TemplateThemeProfilePane extends public void onColorSchemeChanged(List colors) { colorListExtendedPane.populate(colors); FineColorManager.FineColorReplaceByColorScheme replaceByColorScheme = new FineColorManager.FineColorReplaceByColorScheme(colors); - ThemedCellStyleList cellStyle = cellStyleSettingPane.updateBean(); - FineColorManager.traverse(cellStyle, replaceByColorScheme); + T theme = updateBean(); - ThemedChartStyle themedChartStyle = chartStyleSettingPane.updateBean(); - FineColorManager.traverse(themedChartStyle, replaceByColorScheme); - chartStyleSettingPane.populateBean(themedChartStyle); - chartStyleSettingPane.populateGradientBar(colors); + FineColorManager.traverse(theme, replaceByColorScheme); + populateBean(theme); } public void populateBean(T theme) { @@ -381,15 +393,10 @@ public abstract class TemplateThemeProfilePane extends @Override public void actionPerformed(ActionEvent e) { T theme = updateBean(); - boolean canBeSaved = checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, nameTextField, nameErrorLabel, saveButton); + boolean canBeSaved = checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, true, currentIsNewTheme, true, nameTextField, nameErrorLabel, saveButton); if (canBeSaved && theme != null) { theme.setName(nameTextField.getText()); - Configurations.modify(new WorkerFacade(config.getClass()) { - @Override - public void run() { - config.addTheme(theme, true); - } - }.addCallBack(new CallBackAdaptor() { + config.addTheme(theme, true, new CallBackAdaptor() { @Override public void afterCommit() { super.afterCommit(); @@ -397,7 +404,16 @@ public abstract class TemplateThemeProfilePane extends nameTextField.setEnabled(false); saveAsButton.setEnabled(true); } - })); + + @Override + public void afterRollback() { + super.afterRollback(); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TemplateThemeProfilePane.this), + i18nText("Fine-Design_Basic_Template_Theme_Operation_Failed_Tip"), + i18nText("Fine-Design_Basic_Alert"), + JOptionPane.WARNING_MESSAGE); + } + }); } } }); @@ -462,14 +478,14 @@ public abstract class TemplateThemeProfilePane extends @Override public void insertUpdate(DocumentEvent e) { if (isEnabled()) { - checkThemeCanBeSavedAndUpdateUI(true, nameTextField, nameErrorLabel, confirmButton); + checkThemeCanBeSavedAndUpdateUI(true, false, true, true, nameTextField, nameErrorLabel, confirmButton); } } @Override public void removeUpdate(DocumentEvent e) { if (isEnabled()) { - checkThemeCanBeSavedAndUpdateUI(true, nameTextField, nameErrorLabel, confirmButton); + checkThemeCanBeSavedAndUpdateUI(true, false, true, true, nameTextField, nameErrorLabel, confirmButton); } } @@ -482,14 +498,14 @@ public abstract class TemplateThemeProfilePane extends @Override public void focusGained(FocusEvent e) { if (isEnabled()) { - checkThemeCanBeSavedAndUpdateUI(true, nameTextField, nameErrorLabel, confirmButton); + checkThemeCanBeSavedAndUpdateUI(true, false, true, true, nameTextField, nameErrorLabel, confirmButton); } } @Override public void focusLost(FocusEvent e) { if (isEnabled()) { - checkThemeCanBeSavedAndUpdateUI(true, nameTextField, nameErrorLabel, confirmButton); + checkThemeCanBeSavedAndUpdateUI(true, true, true, true, nameTextField, nameErrorLabel, confirmButton); } } }); @@ -535,25 +551,28 @@ public abstract class TemplateThemeProfilePane extends FineLoggerFactory.getLogger().error(ex.getMessage(), ex); return; } - boolean canBeSaved = checkThemeCanBeSavedAndUpdateUI(true, nameTextField, nameErrorLabel, confirmButton); + boolean canBeSaved = checkThemeCanBeSavedAndUpdateUI(true, true, true, true, nameTextField, nameErrorLabel, confirmButton); if (canBeSaved && newThemeObject != null) { newThemeObject.setName(name); newThemeObject.setRemovable(true); newThemeObject.setMutable(true); - T finalNewThemeObject = newThemeObject; - Configurations.modify(new WorkerFacade(config.getClass()) { - @Override - public void run() { - config.addTheme(finalNewThemeObject, true); - } - }.addCallBack(new CallBackAdaptor() { + config.addTheme(newThemeObject, true, new CallBackAdaptor() { @Override public void afterCommit() { super.afterCommit(); exit(); parent.exit(); } - })); + + @Override + public void afterRollback() { + super.afterRollback(); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TemplateThemeProfilePane.this), + i18nText("Fine-Design_Basic_Template_Theme_Operation_Failed_Tip"), + i18nText("Fine-Design_Basic_Alert"), + JOptionPane.WARNING_MESSAGE); + } + }); } } @@ -568,17 +587,28 @@ public abstract class TemplateThemeProfilePane extends private boolean isThemeNameDuplicated(String name) { return config.cachedFetch(name) != null; } - private boolean checkThemeCanBeSavedAndUpdateUI(boolean checkDuplicated, UITextField textField, UILabel errorLabel, UIButton... actionButtons) { - String error = StringUtils.EMPTY; + private boolean checkThemeCanBeSavedAndUpdateUI( + boolean checkEmpty, + boolean displayEmptyTip, + boolean checkDuplicated, + boolean displayDuplicatedTip, + UITextField textField, + UILabel errorLabel, UIButton... actionButtons) { String name = textField.getText(); - if (isThemeNameEmpty(name)) { - error = Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Empty_Name_Error_Tip"); + + boolean valid = true; + errorLabel.setText(StringUtils.EMPTY); + if (checkEmpty && isThemeNameEmpty(name)) { + valid = false; + if (displayEmptyTip) { + errorLabel.setText(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Empty_Name_Error_Tip")); + } } else if (checkDuplicated && isThemeNameDuplicated(name)) { - error = Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Duplicated_Name_Error_Tip"); + valid = false; + if (displayDuplicatedTip) { + errorLabel.setText(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Duplicated_Name_Error_Tip")); + } } - errorLabel.setText(error); - - boolean valid = StringUtils.isEmpty(error); errorLabel.setVisible(!valid); if (actionButtons != null && actionButtons.length > 0) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java index e0e42b8b4..b8fc31b6d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java @@ -173,6 +173,8 @@ public class CellStyleListEditPane extends JListControlPane { return; } + int oldSelectedIndex = getSelectedIndex(); + List nameObjectList = new ArrayList<>(); List cellStyleList = ob.getCellStyleList(); @@ -185,9 +187,16 @@ public class CellStyleListEditPane extends JListControlPane { populate(nameObjectArray); + int newSelectedIndex = oldSelectedIndex; + if (newSelectedIndex >= nameObjectArray.length) { + newSelectedIndex = 0; + } + setSelectedIndex(newSelectedIndex); } public ThemedCellStyleList updateBean() { + nameableList.stopEditing(); + Nameable[] nameables = this.update(); ThemedCellStyleList styleConfig = new ThemedCellStyleList(); for (Nameable nameable : nameables) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java index 75664912c..3830f02f1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java @@ -45,7 +45,7 @@ public class ChartStyleEditPane extends MultiTabPane { this.chartLabelPane = new ChartLabelStylePane(); this.chartAxisStylePane = new ChartAxisStylePane(); this.chartDataSheetStylePane = new ChartDataSheetStylePane(); - this.chartTitleAndBackgroundStylePane = new ChartTitleAndBackgroundStylePane(); + this.chartTitleAndBackgroundStylePane = createChartTitleAndBackgroundStylePane(); paneList = new ArrayList<>(); paneList.add(this.chartSeriesStylePane); paneList.add(this.chartLegendStylePane); @@ -56,6 +56,10 @@ public class ChartStyleEditPane extends MultiTabPane { return paneList; } + protected ChartTitleAndBackgroundStylePane createChartTitleAndBackgroundStylePane() { + return new ChartTitleAndBackgroundStylePane(); + } + @Override public void populateBean(ThemedChartStyle ob) { chartSeriesStylePane.populate(ob); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleFormEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleFormEditPane.java new file mode 100644 index 000000000..f0886804d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleFormEditPane.java @@ -0,0 +1,16 @@ +package com.fr.design.mainframe.theme.edit; + +import com.fr.design.mainframe.theme.edit.chart.ChartTitleAndBackgroundStyleFormPane; +import com.fr.design.mainframe.theme.edit.chart.ChartTitleAndBackgroundStylePane; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2021-08-30 + */ +public class ChartStyleFormEditPane extends ChartStyleEditPane { + + protected ChartTitleAndBackgroundStylePane createChartTitleAndBackgroundStylePane() { + return new ChartTitleAndBackgroundStyleFormPane(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ComponentStyleEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ComponentStyleEditPane.java index bb78d2fc0..87a12a9dd 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ComponentStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ComponentStyleEditPane.java @@ -45,7 +45,7 @@ public class ComponentStyleEditPane extends JPanel { new String[] { Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Component_Title"), Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Component_Body"), - Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Component_Background") + Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Component_Integral") }, new JComponent[] { createTabContainer(componentTitleStylePane), createTabContainer(componentBodyStylePane), createTabContainer(componentIntegralStylePane) } ); @@ -119,7 +119,7 @@ public class ComponentStyleEditPane extends JPanel { JPanel tipLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); tipLabelPane.setBorder(BorderFactory.createEmptyBorder(3, 0, 0, 0)); - UILabel tipLabel = LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Component_Style_Tip"), new Color(0XC6C6C6), 10); + UILabel tipLabel = LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Component_Style_Tip"), new Color(153, 153, 153)); tipLabelPane.add(tipLabel); container.add(tipLabelPane, BorderLayout.NORTH); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStyleFormPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStyleFormPane.java new file mode 100644 index 000000000..204bde076 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStyleFormPane.java @@ -0,0 +1,36 @@ +package com.fr.design.mainframe.theme.edit.chart; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; + +import java.awt.Color; +import java.awt.Component; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2021-08-30 + */ +public class ChartTitleAndBackgroundStyleFormPane extends ChartTitleAndBackgroundStylePane { + + private UILabel tooltipLabel; + + protected void initComponents() { + super.initComponents(); + tooltipLabel = new UILabel("" + Toolkit.i18nText("Fine-Design_Chart_Title_Background_Tooltip") + ""); + tooltipLabel.setForeground(new Color(153, 153, 153)); + } + + protected Component[][] getComponent() { + Component[][] component = super.getComponent(); + Component[][] newComponent = new Component[component.length + 2][]; + System.arraycopy(component, 0, newComponent, 2, component.length); + newComponent[0] = new Component[]{null, null}; + newComponent[1] = new Component[]{tooltipLabel, null}; + return newComponent; + } + + protected double[] getRows(double p) { + return new double[]{p, p, p, p, p, p, p}; + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java index 0fc194492..8b96eba4b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java @@ -3,7 +3,6 @@ package com.fr.design.mainframe.theme.preview; import com.fr.base.BaseFormula; import com.fr.base.background.ColorBackground; import com.fr.base.theme.FormTheme; -import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.Title; import com.fr.chart.chartdata.NormalChartData; @@ -19,18 +18,19 @@ import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.base.AttrLabel; import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.column.VanChartColumnPlot; +import com.fr.plugin.chart.type.GradientType; import com.fr.plugin.chart.type.RadiusType; import com.fr.plugin.chart.vanchart.VanChart; import com.fr.stable.Constants; import com.fr.stable.StringUtils; + import javax.swing.JPanel; import java.awt.AlphaComposite; -import java.awt.Composite; -import java.awt.Graphics2D; import java.awt.BorderLayout; import java.awt.Color; +import java.awt.Composite; import java.awt.Dimension; -import java.awt.Graphics; +import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; /** @@ -97,12 +97,7 @@ public class FormThemePreviewPane extends TemplateThemePreviewPane { } - @Override - public void paintComponent(Graphics g) { - paintBackground((Graphics2D) g); - } - - private void paintBackground(Graphics2D g2d) { + protected void paintBackground(Graphics2D g2d) { if (background == null) { background = ColorBackground.getInstance(Color.WHITE); } @@ -130,7 +125,7 @@ public class FormThemePreviewPane extends TemplateThemePreviewPane { plot.getConditionCollection().getDefaultAttr().addDataSeriesCondition(defaultAttrLabel); plot.getLegend().setPosition(Constants.TOP); - plot.setPlotStyle(ChartConstants.STYLE_NONE); + plot.getGradientStyle().setGradientType(GradientType.NONE); plot.setSeriesOverlapPercent(30); plot.setCategoryIntervalPercent(30); @@ -184,7 +179,7 @@ public class FormThemePreviewPane extends TemplateThemePreviewPane { PiePlot4VanChart plot = chart.getPlot(); plot.getLegend().setPosition(Constants.BOTTOM); - plot.setPlotStyle(ChartConstants.STYLE_NONE); + plot.getGradientStyle().setGradientType(GradientType.NONE); plot.setInnerRadiusPercent(75); plot.getRadius().setRadiusType(RadiusType.FIXED); plot.getRadius().setRadius(80); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java index f4e23853d..ce4f4f49b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java @@ -3,7 +3,6 @@ package com.fr.design.mainframe.theme.preview; import com.fr.base.BaseFormula; import com.fr.base.background.ColorBackground; import com.fr.base.theme.ReportTheme; -import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.Title; import com.fr.chart.chartdata.NormalChartData; @@ -18,12 +17,12 @@ import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.base.AttrLabel; import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.column.VanChartColumnPlot; +import com.fr.plugin.chart.type.GradientType; import com.fr.plugin.chart.vanchart.VanChart; -import java.awt.Graphics2D; import java.awt.BorderLayout; import java.awt.Color; -import java.awt.Graphics; +import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; /** @@ -38,7 +37,7 @@ public class ReportThemePreviewPane extends TemplateThemePreviewPane template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (template != null) { + TemplateTheme theme = template.getTemplateTheme(); + ThemedCellStyle themedCellStyle = theme.getCellStyleList().getDefaultCellStyle4New(); + if (themedCellStyle != null) { + NameStyle nameStyle = NameStyle.getPassiveInstance(themedCellStyle.getName(), themedCellStyle.getStyle()); + cellElement.setStyle(nameStyle); + } + } + return cellElement; + } +} diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java b/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java index 4d6f45a67..dc4eb9571 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java @@ -114,8 +114,10 @@ public abstract class ColorControlWindowWithAuto extends ColorControlWindow { } } + @Override public Dimension getPreferredSize() { - return super.getPreferredSize(); + Dimension dimension = super.getPreferredSize(); + return new Dimension(dimension.width, dimension.height + BUTTON_HEIGHT); } } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java index e93f0023b..985ee28af 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -173,8 +173,7 @@ public class ChartTypePane extends AbstractChartAttrPane { Map>> allChartTypePane, ActionListener autoButtonListener) { - - String[] chartIDs = ChartTypeManager.getInstance().getAllChartIDs(); + String[] chartIDs = ChartTypeManager.getInstance().getAllChartIDsIncludeDisabled(); for (String id : chartIDs) { @@ -222,6 +221,7 @@ public class ChartTypePane extends AbstractChartAttrPane { String lastPlotID = chart.getID(); + boolean chartTypeChange = false; try { AbstractChartTypePane selectedPane = (AbstractChartTypePane) getSelectedPane(); ChartProvider newDefaultChart = (ChartProvider) ChartTypeManager.getInstanceWithCheck().getCharts(selectedPane.getPlotID())[0].clone(); @@ -231,13 +231,16 @@ public class ChartTypePane extends AbstractChartAttrPane { editingCollection.removeNameObject(editingCollection.getSelectedIndex()); editingCollection.addChart(newDefaultChart); chart = newDefaultChart; + chartTypeChange = true; } } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } //这一步会替换plot + String id = chart.getID(); ((AbstractChartTypePane) getSelectedPane()).updateBean(chart); - if (inForm) { + chartTypeChange = chartTypeChange || !ComparatorUtils.equals(id, chart.getID()); + if (inForm && chartTypeChange) { chart.resetAttrInForm(); } reLayoutEditPane(chart, lastPlotID); @@ -465,5 +468,6 @@ public class ChartTypePane extends AbstractChartAttrPane { public void registerChartEditPane(ChartEditPane currentEditPane) { this.editPane = currentEditPane; this.inForm = editPane.isInForm(); + buttonPane.refreshChartInForm(inForm); } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java b/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java index 06c101009..378e6a0d7 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java @@ -58,11 +58,13 @@ public class ChartHyperlinkGroup extends BaseHyperlinkGroup { if (template == null) { return false; } + if (template.isJWorkBook() || DesignModeContext.isDuchampMode()) { // 如果是普通报表单元格,那么没有 FormHyperlink 选项 FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); //返回true表示可用,返回false表示不可用 return !ComparatorUtils.equals(clazz, formHyperlink.getClass()); + } else { // 如果是决策报表 Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class}; @@ -99,18 +101,21 @@ public class ChartHyperlinkGroup extends BaseHyperlinkGroup { return !ComparatorUtils.equals(object.getClass(), formHyperlink.getClass()); } else { // 如果是决策报表 - if (template.getEditingReportIndex() == BaseJForm.FORM_TAB) { - // 编辑的是决策报表中的图表,那么没有ChartHyperRelateFloatLink 和 ChartHyperRelateCellLink 选项,有FormHyperlink 选项 - Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class}; - return !ArrayUtils.contains(classes, object.getClass()); - } else if (template.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB) { - // 编辑的是决策报表中的报表块,那么没有 ChartHyperPoplink 和 ChartHyperRelateFloatLink - Class[] classes = new Class[]{ChartHyperPoplink.class, ChartHyperRelateFloatLink.class}; - return !ArrayUtils.contains(classes, object.getClass()); + Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class}; + for (Class aClass : classes) { + if (template.getEditingReportIndex() == BaseJForm.FORM_TAB) { + // 编辑的是决策报表中的图表,那么没有ChartHyperRelateFloatLink 和 ChartHyperRelateCellLink 选项,有FormHyperlink 选项 + if (ComparatorUtils.equals(aClass, object.getClass())) { + return false; + } + } else if (template.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB) { + // 编辑的是决策报表中的报表块,那么没有 ChartHyperRelateFloatLink,有ChartHyperRelateCellLink 和 FormHyperlink 选项 + return !ComparatorUtils.equals(object.getClass(), ChartHyperRelateFloatLink.class); + } } } return true; } }; } -} +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/location/AccessDirection.java b/designer-form/src/main/java/com/fr/design/designer/beans/location/AccessDirection.java index eae04d998..5650c45f1 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/location/AccessDirection.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/location/AccessDirection.java @@ -16,6 +16,7 @@ import com.fr.design.utils.ComponentUtils; import com.fr.env.utils.DesignerInteractionHistory; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; +import com.fr.form.ui.container.WBorderLayout; import java.awt.*; @@ -29,7 +30,7 @@ public abstract class AccessDirection implements Direction { private int ymin; private int xmin; - abstract int getCursor(); + abstract int getCursor(); protected abstract Rectangle getDraggedBounds(int dx, int dy, Rectangle currentBounds, FormDesigner designer, Rectangle oldBounds); @@ -56,14 +57,14 @@ public abstract class AccessDirection implements Direction { x = designer.getRootComponent().getWidth(); } //参数面板可以无下限拉长 - if (y < 0) { - y = 0; - } else if (y > designer.getRootComponent().getHeight() + designer.getParaHeight() && designer.getSelectionModel().hasSelectionComponent() + if (y < 0) { + y = 0; + } else if (y > designer.getRootComponent().getHeight() + designer.getParaHeight() && designer.getSelectionModel().hasSelectionComponent() && !designer.getSelectionModel().getSelection().getSelectedCreator().acceptType(XWParameterLayout.class)) { - y = designer.getRootComponent().getHeight() + designer.getParaHeight(); - } - return new Point(x, y); - } + y = designer.getRootComponent().getHeight() + designer.getParaHeight(); + } + return new Point(x, y); + } protected void sorptionPoint(Point point, Rectangle currentBounds, FormDesigner designer) { boolean findInX = currentBounds.getWidth() <= MoveUtils.SORPTION_UNIT; @@ -100,10 +101,10 @@ public abstract class AccessDirection implements Direction { findInY = true; } - } - if (findInX && findInY) { - break; - } + } + if (findInX && findInY) { + break; + } } setDesignerStateModelProperties(designer, findInX, findInY, currentBounds, point); @@ -129,11 +130,10 @@ public abstract class AccessDirection implements Direction { } - private WAbsoluteLayout getLayout(final FormDesigner designer){ - XLayoutContainer formLayoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator( - designer.getTarget().getContainer()); + private WAbsoluteLayout getLayout(final FormDesigner designer) { WAbsoluteLayout layout; - if (formLayoutContainer.acceptType(XWBorderLayout.class)) {//看起来这边的作用应该是为了区别cpt(得到XWParameterLayout)还是frm(得到XWBorderLayout)的参数界面 + //看起来这边的作用应该是为了区别cpt(得到XWParameterLayout)还是frm(得到XWBorderLayout)的参数界面 + if (designer.getTarget().getContainer().acceptType(WBorderLayout.class)) { Container container = designer.getSelectionModel().getSelection().getSelectedCreator().getParent(); if (container instanceof XWAbsoluteLayout) { layout = ((XWAbsoluteLayout) container).toData(); @@ -161,49 +161,49 @@ public abstract class AccessDirection implements Direction { return; } //设定控件最小高度21,因每次拖曳至少移动1,防止控件高度等于21时,拖曳导致rec.y的变化使得控件不停的向上或向下移动。 - if(rec.height == MINHEIGHT){ + if (rec.height == MINHEIGHT) { ymin = rec.y; } - if(rec.height == MINHEIGHT - 1){ + if (rec.height == MINHEIGHT - 1) { ymin = ymin == rec.y ? rec.y : rec.y - 1; } - if(rec.height < MINHEIGHT){ + if (rec.height < MINHEIGHT) { rec.height = MINHEIGHT; rec.y = ymin; } // 增加下宽度也设最小为21 if (rec.width == MINWIDTH) { - xmin = rec.x; + xmin = rec.x; } - if(rec.width == MINWIDTH - 1){ - xmin = xmin == rec.x ? rec.x : rec.x - 1; + if (rec.width == MINWIDTH - 1) { + xmin = xmin == rec.x ? rec.x : rec.x - 1; } if (rec.width < MINWIDTH) { - rec.width = MINWIDTH; - rec.x = xmin; + rec.width = MINWIDTH; + rec.x = xmin; } } - /** - * 更新鼠标指针形状 - * @param formEditor 设计界面组件 - */ - public void updateCursor(FormDesigner formEditor) { + /** + * 更新鼠标指针形状 + * @param formEditor 设计界面组件 + */ + public void updateCursor(FormDesigner formEditor) { - // 调用位置枚举的多态方法getCursor获取鼠标形状 - int type = getCursor(); + // 调用位置枚举的多态方法getCursor获取鼠标形状 + int type = getCursor(); - if (type != formEditor.getCursor().getType()) { - // 设置当前形状 - formEditor.setCursor(Cursor.getPredefinedCursor(type)); + if (type != formEditor.getCursor().getType()) { + // 设置当前形状 + formEditor.setCursor(Cursor.getPredefinedCursor(type)); - // 显示/改变Tooltip + // 显示/改变Tooltip showTooltip(formEditor); - } - } + } + } - private void showTooltip(FormDesigner formEditor) { + private void showTooltip(FormDesigner formEditor) { // 显示拖拽改变组件尺寸相关的提示信息 int cursorType = formEditor.getCursor().getType(); if (Cursor.SW_RESIZE_CURSOR <= cursorType && cursorType <= Cursor.E_RESIZE_CURSOR) { @@ -217,15 +217,15 @@ public abstract class AccessDirection implements Direction { } } - public String getTooltip() { - return null; + public String getTooltip() { + return null; + } + + /** + * 生成组件备用的bound + * @param formEditor 设计界面组件 + */ + public void backupBounds(FormDesigner formEditor) { + formEditor.getSelectionModel().getSelection().backupBounds(); } - - /** - * 生成组件备用的bound - * @param formEditor 设计界面组件 - */ - public void backupBounds(FormDesigner formEditor) { - formEditor.getSelectionModel().getSelection().backupBounds(); - } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index 3856dde4b..55b9c191f 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -23,6 +23,7 @@ import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.NoSupportAuthorityEdit; import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.mainframe.loghandler.LogMessageBar; import com.fr.design.plugin.DesignerPluginContext; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.Widget; @@ -33,6 +34,7 @@ import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.JComponent; +import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.SwingUtilities; import javax.swing.border.Border; @@ -776,6 +778,10 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo if (popup == null) { popup = new SelectedPopupDialog(this, designer); } + JFrame frame = LogMessageBar.getInstance().getLogFrame(); + if (frame!= null && frame.isActive()) { + return; + } int creatorRightX = (int) ((bounds.x + bounds.width + SelectedPopupDialog.OFFSET_X) * designer.getScale()); int creatorRightY = (int) (bounds.y * designer.getScale()); int formDesignerWidth = designer.getWidth(); @@ -793,10 +799,13 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo SwingUtilities.invokeLater(new Runnable() { @Override public void run() { - popup.setLocation(designer.getLocationOnScreen().x + designer.getPaintX() + extraX, designer.getLocationOnScreen().y + designer.getPaintY() + extraY); - popup.updatePane(designer); - popup.setVisible(selected && accept && popup.hasVisibleButtons() && popup.isCanVisible() && !isShowPluginDialog()); - popup.setRelativeBounds(bounds); + try { + popup.setLocation(designer.getLocationOnScreen().x + designer.getPaintX() + extraX, designer.getLocationOnScreen().y + designer.getPaintY() + extraY); + popup.updatePane(designer); + popup.setVisible(selected && accept && popup.hasVisibleButtons() && popup.isCanVisible() && !isShowPluginDialog()); + popup.setRelativeBounds(bounds); + } catch (Exception ignored) { + } } }); } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java index f60aa9846..fc01aefaa 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java @@ -108,11 +108,6 @@ public class XWParameterLayout extends XWAbsoluteLayout { return false; } - @Override - public boolean canEnterIntoAdaptPane() { - return false; - } - /** * 该组件是否可以拖拽(表单中参数面板和自适应布局不可以拖拽) * @return 是则返回true diff --git a/designer-form/src/main/java/com/fr/design/fit/attrpane/FRAbsoluteBodyLayoutExtendDefinePane.java b/designer-form/src/main/java/com/fr/design/fit/attrpane/FRAbsoluteBodyLayoutExtendDefinePane.java index e4863adf8..5fafb8df8 100644 --- a/designer-form/src/main/java/com/fr/design/fit/attrpane/FRAbsoluteBodyLayoutExtendDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/fit/attrpane/FRAbsoluteBodyLayoutExtendDefinePane.java @@ -81,7 +81,7 @@ public class FRAbsoluteBodyLayoutExtendDefinePane extends FRAbsoluteLayoutDefine public JPanel createAdvancePane() { JPanel advancedContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - themePane = new FollowingThemePane(Toolkit.i18nText("Fine-Design_Form_Widget_Style_Setting")); + themePane = new FollowingThemePane(Toolkit.i18nText("Fine-Design_Form_Body_Style_Setting")); stylePane = new LayoutStylePane(); themePane.addFollowThemePane(stylePane, new FollowingThemePane.FollowingThemeActionChangeListener() { @Override diff --git a/designer-form/src/main/java/com/fr/design/fit/attrpane/FRFitLayoutExtendDefinePane.java b/designer-form/src/main/java/com/fr/design/fit/attrpane/FRFitLayoutExtendDefinePane.java index 77e468cb4..78e2c5c3a 100644 --- a/designer-form/src/main/java/com/fr/design/fit/attrpane/FRFitLayoutExtendDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/fit/attrpane/FRFitLayoutExtendDefinePane.java @@ -92,7 +92,7 @@ public class FRFitLayoutExtendDefinePane extends AbstractFRLayoutDefinePane contentDisplayType = new HashMap<>(); + Map contentDisplayTip = new HashMap<>(); public PcFitExpandablePane(DataModify attrPane) { init(attrPane); } public void init(final DataModify attrPane) { + initComboBox(); this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel pcFitPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); final JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); @@ -42,11 +52,11 @@ public class PcFitExpandablePane extends JPanel { comboBox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { - tipLabel.setText(ScaleTipType.getScaleTip(comboBox.getSelectedIndex()).getTip()); + tipLabel.setText(contentDisplayTip.get(comboBox.getSelectedItem())); } }); Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_Ec_Content_Display_Type")), comboBox}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Designer_Fit_Ec_Content_Display_Type")), comboBox}, new Component[]{tipLabel, null}, }; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_W0); @@ -58,50 +68,61 @@ public class PcFitExpandablePane extends JPanel { this.add(pcFitPane, BorderLayout.CENTER); } + private void initComboBox() { + for (Item item : defaultItems) { + comboBox.addItem(item.value); + contentDisplayType.put(item.key, item.value); + contentDisplayTip.put(item.value, item.tip); + } + + Set pcFitProviders = ExtraDesignClassManager.getInstance().getArray(PcFitProvider.XML_TAG); + + for (PcFitProvider pcFitProvider : pcFitProviders) { + comboBox.addItem(pcFitProvider.getContentDisplayValue()); + contentDisplayType.put(pcFitProvider.getContentDisplayKey(), pcFitProvider.getContentDisplayValue()); + contentDisplayTip.put(pcFitProvider.getContentDisplayValue(), pcFitProvider.getContentDisplayTip()); + } + } + public ReportFitAttr update() { - ReportFitAttr fitAttr = getReportFitAttr(); - fitAttr.setFitStateInPC(FitStateCompatible.getOldTypeFromNew(comboBox.getSelectedIndex())); + ReportFitAttr fitAttr = getDefaultReportFitAttr(); + String selectType = (String) comboBox.getSelectedItem(); + for (Integer key : contentDisplayType.keySet()) { + if (CompareUtils.isEqual(contentDisplayType.get(key), selectType)) { + fitAttr.setFitStateInPC(key); + } + } return fitAttr; } public void populate(ReportFitAttr fitAttr) { - if (fitAttr == null) { - fitAttr = getReportFitAttr(); + if (fitAttr == null || !contentDisplayType.keySet().contains(fitAttr.fitStateInPC())) { + fitAttr = getDefaultReportFitAttr(); + } + String selectType = contentDisplayType.get(fitAttr.fitStateInPC()); + for (int i = 0; i < comboBox.getItemCount(); i++) { + if (CompareUtils.isEqual(selectType, comboBox.getItemAt(i))) { + comboBox.setSelectedIndex(i); + tipLabel.setText(contentDisplayTip.get(selectType)); + } } - int selectIndex = FitStateCompatible.getNewTypeFromOld(fitAttr.fitStateInPC()); - comboBox.setSelectedIndex(selectIndex); - tipLabel.setText(ScaleTipType.getScaleTip(selectIndex).getTip()); } - private ReportFitAttr getReportFitAttr() { + private ReportFitAttr getDefaultReportFitAttr() { ReportFitAttr fitAttr = new ReportFitAttr(); fitAttr.setFitStateInPC(FitAttrState.NOT_FIT.getState()); return fitAttr; } - private enum ScaleTipType { - EC_DOUBLE_FIT(0, com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_Ec_Double_Fit_Tip")), - EC_HOR_FIT(1, com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_Ec_Hor_Fit_Tip")), - EC_NO_FIT(2, com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_Ec_No_Fit_Tip")); - private int index; - private String tip; + class Item { + public String value; + public int key; + public String tip; - ScaleTipType(int index, String tip) { - this.index = index; + Item(String value, int key, String tip) { + this.value = value; + this.key = key; this.tip = tip; } - - public String getTip() { - return tip; - } - - public static ScaleTipType getScaleTip(int selectIndex) { - for (ScaleTipType tipType : values()) { - if (selectIndex == tipType.index) { - return tipType; - } - } - return EC_NO_FIT; - } } } diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java index ee4a88409..09170b8c3 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java @@ -97,7 +97,7 @@ public class LayoutStylePane extends BasicBeanPane { return null; } this.integralStylePane = new ComponentIntegralStylePane(SETTING_LABEL_WIDTH, supportBorderImage, supportCornerRadius); - return this.createNamedSubStylePane(i18nText("Fine-Design_Form_Widget-Style_Background_Style"), this.integralStylePane); + return this.createNamedSubStylePane(i18nText("Fine-Design_Form_Widget-Style_Integral_Style"), this.integralStylePane); } protected JPanel createNamedSubStylePane(String name, JPanel stylePane) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 4acb0fb75..a7244c0f2 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -34,6 +34,7 @@ import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.LayoutUtils; import com.fr.general.ComparatorUtils; +import com.fr.stable.ArrayUtils; import com.fr.stable.Constants; import javax.swing.BorderFactory; @@ -645,16 +646,15 @@ public class EditingMouseListener extends MouseInputAdapter { selectionModel.selectACreatorAtMouseEvent(e); refreshTopXCreator(); XCreator[] xCreators = selectionModel.getSelection().getSelectedCreators(); - // 放到事件队尾执行 - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - for (XCreator xCreator : xCreators) { - xCreator.setSelected(!e.isShiftDown() && !e.isControlDown()); + if (ArrayUtils.getLength(xCreators) == 1) { + // 放到事件队尾执行 + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + xCreators[0].setSelected(!e.isShiftDown() && !e.isControlDown()); } - } - }); - + }); + } } else if (clickedNonCardButton && uneditedTab && responseTabLayout(oldCreator, e)) { // do nothing } else { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java index 9731dd508..7db972e9b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -2,12 +2,8 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.base.chart.BaseChartCollection; -import com.fr.base.theme.TemplateThemeAware; -import com.fr.base.theme.TemplateThemeCompatible; import com.fr.chart.chartattr.ChartCollection; import com.fr.chartx.attr.ChartProvider; -import com.fr.base.theme.FormTheme; -import com.fr.base.theme.TemplateTheme; import com.fr.design.DesignModelAdapter; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.TableDataTreePane; @@ -22,7 +18,6 @@ import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWParameterLayout; -import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.icon.IconPathConstants; @@ -32,24 +27,16 @@ import com.fr.design.mod.bean.ContentChangeItem; import com.fr.design.mod.event.TableDataModifyEvent; import com.fr.design.utils.ComponentUtils; import com.fr.event.EventDispatcher; -import com.fr.form.main.Form; -import com.fr.form.main.WidgetGather; -import com.fr.form.share.editor.SharableEditorProvider; import com.fr.form.share.SharableWidgetProvider; import com.fr.form.share.ShareLoader; -import com.fr.form.ui.AbstractBorderStyleWidget; -import com.fr.form.ui.ChartEditor; -import com.fr.form.ui.ElementCaseEditor; +import com.fr.form.share.editor.SharableEditorProvider; import com.fr.form.ui.Widget; import com.fr.stable.Constants; import com.fr.stable.StringUtils; -import java.util.Collections; -import java.util.HashMap; import javax.swing.BorderFactory; import javax.swing.JWindow; -import java.util.List; -import java.util.Map; +import javax.swing.SwingUtilities; import java.awt.Color; import java.awt.Component; import java.awt.Point; @@ -59,7 +46,10 @@ import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.dnd.DropTargetEvent; -import javax.swing.SwingUtilities; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * 添加模式下鼠标事件处理器。 @@ -150,9 +140,6 @@ public class FormCreatorDropTarget extends DropTarget { EventDispatcher.fire(TableDataModifyEvent.INSTANCE, new ContentChangeItem(tdNameMap, widget, ChangeItem.TABLE_DATA_NAME)); } - // 新疆的图表块和报表块默认主题化 - addThemeToNewWidget(addingXCreator); - designer.getSelectionModel().setSelectedCreators( FormSelectionUtils.rebuildSelection(xCreator, new Widget[]{widget})); designer.getEditListenerTable().fireCreatorModified(addingModel.getXCreator(), DesignerEvent.CREATOR_ADDED); @@ -363,37 +350,4 @@ public class FormCreatorDropTarget extends DropTarget { public TabDragInner getTabDragInner() { return this.tabDragInner; } - - private void addThemeToNewWidget(XCreator addingXCreator) { - JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (template == null) { - return; - } - TemplateTheme theme = template.getTemplateTheme(); - if (!(theme instanceof FormTheme)) { - return; - } - FormTheme formTheme = (FormTheme) theme; - - Form.traversalWidget(addingXCreator.toData(), new WidgetGather() { - @Override - public void dealWith(Widget widget) { - if (widget instanceof AbstractBorderStyleWidget) { - AbstractBorderStyleWidget styleWidget = (AbstractBorderStyleWidget) widget; - if (!styleWidget.supportThemed()) { - return; - } - - boolean followingTheme = (!addingXCreator.isShared()) || styleWidget.isBorderStyleFollowingTheme(); - styleWidget.setBorderStyleFollowingTheme(followingTheme); - if (followingTheme) { - styleWidget.onTemplateUsingThemeChange(formTheme, TemplateThemeCompatible.NONE); - } - } - } - @Override - public boolean dealWithAllCards() { return true; } - }, AbstractBorderStyleWidget.class); - addingXCreator.rebuid(); - } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 92127c5a8..636f1f548 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -2,6 +2,9 @@ package com.fr.design.mainframe; import com.fr.base.Parameter; import com.fr.base.ScreenResolution; +import com.fr.base.theme.FormTheme; +import com.fr.base.theme.TemplateTheme; +import com.fr.base.theme.TemplateThemeCompatible; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignState; @@ -41,6 +44,7 @@ import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.event.DesignerOpenedListener; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.fit.DesignerUIModeConfig; import com.fr.design.form.util.XCreatorConstants; @@ -57,7 +61,9 @@ import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseProvider; import com.fr.form.main.Form; +import com.fr.form.main.WidgetGather; import com.fr.form.parameter.FormSubmitButton; +import com.fr.form.ui.AbstractBorderStyleWidget; import com.fr.form.ui.EditorHolder; import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.Widget; @@ -1189,6 +1195,9 @@ public class FormDesigner extends TargetComponent
implements TreeSelection * @param xCreator 组件 */ public void startDraggingBean(XCreator xCreator) { + + // 新疆的图表块和报表块默认主题化 + addThemeToDroppedNewWidget(xCreator); // 根据所选择的组件的BeanInfo生成相应的AddingModel // AddingModel和StateModel不一样,适合当前选择的组件相关的 addingModel = new AddingModel(this, xCreator); @@ -1853,4 +1862,37 @@ public class FormDesigner extends TargetComponent implements TreeSelection public FormSpacingLineDrawer getSpacingLineDrawer() { return spacingLineDrawer; } + + private void addThemeToDroppedNewWidget(XCreator addingXCreator) { + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (template == null) { + return; + } + TemplateTheme theme = template.getTemplateTheme(); + if (!(theme instanceof FormTheme)) { + return; + } + FormTheme formTheme = (FormTheme) theme; + + Form.traversalWidget(addingXCreator.toData(), new WidgetGather() { + @Override + public void dealWith(Widget widget) { + if (widget instanceof AbstractBorderStyleWidget) { + AbstractBorderStyleWidget styleWidget = (AbstractBorderStyleWidget) widget; + if (!styleWidget.supportThemed()) { + return; + } + + boolean followingTheme = (!addingXCreator.isShared()) || styleWidget.isBorderStyleFollowingTheme(); + styleWidget.setBorderStyleFollowingTheme(followingTheme); + if (followingTheme) { + styleWidget.onTemplateUsingThemeChange(formTheme, TemplateThemeCompatible.NONE); + } + } + } + @Override + public boolean dealWithAllCards() { return true; } + }, AbstractBorderStyleWidget.class); + addingXCreator.rebuid(); + } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java b/designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java index 05780a6b0..a845759f7 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java @@ -120,7 +120,7 @@ public class InstallComponentAction extends UpdateAction { private boolean containRues(File[] chosenFiles) { for (File file : chosenFiles) { - if (file.getName().endsWith(ReuxUtils.REUS_SUFFIX)) + if (ReuxUtils.isReusFile(file)) return true; } return false; @@ -142,8 +142,7 @@ public class InstallComponentAction extends UpdateAction { return false; } ShareComponentUtils.checkReadMe(); - boolean isReus = chosenFile.getName().endsWith(ReuxUtils.REUS_SUFFIX); - return isReus ? InstallUtils.installReusFile(chosenFile, installTime, failList) : InstallUtils.installReuFile(chosenFile, installTime, failList); + return ReuxUtils.isReusFile(chosenFile) ? InstallUtils.installReusFile(chosenFile, installTime, failList) : InstallUtils.installReuFile(chosenFile, installTime, failList); } private static class InstallBackInfo { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java index c25f53f51..610f688a4 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java @@ -84,7 +84,7 @@ public class InstallUtils { @Nullable private static Group createComponentGroup(String fileName) { - String groupName = fileName.substring(0, fileName.indexOf(DOT + ReuxUtils.REUS_SUFFIX)); + String groupName = createGroupName(fileName); //有重名分组则加后缀 if (DefaultShareGroupManager.getInstance().getGroup(groupName) != null) { @@ -101,6 +101,15 @@ public class InstallUtils { return DefaultShareGroupManager.getInstance().getGroup(groupName); } + private static String createGroupName(String fileName) { + for (String suffix : ReuxUtils.SUPPORT_REUS_SUFFIX) { + if (fileName.endsWith(suffix)) { + return fileName.substring(0, fileName.indexOf(DOT + suffix)); + } + } + return fileName; + } + private static boolean installReuFile(Group group, File chosenFile, long installTime) { try { if (!group.installModule(chosenFile)) { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java index 769eb2944..442d872eb 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java @@ -83,7 +83,7 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane { public JPanel createAdvancePane() { JPanel advancedContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - themePane = new FollowingThemePane(Toolkit.i18nText("Fine-Design_Form_Widget_Style_Setting")); + themePane = new FollowingThemePane(Toolkit.i18nText("Fine-Design_Form_Body_Style_Setting")); stylePane = new LayoutStylePane(); themePane.addFollowThemePane(stylePane, new FollowingThemePane.FollowingThemeActionChangeListener() { @Override diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java index af09f027c..306b62246 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java @@ -88,7 +88,7 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane { @Override public Listener updateBean() { String actionLocaleName = ReportEngineEventMapping.getLocaleName(listener.getEventName()); - javaScriptActionPane.setResourceInfo(new JavaScriptResourceInfo(JavaScriptResourceInfo.Type.WEB_CONFIG, Toolkit.i18nText(actionLocaleName))); + + JavaScriptResourceInfo.PathNode pathNode = JavaScriptResourceInfo.PathNode.create(JavaScriptResourceInfo.Type.WEB_CONFIG, Toolkit.i18nText(actionLocaleName)); + JavaScriptResourceInfo javaScriptResourceInfo = new JavaScriptResourceInfo().addFirstPathNode(pathNode); + javaScriptActionPane.setResourceInfo(javaScriptResourceInfo); this.listener.setEventName(this.nameText.getText()); FurtherBasicBeanPane pane = this.cards.get(this.styleBox.getSelectedIndex()); this.listener.setAction(pane.updateBean()); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java index 1716fb476..9fd6027fb 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java @@ -15,6 +15,7 @@ import com.fr.design.gui.frpane.UITitlePanel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itabpane.TitleChangeListener; import com.fr.design.mainframe.cell.CellElementEditPane; +import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.general.GeneralContext; import com.fr.grid.selection.CellSelection; @@ -25,7 +26,6 @@ import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; -import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.Elem; import com.fr.report.elementcase.TemplateElementCase; @@ -138,7 +138,7 @@ public class CellElementPropertyPane extends DockingView { } if (element == null) { - element = new DefaultTemplateCellElement(0, 0); + element = DefaultThemedTemplateCellElementCase.createInstance(0, 0); } return element; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java index 0ddfdd3d7..370bcb49c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe; import com.fr.design.actions.utils.ReportActionUtils; import com.fr.design.dialog.BasicPane; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.design.widget.WidgetPane; import com.fr.form.ui.NoneWidget; import com.fr.form.ui.Widget; @@ -11,7 +12,6 @@ import com.fr.grid.selection.Selection; import com.fr.log.FineLoggerFactory; import com.fr.privilege.finegrain.WidgetPrivilegeControl; import com.fr.report.cell.CellElement; -import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; @@ -59,7 +59,7 @@ public class CellWidgetPropertyPane extends BasicPane { public void populate(TemplateCellElement cellElement) { if (cellElement == null) {// 利用默认的CellElement. - cellElement = new DefaultTemplateCellElement(0, 0, null); + cellElement = DefaultThemedTemplateCellElementCase.createInstance(0, 0, null); } Widget cellWidget = cellElement.getWidget(); @@ -88,7 +88,7 @@ public class CellWidgetPropertyPane extends BasicPane { final TemplateElementCase tplEC = ePane.getEditingElementCase(); TemplateCellElement editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow()); if (editCellElement == null) { - editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow()); + editCellElement = DefaultThemedTemplateCellElementCase.createInstance(cs.getColumn(), cs.getRow()); } this.cellElement = editCellElement; this.populate(editCellElement); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java index c73d094c9..dbc4269d6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java @@ -72,6 +72,7 @@ import com.fr.design.fun.ElementUIProvider; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.mainframe.cell.QuickEditorRegion; +import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.MenuDef; import com.fr.design.menu.NameSeparator; @@ -96,7 +97,6 @@ import com.fr.page.PageAttributeGetter; import com.fr.page.ReportPageAttrProvider; import com.fr.poly.creator.PolyElementCasePane; import com.fr.report.ReportHelper; -import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.FloatElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.cellattr.core.RichText; @@ -569,7 +569,7 @@ public abstract class ElementCasePane extends Tar int row = j + cellRectangle.y; TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); if (cellElement == null) { - cellElement = new DefaultTemplateCellElement(column, row); + cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row); elementCase.addCellElement(cellElement); } Style style = cellElement.getStyle(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java index 58b778065..54ba90ea9 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java @@ -11,6 +11,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.design.mainframe.toolbar.AuthorityEditToolBarComponent; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; @@ -291,7 +292,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane { int row = j + cellRectangle.y; TemplateCellElement editCellElement = elementCase.getTemplateCellElement(column, row); if (editCellElement == null) { - editCellElement = new DefaultTemplateCellElement(column, row); + editCellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row); elementCase.addCellElement(editCellElement); } else { // 对于合并的格子,我们不多次计算的权限. @@ -371,7 +372,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane { Rectangle cellRectangle = cellSelection.getCellRectangle(0); DefaultTemplateCellElement cellElement = (DefaultTemplateCellElement) elementCase.getCellElement(cellRectangle.x, cellRectangle.y); if (cellElement == null) { - cellElement = new DefaultTemplateCellElement(cellRectangle.x, cellRectangle.y); + cellElement = DefaultThemedTemplateCellElementCase.createInstance(cellRectangle.x, cellRectangle.y); } boolean firstCellDoneaAuthority = cellElement.isDoneAuthority( ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName()); @@ -507,7 +508,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane { int row = j + cellRectangle.y; DefaultTemplateCellElement cellElement = (DefaultTemplateCellElement) elementCase.getCellElement(column, row); if (cellElement == null) { - cellElement = new DefaultTemplateCellElement(cellSelection.getColumn(), cellSelection.getRow()); + cellElement = DefaultThemedTemplateCellElementCase.createInstance(cellSelection.getColumn(), cellSelection.getRow()); } if (cellElement.getCellWidgetAttr() == null) { isAllHasWidget = false; @@ -562,7 +563,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane { final TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); DefaultTemplateCellElement cellElement = (DefaultTemplateCellElement) elementCase.getCellElement(cellSelection.getColumn(), cellSelection.getRow()); if (cellElement == null) { - cellElement = new DefaultTemplateCellElement(cellSelection.getColumn(), cellSelection.getRow()); + cellElement = DefaultThemedTemplateCellElementCase.createInstance(cellSelection.getColumn(), cellSelection.getRow()); } //单元格带控件 if (cellElement.getCellWidgetAttr() != null) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java b/designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java index 9b89864b6..1256c7664 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java @@ -4,9 +4,9 @@ import com.fr.base.Style; import com.fr.design.actions.ElementCaseAction; +import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.Selection; -import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; @@ -129,7 +129,7 @@ public class FormatBrushAction extends ElementCaseAction { int row = j + cs.getRow(); TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); if (cellElement == null) { - cellElement = new DefaultTemplateCellElement(column, row); + cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row); elementCase.addCellElement(cellElement); } cellElement.setStyle(referencedStyle[i % columnSpan][j % rowSpan]); @@ -152,7 +152,7 @@ public class FormatBrushAction extends ElementCaseAction { int row = j + cellRectangle.y; TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); if (cellElement == null) { - cellElement = new DefaultTemplateCellElement(column, row); + cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row); elementCase.addCellElement(cellElement); } Style style = cellElement.getStyle(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java index 7b6fbff6f..f2bf5e585 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java @@ -26,6 +26,9 @@ import com.fr.base.BaseUtils; import com.fr.base.GraphHelper; import com.fr.base.svg.IconUtils; +import com.fr.base.theme.ReportTheme; +import com.fr.base.theme.TemplateTheme; +import com.fr.base.theme.TemplateThemeCompatible; import com.fr.base.vcs.DesignerMode; import com.fr.design.actions.UpdateAction; import com.fr.design.constants.UIConstants; @@ -807,7 +810,15 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse scrollIndex++; } - reportComposite.getEditingWorkBook().addReport(insertPos, newTemplateReport()); + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + TemplateTheme theme = template.getTemplateTheme(); + + TemplateReport templateReport = newTemplateReport(); + if (theme instanceof ReportTheme) { + templateReport.onTemplateUsingThemeChange((ReportTheme) theme, TemplateThemeCompatible.NONE); + } + + reportComposite.getEditingWorkBook().addReport(insertPos, templateReport); setSelectedIndex(insertPos); // sheet名字的公式也需要做相应的变化. diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index c708960d7..e7612c001 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -57,8 +57,6 @@ import javax.swing.KeyStroke; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; import javax.swing.Timer; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; import java.awt.AWTEvent; import java.awt.BorderLayout; import java.awt.Color; @@ -242,21 +240,28 @@ public class AlphaFineDialog extends UIDialog { if (hotData == null) { hotData = HotIssuesManager.getInstance().getHotIssues(); } - for (int i = 0; i < hotData.length; i++) { - panel.add(new HotIssueJpanel(hotData[i], i + 1)); - } } else { hotData = null; - for (int i = 0; i < AlphaFineConstants.HOT_ITEMS; i++) { - panel.add(new HotIssueJpanel(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Connection_Failed")}, i + 1)); - } } + initHotPane(panel, hotData); hotPane.add(uiLabel, BorderLayout.NORTH); hotPane.add(panel, BorderLayout.CENTER); add(hotPane, BorderLayout.SOUTH); setSize(AlphaFineConstants.FULL_SIZE); } + private void initHotPane(JPanel panel, String[][] hotData) { + if (hotData == null) { + for (int i = 0; i < AlphaFineConstants.HOT_ITEMS; i++) { + panel.add(new HotIssueJpanel(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Connection_Failed")}, i + 1)); + } + } else { + for (int i = 0; i < hotData.length; i++) { + panel.add(new HotIssueJpanel(hotData[i], i + 1)); + } + } + } + /** * 初始化输入框 */ diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java index 6897689b8..749a0a611 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.jetbrains.annotations.Nullable; /** @@ -71,6 +72,7 @@ public class HotIssuesManager { * 从热门问题接口获取热门问题 * @return */ + @Nullable public String[][] getHotIssues() { try { @@ -84,7 +86,7 @@ public class HotIssuesManager { } } } catch (Exception e) { - FineLoggerFactory.getLogger().error("hotissues search error: " + e.getMessage()); + FineLoggerFactory.getLogger().error("hotissues search error: " + e.getMessage(), e); return null; } return data; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/CellElementEditPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/CellElementEditPane.java index 487214a80..e54d03443 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/CellElementEditPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/CellElementEditPane.java @@ -8,13 +8,12 @@ import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.itabpane.TitleChangeListener; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.cell.settingpane.*; +import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.design.utils.DesignUtils; import com.fr.general.ComparatorUtils; - import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.Selection; import com.fr.report.cell.CellElement; -import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; @@ -112,7 +111,7 @@ public class CellElementEditPane extends BasicPane { CellElement cellElement = elementCase.getCellElement(cs.getColumn(), cs.getRow()); if (cellElement == null) { - cellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow()); + cellElement = DefaultThemedTemplateCellElementCase.createInstance(cs.getColumn(), cs.getRow()); //默认选中的是A1单元格,所以若是A1单元格没有加到列表时要加上,否则在聚合报表时会出错 if (cs.isSelectedOneCell(elementCasePane) && (cs.getColumn() + cs.getRow() == 0)) { elementCase.addCellElement((TemplateCellElement) cellElement); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/AbstractCellAttrPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/AbstractCellAttrPane.java index 83ef31eaa..d9f8ed633 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/AbstractCellAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/AbstractCellAttrPane.java @@ -2,9 +2,9 @@ package com.fr.design.mainframe.cell.settingpane; import com.fr.design.mainframe.AbstractAttrPane; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; -import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; @@ -52,7 +52,7 @@ public abstract class AbstractCellAttrPane extends AbstractAttrPane { TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); TemplateCellElement cellElement = elementCase.getTemplateCellElement(cs.getColumn(), cs.getRow()); if (cellElement == null) { - cellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow()); + cellElement = DefaultThemedTemplateCellElementCase.createInstance(cs.getColumn(), cs.getRow()); } this.cellElement = cellElement; elementCase.addCellElement(this.cellElement); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java index 0f7466af0..cd454660d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java @@ -12,9 +12,9 @@ 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.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.general.ComparatorUtils; import com.fr.general.IOUtils; -import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.cellattr.CellExpandAttr; import com.fr.report.elementcase.TemplateElementCase; @@ -239,7 +239,7 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { int row = j + cellRectangle.y; TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); if (cellElement == null) { - cellElement = new DefaultTemplateCellElement(column, row); + cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row); elementCase.addCellElement(cellElement); } updateBean(cellElement); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java index 1f0ebd779..1d02fde9c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java @@ -17,10 +17,10 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.VerticalFlowLayout; import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.general.ComparatorUtils; -import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.cellattr.CellGUIAttr; import com.fr.report.cell.cellattr.CellInsertPolicyAttr; @@ -570,7 +570,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane { int row = j + cellRectangle.y; TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); if (cellElement == null) { - cellElement = new DefaultTemplateCellElement(column, row); + cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row); elementCase.addCellElement(cellElement); } updateBean(cellElement); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellPresentPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellPresentPane.java index 960e93eec..881b8b083 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellPresentPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellPresentPane.java @@ -2,9 +2,9 @@ package com.fr.design.mainframe.cell.settingpane; import com.fr.base.present.Present; import com.fr.design.constants.UIConstants; +import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.design.present.PresentPane; -import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; @@ -67,7 +67,7 @@ public class CellPresentPane extends AbstractCellAttrPane { int row = j + cellRectangle.y; TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); if (cellElement == null) { - cellElement = new DefaultTemplateCellElement(column, row); + cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row); elementCase.addCellElement(cellElement); } cellElement.setPresent(present); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java index bbb63a391..a678c501a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java @@ -4,10 +4,10 @@ import com.fr.base.Style; import com.fr.design.actions.utils.ReportActionUtils; import com.fr.design.constants.UIConstants; import com.fr.design.mainframe.cell.settingpane.style.StylePane; +import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.design.style.BorderUtils; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; @@ -82,7 +82,7 @@ public class CellStylePane extends AbstractCellAttrPane { int row = j + cellRectangle.y; TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); if (cellElement == null) { - cellElement = new DefaultTemplateCellElement(column, row); + cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row); elementCase.addCellElement(cellElement); } cellElement.setStyle(s); @@ -100,7 +100,7 @@ public class CellStylePane extends AbstractCellAttrPane { int row = j + cellRectangle.y; TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); if (cellElement == null) { - cellElement = new DefaultTemplateCellElement(column, row); + cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row); elementCase.addCellElement(cellElement); } Style style = cellElement.getStyle(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java index 59bc73d57..93bf52397 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java @@ -4,6 +4,8 @@ import com.fr.base.NameStyle; import com.fr.base.Style; import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.BasicPane; +import com.fr.design.event.UIObserver; +import com.fr.design.event.UIObserverListener; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; @@ -24,8 +26,10 @@ import java.awt.Component; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; -public class StylePane extends BasicPane { +public class StylePane extends BasicPane implements UIObserver { public static final String[] FOLLOWING_THEME_STRING_ARRAYS = new String[]{ Toolkit.i18nText("Fine-Design_Style_Follow_Theme"), Toolkit.i18nText("Fine-Design_Style_Not_Follow_Theme"), @@ -40,6 +44,8 @@ public class StylePane extends BasicPane { private JPanel contentPane; + private final List observerListeners = new ArrayList<>(); + public StylePane() { followingThemeButtonGroup = new UIButtonGroup<>(FOLLOWING_THEME_STRING_ARRAYS); customStylePane = new CustomStylePane(); @@ -67,7 +73,7 @@ public class StylePane extends BasicPane { int selectedIndex = followingThemeButtonGroup.getSelectedIndex(); cardLayout.show(contentPane, FOLLOWING_THEME_STRING_ARRAYS[selectedIndex]); if (selectedIndex == 1) { - // 对于同一个单元格,跟随主题切换到自定义,若跟随主题面板有选中项,则自定义中的配置与其保持一致,否则自定义中配置保持不变 + // 对于同一个单元格,跟随主题切换到自定义,自定义中的配置与其保持一致 NameStyle lastSelectedNameStyle = themedCellStyleListPane.updateBean(); if (lastSelectedNameStyle != null) { Style lastSelectedRealStyle = lastSelectedNameStyle.getRealStyle(); @@ -81,10 +87,11 @@ public class StylePane extends BasicPane { } } } else { - // 对于同一个单元格,自定义切换到跟随主题,跟随主题应当清除选中项,即没有选中任何主题中的单元格样式, - // 因为还未选中,所以自定义中的配置保持不变,此时若用户切换会自定义,配置应当与之前一样 - themedCellStyleListPane.populateBean(null); + // 对于同一个单元格,自定义切换到跟随主题,跟随主题选中"默认"样式,并使用默认样式设置选中的单元格 + themedCellStyleListPane.reset(); } + + fireStateChanged(); } }); @@ -205,4 +212,19 @@ public class StylePane extends BasicPane { } } + private void fireStateChanged() { + for (UIObserverListener listener: observerListeners) { + listener.doChange(); + } + } + + @Override + public void registerChangeListener(UIObserverListener listener) { + observerListeners.add(listener); + } + + @Override + public boolean shouldResponseChangeListener() { + return true; + } } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java index 1ddf279c7..570d0d88d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java @@ -7,18 +7,20 @@ import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.settings.ThemedCellStyle; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerBean; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; -import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import javax.swing.BorderFactory; -import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListModel; +import javax.swing.JComponent; import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.ListCellRenderer; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; @@ -28,52 +30,21 @@ import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.io.Serializable; import java.util.List; public class ThemedCellStyleListPane extends FurtherBasicBeanPane implements DesignerBean { private static final int LEFT_BORDER = 10; private static final int RIGHT_BORDER = 10; - private DefaultListModel defaultListModel; - private JList styleList; + private final DefaultListModel defaultListModel; + private final JList styleList; private ChangeListener changeListener; public ThemedCellStyleListPane() { defaultListModel = new DefaultListModel<>(); styleList = new JList<>(defaultListModel); - DefaultListCellRenderer render = new DefaultListCellRenderer() { - private Style nameStyle; - - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - - if (value instanceof Style) { - this.nameStyle = (Style) value; - this.setText(" "); - } - this.setPreferredSize(new Dimension(210, 22)); - return this; - } - - @Override - public void paintComponent(Graphics g) { - super.paintComponent(g); - - if (nameStyle == null) { - return; - } - String text = "abcedfgh"; - if (nameStyle instanceof NameStyle) { - text = ((NameStyle) nameStyle).getName(); - } - Style.paintBackground((Graphics2D) g, nameStyle, getWidth() - 1, getHeight() - 1); - Style.paintContent((Graphics2D) g, text, nameStyle, getWidth() - 1, getHeight() - 1, ScreenResolution.getScreenResolution()); - Style.paintBorder((Graphics2D) g, nameStyle, getWidth() - 1, getHeight() - 1); - } - - }; - styleList.setCellRenderer(render); + styleList.setCellRenderer(new RadioButtonListCellRenderer()); setLayout(FRGUIPaneFactory.createBorderLayout()); add(styleList, BorderLayout.CENTER); setBorder(BorderFactory.createEmptyBorder(0 ,LEFT_BORDER, 0, RIGHT_BORDER)); @@ -106,14 +77,15 @@ public class ThemedCellStyleListPane extends FurtherBasicBeanPane imp * 重置 */ public void reset() { - + refreshBeanElement(); + styleList.setSelectedIndex(0); } @Override public void populateBean(NameStyle ob) { refreshBeanElement(); if (ob == null) { - styleList.setSelectedIndex(-1); + styleList.setSelectedIndex(0); return; } for (int i = 0; i < defaultListModel.getSize(); i++) { @@ -167,4 +139,64 @@ public class ThemedCellStyleListPane extends FurtherBasicBeanPane imp styleList.setModel(defaultListModel); } + private static class RadioButtonListCellRenderer extends JPanel implements ListCellRenderer, Serializable { + + private final UIRadioButton button; + private final PreviewArea previewArea; + + public RadioButtonListCellRenderer() { + super(); + setLayout(new BorderLayout(20, 0)); + setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); + setPreferredSize(new Dimension(getPreferredSize().width, 40)); + button = new UIRadioButton(); + previewArea = new PreviewArea(); + add(button, BorderLayout.WEST); + add(previewArea, BorderLayout.CENTER); + } + + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + button.setSelected(isSelected); + previewArea.setStyle((Style) value); + return this; + } + } + + private static class PreviewArea extends JComponent { + + private String paintText = "Report"; + private Style style = Style.DEFAULT_STYLE; + + public void setStyle(Style style) { + this.style = style; + if (style instanceof NameStyle) { + paintText = ((NameStyle) style).getName(); + } + repaint(); + } + + @Override + public void paintComponent(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + int resolution = ScreenResolution.getScreenResolution(); + + if (style == Style.DEFAULT_STYLE) { + // 如果是默认的style,就只写"Report"上去 + Style.paintContent(g2d, paintText, style, getWidth() - 3, getHeight() - 3, resolution); + return; + } + + Style.paintBackground(g2d, style, getWidth() - 3, getHeight() - 3); + + Style.paintContent(g2d, paintText, style, getWidth() - 3, getHeight() - 3, resolution); + + Style.paintBorder(g2d, style, getWidth() - 3, getHeight() - 3); + } + + @Override + public Dimension getMinimumSize() { + return getPreferredSize(); + } + } } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index 782c7f35d..fba15b043 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -156,11 +156,15 @@ public class DesignerSocketIO { private static String[] getSocketUri() throws IOException { Workspace current = WorkContext.getCurrent(); URL url = new URL(current.getPath()); - Integer[] ports = current.get(SocketInfoOperator.class).getPort(); + Integer[] ports = WebSocketConfig.getInstance().getAvailablePorts(); WorkspaceConnection connection = current.getConnection(); // 服务器配置https webSocket可能是wss也可能是ws webSocket的协议可以单独配置 WebSocketProtocol webSocketProtocol = WebSocketConfig.getInstance().getProtocol(); currentProtocol = webSocketProtocol == WebSocketProtocol.PLAIN ? HTTP : HTTPS; + if (WebSocketConfig.getInstance().isUsingProxy()) { + // 如果配置了代理服务器跟随服务器协议 + currentProtocol = url.getProtocol(); + } String[] result = new String[ports.length]; for (int i = 0; i < ports.length; i++) { result[i] = String.format("%s://%s:%s%s?%s=%s&%s=%s", @@ -173,7 +177,7 @@ public class DesignerSocketIO { RemoteDesignConstants.USER_LOCK_ID, connection.getId()); } - FineLoggerFactory.getLogger().error("Available ports: {}, current Protocol: {}", Arrays.toString(ports), currentProtocol); + FineLoggerFactory.getLogger().info("Available ports: {}, current Protocol: {}", Arrays.toString(ports), currentProtocol); return result; } diff --git a/designer-realize/src/main/java/com/fr/design/present/CellWriteAttrPane.java b/designer-realize/src/main/java/com/fr/design/present/CellWriteAttrPane.java index c1d4deaff..1a3c25e95 100644 --- a/designer-realize/src/main/java/com/fr/design/present/CellWriteAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/present/CellWriteAttrPane.java @@ -6,6 +6,7 @@ import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.design.widget.WidgetPane; import com.fr.form.ui.NoneWidget; import com.fr.form.ui.Widget; @@ -13,7 +14,6 @@ import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.Selection; import com.fr.log.FineLoggerFactory; import com.fr.privilege.finegrain.WidgetPrivilegeControl; -import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; @@ -67,7 +67,7 @@ public class CellWriteAttrPane extends BasicPane { public void populate(TemplateCellElement cellElement) { if (cellElement == null) {// 利用默认的CellElement. - cellElement = new DefaultTemplateCellElement(0, 0, null); + cellElement = DefaultThemedTemplateCellElementCase.createInstance(0, 0, null); } Widget cellWidget = cellElement.getWidget(); diff --git a/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java b/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java index ad0c57b51..4e06c9771 100644 --- a/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java +++ b/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java @@ -7,12 +7,12 @@ import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.general.NameObject; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.Selection; import com.fr.log.FineLoggerFactory; import com.fr.report.cell.CellElement; -import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.cellattr.highlight.DefaultHighlight; import com.fr.report.cell.cellattr.highlight.Highlight; @@ -82,7 +82,7 @@ public class ConditionAttributesGroupPane extends UIListControlPane { final TemplateElementCase tplEC = ePane.getEditingElementCase(); editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow()); if (editCellElement == null) { - editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow()); + editCellElement = DefaultThemedTemplateCellElementCase.createInstance(cs.getColumn(), cs.getRow()); } SheetUtils.calculateDefaultParent(tplEC); // 不知道这行代码的作用,怕去掉之后会出问题,先放在这里 diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java b/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java index e65e25949..91b3641ff 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java @@ -20,6 +20,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.cell.settingpane.style.ThemedCellStyleListPane; import com.fr.design.mainframe.theme.ui.NoEdgeTitleBorder; +import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.design.style.AlignmentPane; import com.fr.design.style.BorderPane; import com.fr.design.style.BorderUtils; @@ -33,7 +34,6 @@ import com.fr.grid.selection.Selection; import com.fr.log.FineLoggerFactory; import com.fr.plugin.solution.sandbox.collection.PluginSandboxCollections; import com.fr.report.cell.CellElement; -import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.FloatElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.ElementCase; @@ -135,7 +135,7 @@ public class ReportStylePane extends BasicPane { int selectedIndex = followingThemeButtonGroup.getSelectedIndex(); cardLayout.show(contentPane, FOLLOWING_THEME_STRING_ARRAYS[selectedIndex]); if (selectedIndex == 1) { - // 对于同一个单元格,跟随主题切换到自定义,若跟随主题面板有选中项,则自定义中的配置与其保持一致,否则自定义中配置保持不变 + // 对于同一个单元格,跟随主题切换到自定义,自定义中的配置与其保持一致 NameStyle lastSelectedNameStyle = themedCellStyleListPane.updateBean(); if (lastSelectedNameStyle != null) { Style lastSelectedRealStyle = lastSelectedNameStyle.getRealStyle(); @@ -149,9 +149,8 @@ public class ReportStylePane extends BasicPane { } } } else { - // 对于同一个单元格,自定义切换到跟随主题,跟随主题应当清除选中项,即没有选中任何主题中的单元格样式, - // 因为还未选中,所以自定义中的配置保持不变,此时若用户切换会自定义,配置应当与之前一样 - themedCellStyleListPane.populateBean(null); + // 对于同一个单元格,自定义切换到跟随主题,跟随主题选中"默认"样式,并使用默认样式设置选中的单元格 + themedCellStyleListPane.reset(); } } }); @@ -283,7 +282,7 @@ public class ReportStylePane extends BasicPane { editCellElement = report.getTemplateCellElement(column, row); if (editCellElement == null) { - editCellElement = new DefaultTemplateCellElement(column, row); + editCellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row); report.addCellElement(editCellElement); } @@ -421,7 +420,7 @@ public class ReportStylePane extends BasicPane { } } - stateChanged(evt); + CustomFloatStyleSettingPane.this.stateChanged(evt); } }); diff --git a/designer-realize/src/main/java/com/fr/design/style/BorderUtils.java b/designer-realize/src/main/java/com/fr/design/style/BorderUtils.java index 4f2fd61e9..828a2d435 100644 --- a/designer-realize/src/main/java/com/fr/design/style/BorderUtils.java +++ b/designer-realize/src/main/java/com/fr/design/style/BorderUtils.java @@ -9,12 +9,12 @@ import java.util.List; import com.fr.base.CellBorderStyle; import com.fr.base.Style; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.general.ComparatorUtils; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.report.cell.CellElement; -import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.FloatElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.ElementCase; @@ -433,7 +433,7 @@ public abstract class BorderUtils { for (int j = row; j < row + rowSpan; j++) { TemplateCellElement tmpCellElement = report.getTemplateCellElement(i, j); if (tmpCellElement == null) { - tmpCellElement = new DefaultTemplateCellElement(i, j); + tmpCellElement = DefaultThemedTemplateCellElementCase.createInstance(i, j); report.addCellElement(tmpCellElement); } Style style = tmpCellElement.getStyle(); @@ -516,7 +516,7 @@ public abstract class BorderUtils { for (int j = row; j < row + rowSpan; j++) { TemplateCellElement tmpCellElement = report.getTemplateCellElement(i, j); if (tmpCellElement == null) { - tmpCellElement = new DefaultTemplateCellElement(i, j); + tmpCellElement = DefaultThemedTemplateCellElementCase.createInstance(i, j); report.addCellElement(tmpCellElement); } Style style = tmpCellElement.getStyle(); diff --git a/designer-realize/src/main/java/com/fr/design/style/StylePane.java b/designer-realize/src/main/java/com/fr/design/style/StylePane.java index 78b0b289c..265f25696 100644 --- a/designer-realize/src/main/java/com/fr/design/style/StylePane.java +++ b/designer-realize/src/main/java/com/fr/design/style/StylePane.java @@ -16,6 +16,7 @@ import com.fr.design.fun.StyleUIConfigProvider; import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.design.style.background.BackgroundPane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.grid.selection.CellSelection; @@ -24,7 +25,6 @@ import com.fr.grid.selection.Selection; import com.fr.log.FineLoggerFactory; import com.fr.plugin.solution.sandbox.collection.PluginSandboxCollections; import com.fr.report.cell.CellElement; -import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.FloatElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.ElementCase; @@ -322,7 +322,7 @@ public class StylePane extends BasicBeanPane