From 88ea59c3311d5c08db887a90b01267428a5e632e Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Tue, 25 Feb 2020 19:15:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1,=20=E5=86=B2?= =?UTF-8?q?=E7=AA=81=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/PreferencePane.java | 73 ++- .../fr/design/gui/itextfield/TextFieldUI.java | 53 -- .../design/designer/creator/XWFitLayout.java | 2 +- .../java/com/fr/design/style/StylePane.java | 34 +- .../src/main/java/com/fr/start/Designer.java | 525 +----------------- 5 files changed, 91 insertions(+), 596 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/gui/itextfield/TextFieldUI.java diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 55ccfce636..207bdf36dd 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -223,17 +223,16 @@ public class PreferencePane extends BasicPane { upmSelectorPane.add(useOptimizedUPMCheckbox); advancePane.add(upmSelectorPane); - //REPORT-23578 先屏蔽掉 - //JPanel dbmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Database_Manager")); - //useUniverseDBMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_Universe_Database_Manager")); - //dbmSelectorPane.add(useUniverseDBMCheckbox); - //advancePane.add(dbmSelectorPane); + JPanel dbmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Database_Manager")); + useUniverseDBMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_Universe_Database_Manager")); + dbmSelectorPane.add(useUniverseDBMCheckbox); + advancePane.add(dbmSelectorPane); JPanel improvePane = FRGUIPaneFactory.createVerticalTitledBorderPane(i18nText("Fine-Design_Basic_Product_Improve")); joinProductImproveCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Join_Product_Improve")); improvePane.add(joinProductImproveCheckBox); - if(SupportOSImpl.AUTOPUSHUPDATE.support()){ + if (SupportOSImpl.AUTOPUSHUPDATE.support()) { autoPushUpdateCheckBox = new UICheckBox(i18nText("Fine-Design_Automatic_Push_Update")); improvePane.add(autoPushUpdateCheckBox); } @@ -511,23 +510,8 @@ public class PreferencePane extends BasicPane { JPanel logLevelPane = FRGUIPaneFactory.createTitledBorderPane("log" + i18nText("Fine-Design_Basic_Level_Setting")); logPane.add(logLevelPane); logLevelComboBox = new UIComboBox(LOG); + logLevelComboBox.setEnabled(WorkContext.getCurrent().isLocal()); logLevelPane.add(logLevelComboBox); - logLevelComboBox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - Configurations.update(new Worker() { - @Override - public void run() { - Log4jConfig.getInstance().setRootLevel((Level) logLevelComboBox.getSelectedItem()); - } - - @Override - public Class[] targets() { - return new Class[]{Log4jConfig.class}; - } - }); - } - }); } private void createLanPane(JPanel generalPane) { @@ -555,8 +539,8 @@ public class PreferencePane extends BasicPane { }); UILabel noticeLabel = new UILabel(i18nText("Fine-Design_Basic_Work_After_Restart_Designer"));//sail:提示重启后生效 double p = TableLayout.PREFERRED; - double rowSize[] = {p}; - double columnSize[] = {p, p, p}; + double[] rowSize = {p}; + double[] columnSize = {p, p, p}; Component[][] components = { {languageLabel, languageComboBox, noticeLabel}, }; @@ -596,7 +580,7 @@ public class PreferencePane extends BasicPane { private void createLengthPane(JPanel advancePane) { double p = TableLayout.PREFERRED; - double rowSize[] = {p}; + double[] rowSize = {p}; // 长度单位选择 JPanel lengthPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Setting_Ruler_Units")); @@ -618,8 +602,8 @@ public class PreferencePane extends BasicPane { private void createServerPane(JPanel advancePane) { double p = TableLayout.PREFERRED; - double rowSize[] = {p}; - double columnSize[] = {p, p, p}; + double[] rowSize = {p}; + double[] columnSize = {p, p, p}; JPanel serverPortPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Web_Preview_Port_Setting")); advancePane.add(serverPortPane); @@ -658,7 +642,7 @@ public class PreferencePane extends BasicPane { /** * The method of populate. * - * @param designerEnvManager + * @param designerEnvManager 设计器环境管理器 */ public void populate(DesignerEnvManager designerEnvManager) { if (designerEnvManager == null) { @@ -687,7 +671,7 @@ public class PreferencePane extends BasicPane { defaultStringToFormulaBox.setSelected(false); } VcsConfigManager vcsConfigManager = designerEnvManager.getVcsConfigManager(); - if (WorkContext.getCurrent().isCluster()) { + if (WorkContext.getCurrent().isCluster()){ vcsEnableCheckBox.setEnabled(false); gcEnableCheckBox.setEnabled(false); } @@ -729,7 +713,7 @@ public class PreferencePane extends BasicPane { useOptimizedUPMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseOptimizedUPM()); - //useUniverseDBMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseUniverseDBM()); + useUniverseDBMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseUniverseDBM()); this.oracleSpace.setSelected(designerEnvManager.isOracleSystemSpace()); this.cachingTemplateSpinner.setValue(designerEnvManager.getCachingTemplateLimit()); @@ -826,23 +810,30 @@ public class PreferencePane extends BasicPane { designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50); } - Configurations.update(new Worker() { - @Override - public void run() { - Log4jConfig.getInstance().setRootLevel(((Level) logLevelComboBox.getSelectedItem())); - } + if (WorkContext.getCurrent().isLocal()) { + Configurations.update(new Worker() { + @Override + public void run() { + Level level = (Level) logLevelComboBox.getSelectedItem(); + if (level != null) { + Log4jConfig.getInstance().setRootLevel(level); + } + } - @Override - public Class[] targets() { - return new Class[]{Log4jConfig.class}; - } - }); + @Override + public Class[] targets() { + @SuppressWarnings("unchecked") + Class[] classes = new Class[]{Log4jConfig.class}; + return classes; + } + }); + } Configurations.update(new Worker() { @Override public void run() { ServerPreferenceConfig.getInstance().setUseOptimizedUPM(useOptimizedUPMCheckbox.isSelected()); - //ServerPreferenceConfig.getInstance().setUseUniverseDBM(useUniverseDBMCheckbox.isSelected()); + ServerPreferenceConfig.getInstance().setUseUniverseDBM(useUniverseDBMCheckbox.isSelected()); } @Override diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/TextFieldUI.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/TextFieldUI.java deleted file mode 100644 index 2d0891181e..0000000000 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/TextFieldUI.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.fr.design.gui.itextfield; - -import java.awt.Graphics; - -import javax.swing.plaf.metal.MetalTextFieldUI; -import javax.swing.text.JTextComponent; - -import de.muntjak.tinylookandfeel.Theme; - -public class TextFieldUI extends MetalTextFieldUI { - - - protected void paintBackground(Graphics g) { - JTextComponent editor = getComponent(); - // We will only be here if editor is opaque, so we don't have to test - - if(editor.isEnabled()) { - if(editor.isEditable()) { - g.setColor(editor.getBackground()); - } - else { - // not editable - if(editor.getBackground().equals(Theme.textBgColor[Theme.style].getColor())) { - // set default panel background - g.setColor(Theme.backColor[Theme.style].getColor()); - } - else { - // color changed by user - set textfield background - g.setColor(editor.getBackground()); - } - } - - g.fillRect(0, 0, editor.getWidth(), editor.getHeight()); - } - else { - if(editor.getBackground().equals(Theme.textBgColor[Theme.style].getColor())) { - g.setColor(Theme.textDisabledBgColor[Theme.style].getColor()); - } - else { - // color changed by user - set textfield background - g.setColor(editor.getBackground()); - } - - g.fillRect(0, 0, editor.getWidth(), editor.getHeight()); - - if(Theme.style != Theme.YQ_STYLE) return; - - g.setColor(Theme.backColor[Theme.style].getColor()); - g.drawRect(1, 1, editor.getWidth() - 3, editor.getHeight() - 3); - g.drawRect(2, 2, editor.getWidth() - 5, editor.getHeight() - 5); - } - } -} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java index 714bd0a2ea..3fb0b5f969 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java @@ -22,7 +22,6 @@ import com.fr.general.FRLogger; import com.fr.general.FRScreen; import com.fr.stable.ArrayUtils; import com.fr.stable.AssistUtils; -import edu.emory.mathcs.backport.java.util.Arrays; import javax.swing.JOptionPane; import java.awt.Component; @@ -31,6 +30,7 @@ import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.event.ContainerEvent; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.List; 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 fc53376479..78b0b289cf 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 @@ -8,8 +8,11 @@ import com.fr.base.NameStyle; import com.fr.base.ScreenResolution; import com.fr.base.Style; import com.fr.base.core.StyleUtils; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.fun.MultiStyleUIConfigProvider; +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; @@ -19,6 +22,7 @@ import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; 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; @@ -27,7 +31,6 @@ import com.fr.report.elementcase.ElementCase; import com.fr.report.elementcase.TemplateElementCase; import javax.swing.JComponent; -import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTabbedPane; import javax.swing.event.ChangeEvent; @@ -39,6 +42,8 @@ import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; +import java.util.List; +import java.util.Set; /** * Style Pane. @@ -49,6 +54,7 @@ public class StylePane extends BasicBeanPane