diff --git a/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java b/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java index 50d6448b8..b188cb5aa 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java @@ -55,7 +55,7 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO private static final int ANGEL = 90; private static final int GAP = 23; private static final int VERGAP = 3; - private static final Dimension SPINNER_DIMENSION = new Dimension(70, 20); + private static final Dimension SPINNER_DIMENSION = new Dimension(75, 20); private static final String[] TEXT = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Wrap_Text"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Single_Line"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Single_Line(Adjust_Font)"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Multi_Line(Adjust_Font)")}; diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BackgroundNoImagePane.java b/designer-base/src/main/java/com/fr/design/gui/style/BackgroundNoImagePane.java index 556b27c21..d3ed4f1af 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BackgroundNoImagePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BackgroundNoImagePane.java @@ -28,7 +28,7 @@ public class BackgroundNoImagePane extends BackgroundPane{ fireStateChanged(); } }); - GradientBackgroundQuickPane gradientPane = createGradientBackgroundQuickPane(); + GradientBackgroundQuickPane gradientPane = new GradientBackgroundQuickPane(); gradientPane.registerChangeListener(new UIObserverListener() { @Override @@ -42,8 +42,4 @@ public class BackgroundNoImagePane extends BackgroundPane{ gradientPane }; } - - protected GradientBackgroundQuickPane createGradientBackgroundQuickPane(){ - return new GradientBackgroundQuickPane(); - } } diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java b/designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java index 407c522ce..13dd9e3c9 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java @@ -71,7 +71,7 @@ public class BackgroundPane extends AbstractBasicStylePane { double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ new Component[]{null, null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fill"), SwingConstants.LEFT),typeComboBox}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fill") + " ", SwingConstants.LEFT),typeComboBox}, new Component[]{null, centerPane} }; double[] rowSize = {p, p, p}; @@ -89,7 +89,7 @@ public class BackgroundPane extends AbstractBasicStylePane { kinds.add(new TextureBackgroundQuickPane()); kinds.add(new PatternBackgroundQuickPane()); kinds.add(new ImageBackgroundQuickPane()); - kinds.add(createGradientBackgroundQuickPane()); + kinds.add(new GradientBackgroundQuickPane()); Set providers = ExtraDesignClassManager.getInstance().getArray(BackgroundQuickUIProvider.MARK_STRING); for (BackgroundQuickUIProvider provider : providers) { kinds.add(provider.appearanceForBackground()); @@ -98,10 +98,6 @@ public class BackgroundPane extends AbstractBasicStylePane { return kinds.toArray(new BackgroundQuickPane[kinds.size()]); } - protected GradientBackgroundQuickPane createGradientBackgroundQuickPane(){ - return new GradientBackgroundQuickPane(); - } - /** * 事件监听 diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BackgroundSpecialPane.java b/designer-base/src/main/java/com/fr/design/gui/style/BackgroundSpecialPane.java index 3713fca7b..7fa266423 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BackgroundSpecialPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BackgroundSpecialPane.java @@ -39,7 +39,7 @@ public class BackgroundSpecialPane extends BackgroundPane{ fireStateChanged(); } }); - GradientBackgroundQuickPane gradientPane = createGradientBackgroundQuickPane(); + GradientBackgroundQuickPane gradientPane = new GradientBackgroundQuickPane(); gradientPane.registerChangeListener(new UIObserverListener() { @Override public void doChange() { @@ -68,8 +68,4 @@ public class BackgroundSpecialPane extends BackgroundPane{ return kinds.toArray(new BackgroundQuickPane[kinds.size()]); } - - protected GradientBackgroundQuickPane createGradientBackgroundQuickPane(){ - return new GradientBackgroundQuickPane(); - } } 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 406ab878e..73d5d0bb1 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 @@ -6,7 +6,6 @@ import com.fr.base.Parameter; import com.fr.base.ScreenResolution; import com.fr.base.io.BaseBook; import com.fr.base.iofile.attr.DesignBanCopyAttrMark; -import com.fr.base.iofile.attr.PredefinedStyleAttrMark; import com.fr.base.iofile.attr.TemplateIdAttrMark; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignModelAdapter; @@ -39,9 +38,6 @@ import com.fr.design.gui.itree.filetree.TemplateFileTree; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.chart.info.ChartInfoCollector; -import com.fr.design.mainframe.predefined.info.PredefinedStyleInfoCollector; -import com.fr.design.mainframe.predefined.ui.ReportPredefinedStylePane; -import com.fr.design.mainframe.predefined.ui.dialog.ReportPredefinedStyleDialog; import com.fr.design.mainframe.template.info.TemplateInfoCollector; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.template.info.TimeConsumeTimer; @@ -51,8 +47,6 @@ import com.fr.design.menu.MenuDef; import com.fr.design.menu.NameSeparator; import com.fr.design.menu.ShortCut; import com.fr.design.preview.PagePreview; -import com.fr.design.ui.util.UIUtil; -import com.fr.design.utils.DesignUtils; import com.fr.design.write.submit.DBManipulationInWidgetEventPane; import com.fr.design.write.submit.DBManipulationPane; import com.fr.file.FILE; @@ -61,7 +55,6 @@ import com.fr.file.MemFILE; import com.fr.form.ui.NoneWidget; import com.fr.form.ui.Widget; import com.fr.general.ComparatorUtils; -import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginRuntime; @@ -80,17 +73,13 @@ import com.fr.stable.StringUtils; import com.fr.stable.core.UUID; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; + import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JOptionPane; -import javax.swing.SwingConstants; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.undo.UndoManager; -import java.awt.Dimension; -import java.awt.FontMetrics; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.Arrays; import java.util.Set; @@ -101,8 +90,6 @@ import java.awt.BorderLayout; * 报表设计和表单设计的编辑区域(设计器编辑的IO文件) */ public abstract class JTemplate> extends TargetComponent implements ToolBarMenuDockPlus, DesignerProxy { - - private static final int PREDEFINED_ICON_WIDTH = 27; // TODO ALEX_SEP editingFILE这个属性一定要吗?如果非要不可,有没有可能保证不为null private static final int PREFIX_NUM = 3000; private FILE editingFILE = null; @@ -121,7 +108,6 @@ public abstract class JTemplate> private PreviewProvider previewType; protected TimeConsumeTimer consumeTimer = new TimeConsumeTimer(); public int resolution = ScreenResolution.getScreenResolution(); - private UIButton predefinedBtn; private PluginEventListener pluginListener; @@ -156,21 +142,8 @@ public abstract class JTemplate> consumeTimer.setEnabled(shouldInitForCollectInfo(isNewFile)); initAndStartPlugin(); - - setPredefinedInfo(isNewFile); - } - - private void setPredefinedInfo(boolean isNewFile){ - if (this.template.getAttrMark(PredefinedStyleAttrMark.XML_TAG) == null) { - PredefinedStyleAttrMark attrMark = PredefinedStyleAttrMark.createDefaultStyleMark(); - if (!isNewFile || !DesignUtils.checkDesignerRemoteVersion()) { - attrMark.setPreferenceStyleName(InterProviderFactory.getProvider().getLocText("Fine-Engine_Predefined_Style_Compatibility")); - } - this.template.addAttrMark(attrMark); - } } - private void initAndStartPlugin() { initPluginPane(); startListenPlugin(); @@ -572,18 +545,6 @@ public abstract class JTemplate> protected abstract void applyUndoState(U u); - protected void refreshPredefinedState() { - UIUtil.invokeLaterIfNeeded(new Runnable() { - @Override - public void run() { - if(predefinedBtn != null){ - JTemplate.this.predefinedBtn.setText(getTemplatePredefinedStyle()); - setPredefinedButtonSize(predefinedBtn); - } - } - }); - } - /** * 停止编辑, 判断保存属性 * */ @@ -835,9 +796,7 @@ public abstract class JTemplate> if (editingFILE == null || editingFILE instanceof MemFILE) { return false; } - PredefinedStyleInfoCollector.getInstance().collectUseNumber(this.getTemplatePredefinedStyle()); try { - this.getTarget().setPredefinedStyleName(this.getTemplatePredefinedStyle(), false); this.getTarget().export(editingFILE.asOutputStream()); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); @@ -1337,65 +1296,10 @@ public abstract class JTemplate> for (DesignerFrameUpButtonProvider provider : providers) { uiButtons = ArrayUtils.addAll(uiButtons, provider.getUpButtons(getMenuState())); } - predefinedBtn = createPreDefinedButton(); - if (predefinedBtn != null) { - uiButtons = ArrayUtils.addAll(uiButtons, new UIButton[]{predefinedBtn}); - } - return uiButtons; - } - - private UIButton createPreDefinedButton() { - UIButton preferenceButton = new UIButton(BaseUtils.readIcon("/com/fr/design/icon/icon_predefined_style.png")); - preferenceButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Template_Style")); - preferenceButton.setText(getTemplatePredefinedStyle()); - preferenceButton.setAlignmentX(SwingConstants.LEFT); - setPredefinedButtonSize(preferenceButton); - preferenceButton.set4ToolbarButton(); - preferenceButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); - ReportPredefinedStylePane stylePane = new ReportPredefinedStylePane(JTemplate.this); - ReportPredefinedStyleDialog dialog = new ReportPredefinedStyleDialog(designerFrame, stylePane); - PredefinedStyleInfoCollector.getInstance().collectClickNumber(); - dialog.setVisible(true); - - } - }); - preferenceButton.setEnabled(DesignUtils.checkDesignerRemoteVersion()); - return preferenceButton; - } - - - - private void setPredefinedButtonSize(UIButton predefinedBtn) { - String text = predefinedBtn.getText(); - FontMetrics metrics = predefinedBtn.getFontMetrics(predefinedBtn.getFont()); - predefinedBtn.setPreferredSize(new Dimension(Math.min(metrics.stringWidth(text) + PREDEFINED_ICON_WIDTH, 100), 20)); - } - - public void resetPredefinedStyle(String styleName) { - this.getTarget().setPredefinedStyleName(styleName, true); - refreshPredefinedState(); - UIUtil.invokeLaterIfNeeded(new Runnable() { - @Override - public void run() { - JTemplate.this.fireTargetModified(); - JTemplate.this.repaint(); - } - }); - - } - public String getTemplatePredefinedStyle(){ - PredefinedStyleAttrMark attrMark = this.getTarget().getAttrMark(PredefinedStyleAttrMark.XML_TAG); - if (attrMark == null){ - attrMark = PredefinedStyleAttrMark.createDefaultStyleMark(); - } - return attrMark.getPreferenceStyleName(); + return uiButtons; } - /** * 由于老版本的模板没有模板ID,当勾选使用参数模板时候,就加一个模板ID attr * @@ -1419,4 +1323,8 @@ public abstract class JTemplate> return getEditingFILE().getName(); } + public String getTemplatePredefinedStyle(){ + return StringUtils.EMPTY; + } + } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java index 6ac14505a..15291211c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.burying.point; import com.fr.base.FRContext; import com.fr.base.io.XMLReadHelper; import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.template.info.SendHelper; import com.fr.log.FineLoggerFactory; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; @@ -19,20 +20,25 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; /** * @author Bjorn * @version 10.0 * Created by Bjorn on 2020-02-21 */ -public abstract class AbstractPointCollector implements BasePointCollector { - +public abstract class AbstractPointCollector implements BasePointCollector { + protected Map pointInfoMap; private static final int MAX_SIZE = 512 * 1024 * 1024; public AbstractPointCollector() { - + pointInfoMap = new ConcurrentHashMap<>(); + loadFromFile(); } /** @@ -42,6 +48,34 @@ public abstract class AbstractPointCollector implements BasePointCollector { return FileUtils.sizeOf(getInfoFile()) <= MAX_SIZE && DesignerEnvManager.getEnvManager().isJoinProductImprove() && FRContext.isChineseEnv(); } + @Override + public void sendPointInfo() { + + addIdleDayCount(); + + List removeList = new ArrayList<>(); + List sendList = new ArrayList<>(); + + for (String key : pointInfoMap.keySet()) { + AbstractPointInfo pointInfo = pointInfoMap.get(key); + pointInfo.selectPoint(removeList, sendList); + } + + // 发送记录 + for (String key : sendList) { + if(SendHelper.sendPointInfo(pointInfoMap.get(key))){ + removeList.add(key); + } + } + + // 清空记录 + for (String key : removeList) { + pointInfoMap.remove(key); + } + + saveInfo(); + } + /** * 从文件中读取埋点信息 */ diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractTemplateInfoCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractTemplateInfoCollector.java deleted file mode 100644 index 34dc5ea2a..000000000 --- a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractTemplateInfoCollector.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.fr.design.mainframe.burying.point; - -import com.fr.design.mainframe.template.info.SendHelper; -import com.fr.design.mainframe.template.info.TemplateProcessInfo; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * Created by kerry on 2020-09-04 - */ -public abstract class AbstractTemplateInfoCollector extends AbstractPointCollector { - protected Map pointInfoMap; - - public AbstractTemplateInfoCollector() { - pointInfoMap = new ConcurrentHashMap<>(); - loadFromFile(); - - } - - - /** - * 保存埋点的信息到本地 - */ - public abstract void collectInfo(String templateID, String originID, TemplateProcessInfo processInfo, int timeConsume); - - @Override - public void sendPointInfo() { - - addIdleDayCount(); - - List removeList = new ArrayList<>(); - List sendList = new ArrayList<>(); - - for (String key : pointInfoMap.keySet()) { - BasePointInfo pointInfo = pointInfoMap.get(key); - pointInfo.selectPoint(removeList, sendList); - } - - // 发送记录 - for (String key : sendList) { - if(SendHelper.sendPointInfo(pointInfoMap.get(key))){ - removeList.add(key); - } - } - - // 清空记录 - for (String key : removeList) { - pointInfoMap.remove(key); - } - - saveInfo(); - } - -} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java index e2a3c778c..f10f1682e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.burying.point; +import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.stable.xml.XMLReadable; import com.fr.stable.xml.XMLWriter; @@ -15,4 +16,8 @@ public interface BasePointCollector extends XMLReadable, XMLWriter { */ public void sendPointInfo(); + /** + * 保存埋点的信息到本地 + */ + public void collectInfo(String templateID, String originID, TemplateProcessInfo processInfo, int timeConsume); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java index 428e5625c..cd651fc6b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java @@ -4,7 +4,7 @@ import com.fr.base.io.BaseBook; import com.fr.chartx.attr.ChartProvider; import com.fr.chartx.config.info.AbstractConfig; import com.fr.chartx.config.info.constant.ConfigType; -import com.fr.design.mainframe.burying.point.AbstractTemplateInfoCollector; +import com.fr.design.mainframe.burying.point.AbstractPointCollector; import com.fr.design.mainframe.template.info.TemplateInfo; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.general.ComparatorUtils; @@ -21,7 +21,7 @@ import java.util.Map; * @version 10.0 * Created by Bjorn on 2020-02-18 */ -public class ChartInfoCollector extends AbstractTemplateInfoCollector { +public class ChartInfoCollector extends AbstractPointCollector { private static final String XML_TAG = "ChartInfoCollector"; private static final String XML_LAST_EDIT_DAY = "lastEditDay"; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/PatternStyle.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/PatternStyle.java index 94892f75e..c4ebcf225 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/PatternStyle.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/PatternStyle.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.predefined; import com.fr.config.predefined.PredefinedStyle; -import com.fr.predefined.PredefinedPatternStyleManager; +//import com.fr.predefined.PredefinedPatternStyleManager; /** @@ -11,13 +11,15 @@ public enum PatternStyle { DARK_STYLE(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Dark_Pattern")) { @Override public PredefinedStyle getPredefinedStyle() { - return PredefinedPatternStyleManager.INSTANCE.getDarkMode(); +// return PredefinedPatternStyleManager.INSTANCE.getDarkMode(); + return new PredefinedStyle(); } }, LIGHT_STYLE(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Light_Pattern")) { @Override public PredefinedStyle getPredefinedStyle() { - return PredefinedPatternStyleManager.INSTANCE.getLightMode(); +// return PredefinedPatternStyleManager.INSTANCE.getLightMode(); + return new PredefinedStyle(); } }; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java deleted file mode 100644 index 9dfe2e9db..000000000 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.fr.design.mainframe.predefined.info; - -import com.fr.config.MarketConfig; -import com.fr.design.DesignerEnvManager; -import com.fr.design.i18n.Toolkit; -import com.fr.design.mainframe.burying.point.AbstractPointCollector; -import com.fr.design.mainframe.template.info.SendHelper; -import com.fr.general.CloudCenter; -import com.fr.general.ComparatorUtils; -import com.fr.general.GeneralUtils; -import com.fr.json.JSONObject; -import com.fr.stable.xml.XMLPrintWriter; -import com.fr.stable.xml.XMLableReader; -import com.fr.third.joda.time.DateTime; - -/** - * Created by kerry on 2020-09-04 - */ -public class PredefinedStyleInfoCollector extends AbstractPointCollector { - //每三天上传一次 - private static final long DELTA = 3 * 24 * 3600 * 1000L; - - private static final String SIMPLE_DATE_PATTERN = "yyyy-MM-dd"; - private static final String XML_TAG = "PredefinedStyleInfo"; - private static final String XML_FILE_NAME = "predefinedStyle.info"; - private static final String CLOUD_URL = CloudCenter.getInstance().acquireUrlByKind("design.collector") + "/single"; - - private static final String FUNCTION_NAME = "predefinedStyle"; - private static final String FUNCTION_ID = "FR-F7003"; - - private static final String ATTR_FUNCTION_NAME = "functionName"; - private static final String ATTR_FUNCTION_ID = "functionId"; - private static final String ATTR_UUID = "uuid"; - private static final String ATTR_UID = "uid"; - private static final String ATTR_JAR_TIME = "jatTime"; - private static final String ATTR_CLICK_NUMBER = "clickNumber"; - private static final String ATTR_USE_NUMBER = "useNumber"; - private static final String ATTR_TIME = "time"; - private static final String XML_LAST_TIME = "lastSendTime"; - - /** - * 上一次的发送时间 - */ - private long lastSendTime; - - private int clickNumber = 0; - - private int useNumber = 0; - - public int getClickNumber() { - return clickNumber; - } - - public int getUseNumber() { - return useNumber; - } - - private static class Holder { - private static PredefinedStyleInfoCollector collector = new PredefinedStyleInfoCollector(); - } - - private PredefinedStyleInfoCollector() { - loadFromFile(); - } - - public static PredefinedStyleInfoCollector getInstance() { - return Holder.collector; - } - - public void collectClickNumber() { - clickNumber++; - saveInfo(); - } - - public void collectUseNumber(String predefinedName) { - if (!ComparatorUtils.equals(Toolkit.i18nText("Fine-Engine_Predefined_Style_Compatibility"), predefinedName) && - !ComparatorUtils.equals(Toolkit.i18nText("Fine-Engine_Report_DEFAULT"), predefinedName)) { - useNumber++; - } - saveInfo(); - } - - @Override - protected String getInfoFilePath() { - return XML_FILE_NAME; - } - - @Override - protected void addIdleDayCount() { - - } - - @Override - public void sendPointInfo() { - if (System.currentTimeMillis() - lastSendTime < DELTA) { - return; - } - String content = generateTotalInfo(); - SendHelper.sendSinglePointInfo(CLOUD_URL, content); - this.lastSendTime = System.currentTimeMillis(); - this.clickNumber = 0; - this.useNumber = 0; - saveInfo(); - } - - public String generateTotalInfo() { - - JSONObject jo = JSONObject.create(); - jo.put(ATTR_FUNCTION_NAME, FUNCTION_NAME); - jo.put(ATTR_FUNCTION_ID, FUNCTION_ID); - jo.put(ATTR_UUID, DesignerEnvManager.getEnvManager().getUUID()); - jo.put(ATTR_UID, MarketConfig.getInstance().getBBSAttr().getBbsUid()); - jo.put(ATTR_JAR_TIME, GeneralUtils.readFullVersionNO()); - jo.put(ATTR_CLICK_NUMBER, this.clickNumber); - jo.put(ATTR_USE_NUMBER, this.useNumber); - jo.put(ATTR_TIME, DateTime.now().toString(SIMPLE_DATE_PATTERN)); - return jo.toString(); - } - - - @Override - public void readXML(XMLableReader reader) { - if (reader.isAttr()) { - String name = reader.getTagName(); - if (XML_TAG.equals(name)) { - this.clickNumber = reader.getAttrAsInt(ATTR_CLICK_NUMBER, 0); - this.useNumber = reader.getAttrAsInt(ATTR_USE_NUMBER, 0); - this.lastSendTime = reader.getAttrAsLong(XML_LAST_TIME, System.currentTimeMillis()); - } - } - } - - @Override - public void writeXML(XMLPrintWriter writer) { - writer.startTAG(XML_TAG); - writer.attr(ATTR_CLICK_NUMBER, this.clickNumber).attr(ATTR_USE_NUMBER, this.useNumber) - .attr(XML_LAST_TIME, this.lastSendTime); - writer.end(); - } -} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java index 6556fb904..33698d7c1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java @@ -312,12 +312,12 @@ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane { } config.add(previewObject); PredefinedStyleConfig sortedConfig = resortConfigStyles(previewObject, config); - Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { - @Override - public void run() { - ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(sortedConfig); - } - }); +// Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { +// @Override +// public void run() { +// ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(sortedConfig); +// } +// }); selectPane.refreshPane(); return true; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java index 45d2ca9fe..b29e7ffdf 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java @@ -36,7 +36,7 @@ public class ReportPredefinedStylePane extends BasicPane { public void update() { PredefinedStyle style = selectPane.update(); if (style != null) { - currentTemplate.resetPredefinedStyle(style.getStyleName()); +// currentTemplate.resetPredefinedStyle(style.getStyleName()); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java index 739c927b8..cc0cbf15f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java @@ -140,12 +140,12 @@ public class ServerPredefinedStylePane extends BasicPane { if (style != null) { PredefinedStyleConfig config = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig(); config.setDefaultPredefinedStyle(style.getStyleName()); - Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { - @Override - public void run() { - ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config); - } - }); +// Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { +// @Override +// public void run() { +// ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config); +// } +// }); } } @@ -207,12 +207,12 @@ public class ServerPredefinedStylePane extends BasicPane { private void removeStyle(String name) { PredefinedStyleConfig config = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig(); config.removeStyle(name); - Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { - @Override - public void run() { - ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config); - } - }); +// Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { +// @Override +// public void run() { +// ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config); +// } +// }); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ColorDetailPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ColorDetailPane.java index ce4f923cb..b7034fd66 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ColorDetailPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ColorDetailPane.java @@ -72,7 +72,8 @@ public class ColorDetailPane extends AbstractBackgroundDetailPane para = new HashMap<>(); para.put("token", SiteCenterToken.generateToken()); para.put("content", content); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfoCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfoCollector.java index e41759d24..23c07ea3a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfoCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfoCollector.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.template.info; +import com.fr.design.mainframe.burying.point.AbstractPointCollector; import com.fr.design.mainframe.burying.point.AbstractPointInfo; -import com.fr.design.mainframe.burying.point.AbstractTemplateInfoCollector; import com.fr.json.JSON; import com.fr.json.JSONFactory; import com.fr.json.JSONObject; @@ -18,7 +18,7 @@ import java.util.concurrent.ConcurrentHashMap; * 做模板的过程和耗时收集,辅助类 * Created by plough on 2017/2/21. */ -public class TemplateInfoCollector extends AbstractTemplateInfoCollector { +public class TemplateInfoCollector extends AbstractPointCollector { private static final String XML_TAG = "TplInfo"; private static final String XML_TEMPLATE_INFO_LIST = "TemplateInfoList"; private static final String XML_FILE_NAME = "tpl.info"; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 894ebe1c1..d1abb908b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -54,9 +54,7 @@ import com.fr.design.mainframe.ToolBarNewTemplatePane; import com.fr.design.menu.MenuDef; import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.ShortCut; -import com.fr.design.menu.SnapChatMenuDef; import com.fr.design.menu.ToolBarDef; -import com.fr.design.notification.SnapChatAllTypes; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.remote.action.RemoteDesignAuthManagerAction; import com.fr.design.update.actions.SoftwareUpdateAction; @@ -74,6 +72,7 @@ import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventType; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; +import com.fr.stable.os.support.OSBasedAction; import com.fr.stable.os.support.OSSupportCenter; import com.fr.start.OemHandler; import com.fr.workspace.WorkContext; @@ -469,9 +468,7 @@ public abstract class ToolBarMenuDock { } protected MenuDef createServerMenuDef(ToolBarMenuDockPlus plus) { - - MenuDef menuDef = new SnapChatMenuDef(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic__M_Server"), 'S', - SnapChatAllTypes.Menu.SERVER); + MenuDef menuDef = new MenuDef(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic__M_Server"), 'S'); if (!DesignerMode.isAuthorityEditing()) { menuDef.addShortCut( diff --git a/designer-base/src/main/java/com/fr/design/notification/SnapChatAllTypes.java b/designer-base/src/main/java/com/fr/design/notification/SnapChatAllTypes.java index 94779d9d7..d94da0c88 100644 --- a/designer-base/src/main/java/com/fr/design/notification/SnapChatAllTypes.java +++ b/designer-base/src/main/java/com/fr/design/notification/SnapChatAllTypes.java @@ -12,13 +12,7 @@ public abstract class SnapChatAllTypes { /** * 社区按钮 */ - BBS("BBS"), - - /** - * 服务器按钮 - */ - SERVER("SERVER"); - + BBS("BBS"); private static final String SIGN = "0001"; @@ -41,32 +35,4 @@ public abstract class SnapChatAllTypes { } } - public enum UpdateAction implements SnapChatKey { - - /** - * 服务器预定义样式 - */ - PREDEFINED_STYLE("PREDEFINED_STYLE"); - - private static final String SIGN = "0002"; - - private String key; - - UpdateAction(String key) { - this.key = key; - } - - public String getKey() { - return key; - } - - @Override - public String calc() { - - return CommonUtils.join( - new String[]{SIGN, getKey()}, "-" - ); - } - } - } diff --git a/designer-base/src/main/java/com/fr/design/style/background/impl/TextureBackgroundPane.java b/designer-base/src/main/java/com/fr/design/style/background/impl/TextureBackgroundPane.java index 9d1cb168c..3dd59bd5b 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/impl/TextureBackgroundPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/impl/TextureBackgroundPane.java @@ -1,59 +1,197 @@ package com.fr.design.style.background.impl; +import com.fr.base.GraphHelper; +import com.fr.base.background.TextureBackground; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.style.background.BackgroundDetailPane; -import com.fr.design.style.background.texture.TextureDetailPane; import com.fr.general.Background; +import com.fr.general.ComparatorUtils; -import javax.swing.BorderFactory; -import javax.swing.JPanel; +import javax.swing.*; +import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.BorderLayout; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.geom.Rectangle2D; /** * Texture background pane. TODO kunsnat: 拆出去. 真特么的长.. */ -public class TextureBackgroundPane extends BackgroundDetailPane { - - - private TextureDetailPane detailPane; +public class TextureBackgroundPane extends BPane { + + private static final TexturePaint[] EMBED_TEXTURE_PAINT_ARRAY = new TexturePaint[]{ + TextureBackground.NEWSPRINT_TEXTURE_PAINT, + TextureBackground.RECYCLED_PAPER_TEXTURE_PAINT, + TextureBackground.PARCHMENT_TEXTURE_PAINT, + TextureBackground.STATIONERY_TEXTURE_PAINT, + TextureBackground.GREEN_MARBLE_TEXTURE_PAINT, + TextureBackground.WHITE_MARBLE_TEXTURE_PAINT, + TextureBackground.BROWN_MARBLE_TEXTURE_PAINT, + TextureBackground.GRANITE_TEXTURE_PAINT, + TextureBackground.BLUE_TISSUE_PAPER_TEXTURE_PAINT, + TextureBackground.PINK_TISSUE_PAPER_TEXTURE_PAINT, + TextureBackground.PURPLE_MESH_TEXTURE_PAINT, + TextureBackground.BOUQUET_TEXTURE_PAINT, + TextureBackground.PAPYRUS_TEXTURE_PAINT, + TextureBackground.CANVAS_TEXTURE_PAINT, + TextureBackground.DENIM_TEXTURE_PAINT, + TextureBackground.WOVEN_MAT_TEXTURE_PAINT, + TextureBackground.WATER_DROPLETS_TEXTURE_PAINT, + TextureBackground.PAPER_BAG_TEXTURE_PAINT, + TextureBackground.FISH_FOSSIL_TEXTURE_PAINT, + TextureBackground.SAND_TEXTURE_PAINT, + TextureBackground.CORK_TEXTURE_PAINT, + TextureBackground.WALNUT_TEXTURE_PAINT, + TextureBackground.OAK_TEXTURE_PAINT, + TextureBackground.MEDIUM_WOOD_TEXTURE_PAINT}; + + private static final String[] EMBED_TEXTURE_PAINT_DES_ARRAY = new String[]{ + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Newsprint"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Recycled_Paper"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Parchment"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Stationery"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Green_Marble"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_White_Marble"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Brown_Marble"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Granite"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Blue_Tissue_Paper"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Pink_Tissue_Paper"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Purple_Mesh"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Bouquet"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Papyrus"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Canvas"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Denim"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Woven_Mat"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Water_Droplets"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_PaperBag"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_FishFossil"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Sand"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Cork"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Walnut"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Oak"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Medium_Wood") + }; + + private TexturePaint texturePaint; + private TextureButton[] textureButtonArray; public TextureBackgroundPane() { - this(8);// 默认的. + super(8);// 默认的. } - public TextureBackgroundPane(int column) { - this.detailPane = TextureDetailPane.createNormalTextureDetailPane(column); - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); - - JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); - this.add(contentPane, BorderLayout.NORTH); - - JPanel typePane = FRGUIPaneFactory.createTitledBorderPane(titleOfTypePane()); - contentPane.add(typePane); - typePane.add(this.detailPane); + public TextureBackgroundPane(int colum) { + super(colum);// 自定义的. } - + protected LayoutManager layoutOfTypePane(int nColumn) { + return FRGUIPaneFactory.createNColumnGridLayout(nColumn); + } protected String titleOfTypePane() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture"); } - + protected void setChildrenOfTypePane(JPanel typePane2) { + ButtonGroup patternButtonGroup = new ButtonGroup(); + textureButtonArray = new TextureButton[EMBED_TEXTURE_PAINT_ARRAY.length]; + for (int i = 0; i < EMBED_TEXTURE_PAINT_ARRAY.length; i++) { + textureButtonArray[i] = new TextureButton( + EMBED_TEXTURE_PAINT_ARRAY[i], EMBED_TEXTURE_PAINT_DES_ARRAY[i]); + patternButtonGroup.add(textureButtonArray[i]); + typePane2.add(textureButtonArray[i]); + } + } public void populate(Background background) { - this.detailPane.populate(background); + if (background instanceof TextureBackground) { + TextureBackground textureBackground = (TextureBackground) background; + + this.texturePaint = textureBackground.getTexturePaint(); + + for (int i = 0; i < textureButtonArray.length; i++) { + if (ComparatorUtils.equals(textureButtonArray[i].getTexturePaint(), this.texturePaint)) { + textureButtonArray[i].setSelected(true); + break; + } + } + } else { + this.textureButtonArray[0].setSelected(true); + this.texturePaint = textureButtonArray[0].getTexturePaint(); + } } public Background update() throws Exception { - return this.detailPane.update(); + return new TextureBackground(this.texturePaint); } - @Override public void addChangeListener(ChangeListener changeListener) { - this.detailPane.addChangeListener(changeListener); + for (int i = 0; i < this.textureButtonArray.length; i++) { + this.textureButtonArray[i].addChangeListener(changeListener); + } } + /** + * Texture type button. + */ + class TextureButton extends JToggleButton implements ActionListener { + + private TexturePaint buttonTexturePaint; + + public TextureButton(TexturePaint buttonTexturePaint, String tooltip) { + this.buttonTexturePaint = buttonTexturePaint; + this.setToolTipText(tooltip); + + this.setCursor(new Cursor(Cursor.HAND_CURSOR)); + this.addActionListener(this); + this.setBorder(null); + } + + public void paintComponent(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + + Dimension d = getSize(); + + g2d.setPaint(this.buttonTexturePaint); + GraphHelper.fill(g2d, new Rectangle2D.Double(0, 0, d.width - 1d, + d.height - 1d)); + + if (ComparatorUtils.equals(texturePaint, this.buttonTexturePaint)) {// it's + // selected. + g2d.setPaint(Color.black); + } else { + g2d.setPaint(Color.gray); + } + GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, d.width - 1d, + d.height - 1d)); + } + + public Dimension getPreferredSize() { + return new Dimension(36, 32); + } + + public TexturePaint getTexturePaint() { + return this.buttonTexturePaint; + } + + /** + * set Pattern setIndex. + */ + public void actionPerformed(ActionEvent evt) { + TextureBackgroundPane.this.texturePaint = this.getTexturePaint(); + + fireChagneListener(); + TextureBackgroundPane.this.repaint(); // repaint. + } + + public void addChangeListener(ChangeListener changeListener) { + this.changeListener = changeListener; + } + + private void fireChagneListener() { + if (this.changeListener != null) { + ChangeEvent evt = new ChangeEvent(this); + this.changeListener.stateChanged(evt); + } + } + } } diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectPane.java index 437b3c8c4..c82eac0c0 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectPane.java @@ -53,19 +53,25 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable initialCompents(isSupportTransparent); } - protected void initialCompents(boolean isSupportTransparent) { + private void initialCompents(boolean isSupportTransparent) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5)); if (isSupportTransparent) { - this.add(createTranspanrentButton(), BorderLayout.NORTH); + UIButton transpanrentButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ChartF_Transparency")); + this.add(transpanrentButton, BorderLayout.NORTH); + transpanrentButton.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + doTransparent(); + } + }); } - this.add(createCenterPane(), BorderLayout.CENTER); - } - protected JPanel createCenterPane(){ // center JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); + this.add(centerPane, BorderLayout.CENTER); centerPane.add(getRow1Pane()); @@ -92,19 +98,6 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable centerPane1.setBorder(BorderFactory.createEmptyBorder(2, 8, 8, 8)); centerPane1.add(customButton, BorderLayout.NORTH); centerPane.add(centerPane1); - return centerPane; - } - - protected UIButton createTranspanrentButton(){ - UIButton transpanrentButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ChartF_Transparency")); - transpanrentButton.addActionListener(new ActionListener() { - - @Override - public void actionPerformed(ActionEvent e) { - doTransparent(); - } - }); - return transpanrentButton; } protected JPanel getMenuColorPane() { diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index d3d2c59c6..58f5d2a5f 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -6,7 +6,6 @@ import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.dialog.FineJOptionPane; -import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.fun.DesignerEnvProcessor; import com.fr.design.gui.UILookAndFeel; import com.fr.design.i18n.Toolkit; @@ -16,7 +15,6 @@ import com.fr.file.FileFILE; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; import com.fr.general.GeneralContext; -import com.fr.general.GeneralUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.CommonCodeUtils; @@ -27,8 +25,6 @@ import com.fr.start.ServerStarter; import com.fr.value.NotNullLazyValue; import com.fr.workspace.WorkContext; import org.jetbrains.annotations.NotNull; -import com.fr.workspace.connect.WorkspaceConnectionInfo; -import com.fr.workspace.engine.channel.http.FunctionalHttpRequest; import javax.swing.SwingUtilities; import javax.swing.UIManager; import java.awt.Desktop; @@ -61,12 +57,13 @@ import java.util.concurrent.TimeoutException; public class DesignUtils { private static int port = DesignerPort.getInstance().getMessagePort(); + private static boolean started = false; + private DesignUtils() { } - public synchronized static void setPort(int port) { DesignUtils.port = port; } @@ -75,6 +72,7 @@ public class DesignUtils { return port; } + /** * 判断设计器有没有启动 * @@ -250,7 +248,6 @@ public class DesignUtils { } public static void refreshDesignerFrame() { - // 刷新DesignerFrame里面的面板 SwingUtilities.invokeLater(new Runnable() { @@ -421,22 +418,4 @@ public class DesignUtils { return true; } - - public static boolean checkDesignerRemoteVersion() { - if (WorkContext.getCurrent().isLocal()){ - return true; - } - String envName = DesignerEnvManager.getEnvManager().getCurEnvName(); - DesignerWorkspaceInfo selectedEnv = DesignerEnvManager.getEnvManager().getWorkspaceInfo(envName); - String localBranch; - String remoteBranch; - WorkspaceConnectionInfo connectionInfo = selectedEnv.getConnection(); - localBranch = GeneralUtils.readFullBuildNO(); - try { - remoteBranch = new FunctionalHttpRequest(connectionInfo).getServerBranch(); - } catch (Exception e) { - return false; - } - return localBranch.contains("#") && localBranch.equals(remoteBranch); - } } diff --git a/designer-base/src/test/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollectorTest.java b/designer-base/src/test/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollectorTest.java deleted file mode 100644 index c3c3242bd..000000000 --- a/designer-base/src/test/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollectorTest.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.fr.design.mainframe.predefined.info; - -import com.fr.config.BBSAttr; -import com.fr.config.MarketConfig; -import com.fr.design.DesignerEnvManager; -import com.fr.general.GeneralUtils; -import com.fr.json.JSON; -import com.fr.json.JSONFactory; -import com.fr.json.JSONObject; -import com.fr.stable.ProductConstants; -import com.fr.third.org.apache.commons.io.FileUtils; -import org.easymock.EasyMock; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.api.easymock.PowerMock; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor; -import org.powermock.modules.junit4.PowerMockRunner; -import java.io.File; -import java.io.IOException; - -/** - * Created by kerry on 2020-09-05 - */ -@RunWith(PowerMockRunner.class) -@PrepareForTest({ProductConstants.class, MarketConfig.class, DesignerEnvManager.class, GeneralUtils.class}) -@SuppressStaticInitializationFor({"com.fr.jvm.assist.FineAssist"}) -public class PredefinedStyleInfoCollectorTest { - private String filePath; - private String initialFileContent; - - - @Before - public void setUp() throws IOException { - PowerMock.mockStatic(ProductConstants.class); - - filePath = getClass().getResource("predefinedStyle.info").getPath(); - String dirPath = filePath.substring(0, filePath.indexOf("predefinedStyle.info")); - EasyMock.expect(ProductConstants.getEnvHome()).andReturn(dirPath).anyTimes(); - - EasyMock.replay(); - PowerMock.replayAll(); - initialFileContent = FileUtils.readFileToString(new File(filePath), "utf-8"); - } - - @After - public void tearDown() throws IOException { - FileUtils.writeStringToFile(new File(filePath), initialFileContent, "utf-8"); - } - - @Test - public void testCollectClickNumber() { - PredefinedStyleInfoCollector.getInstance().collectClickNumber(); - Assert.assertEquals(1, PredefinedStyleInfoCollector.getInstance().getClickNumber()); - } - - @Test - public void testCollectUseNumber() { - PredefinedStyleInfoCollector.getInstance().collectUseNumber("test"); - Assert.assertEquals(1, PredefinedStyleInfoCollector.getInstance().getUseNumber()); - } - - @Test - public void testGenerateTotalInfo() { - PowerMock.mockStatic(DesignerEnvManager.class); - PowerMock.mockStatic(MarketConfig.class); - PowerMock.mockStatic(GeneralUtils.class); - - DesignerEnvManager envManager = EasyMock.mock(DesignerEnvManager.class); - EasyMock.expect(envManager.getUUID()).andReturn("xxxxx-12345-xxxxx").once(); - EasyMock.expect(DesignerEnvManager.getEnvManager()).andReturn(envManager).once(); - - - MarketConfig marketConfig = EasyMock.mock(MarketConfig.class); - BBSAttr bbsAttr = new BBSAttr(); - bbsAttr.setBbsUid(12345); - EasyMock.expect(marketConfig.getBBSAttr()).andReturn(bbsAttr).once(); - EasyMock.expect(MarketConfig.getInstance()).andReturn(marketConfig).once(); - - EasyMock.expect(GeneralUtils.readFullVersionNO()).andReturn("10.0.9.2020.0817.final"); - - EasyMock.replay(envManager, marketConfig); - - PowerMock.replayAll(); - String content = PredefinedStyleInfoCollector.getInstance().generateTotalInfo(); - JSONObject jsonObject = JSONFactory.createJSON(JSON.OBJECT, content); - Assert.assertEquals("predefinedStyle", jsonObject.getString("functionName")); - Assert.assertEquals("FR-F7003", jsonObject.getString("functionId")); - Assert.assertEquals("xxxxx-12345-xxxxx", jsonObject.getString("uuid")); - Assert.assertEquals(12345, jsonObject.getInt("uid")); - Assert.assertEquals("10.0.9.2020.0817.final", jsonObject.getString("jatTime")); - } - -} diff --git a/designer-base/src/test/resources/com/fr/design/mainframe/predefined/info/predefinedStyle.info b/designer-base/src/test/resources/com/fr/design/mainframe/predefined/info/predefinedStyle.info deleted file mode 100644 index 1d66b6107..000000000 --- a/designer-base/src/test/resources/com/fr/design/mainframe/predefined/info/predefinedStyle.info +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java index c92cfd857..eb2c3914a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java @@ -69,7 +69,9 @@ public class VanChartColumnSeriesPane extends VanChartAbstractPlotSeriesPane { //边框(有圆角) protected VanChartBorderPane createDiffBorderPane() { - return new VanChartBorderWithRadiusPane(true); + return new VanChartBorderWithRadiusPane(); + //TODO Bjorn 边框自动回退 + //return new VanChartBorderWithRadiusPane(true); } private JPanel createSeriesStylePane(double[] row, double[] col) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java index 2299c3585..057675a0a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java @@ -27,12 +27,15 @@ public class VanChartFillStylePane extends ColorFillStylePane implements Designe } protected void styleSelectBoxChange() { - getCustomPane().setVisible(getStyleSelectBox().getSelectedIndex() != 0); + //TODO Bjorn 配色预定义回退 + //getCustomPane().setVisible(getStyleSelectBox().getSelectedIndex() != 0); super.styleSelectBoxChange(); } protected ColorSchemeComboBox createColorSchemeComboBox() { - return new ColorSchemeComboBox(null, true); + return new ColorSchemeComboBox(); + //TODO Bjorn 配色预定义回退 + //return new ColorSchemeComboBox(null, true); } protected void initLayout() { @@ -60,19 +63,21 @@ public class VanChartFillStylePane extends ColorFillStylePane implements Designe } public void populateBean(AttrFillStyle condition) { - if (condition.isPredefinedStyle()) { + /* if (condition.isPredefinedStyle()) { getStyleSelectBox().setSelectType(ColorSchemeComboBox.SelectType.DEFAULT); return; - } + }*/ + //TODO Bjorn 配色预定义回退 populateBean(condition.getColorFillStyle()); } public void updateBean(AttrFillStyle attrFillStyle) { - if (getStyleSelectBox().getSelectedIndex() == 0) { + /* if (getStyleSelectBox().getSelectedIndex() == 0) { attrFillStyle.setPredefinedStyle(true); return; } - attrFillStyle.setPredefinedStyle(false); + attrFillStyle.setPredefinedStyle(false);*/ + //TODO Bjorn 配色预定义回退 attrFillStyle.setColorFillStyle(updateBean()); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java index 18745f915..e3bd8248f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java @@ -1,12 +1,10 @@ package com.fr.van.chart.designer.component; -import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithPreStyle; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.type.TextAlign; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; -import java.awt.BorderLayout; public class VanChartLabelContentPane extends VanChartTooltipContentPane { @@ -24,7 +22,8 @@ public class VanChartLabelContentPane extends VanChartTooltipContentPane { return new AttrTooltipContent(TextAlign.CENTER); } - public JPanel createCommonStylePane() { + //TODO Bjorn 标签面板回退 + /* public JPanel createCommonStylePane() { if (isInCondition()) { return super.createCommonStylePane(); } @@ -47,5 +46,5 @@ public class VanChartLabelContentPane extends VanChartTooltipContentPane { attrTooltipContent.setCustom(true); } } - } + }*/ } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/MapRangeLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/MapRangeLegendPane.java index c2b1620b4..7e68f9942 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/MapRangeLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/MapRangeLegendPane.java @@ -19,7 +19,9 @@ public class MapRangeLegendPane extends VanChartRangeLegendPane { } @Override - protected VanChartBackgroundPane creatBackgroundPane(){ - return new VanChartBackgroundWithOutImagePane(true); + protected VanChartBackgroundPane creatBackgroundPane() { + //TODO Bjorn 地图图例背景自动逻辑 + return new VanChartBackgroundWithOutImagePane(); + //return new VanChartBackgroundWithOutImagePane(true); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java index ef1e8573a..8a0a62f62 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java @@ -14,7 +14,6 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; -import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithPreStyle; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.plugin.chart.attr.VanChartLegend; import com.fr.plugin.chart.type.LayoutType; @@ -287,7 +286,9 @@ public class VanChartPlotLegendPane extends BasicPane { } private JPanel createTitleStylePane() { - textAttrPane = new ChartTextAttrPaneWithPreStyle(); + //TODO Bjorn 图例预定义逻辑 + //textAttrPane = new ChartTextAttrPaneWithPreStyle(); + textAttrPane = new ChartTextAttrPane(); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java index cfcb0debb..1c02f342c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java @@ -15,7 +15,7 @@ import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; -import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithPreStyle; +import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.plugin.chart.attr.VanChartTitle; @@ -54,7 +54,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { private JPanel titlePane; private TinyFormulaPane titleContent; - private ChartTextAttrPaneWithPreStyle textAttrPane; + private ChartTextAttrPane textAttrPane; private UIButtonGroup alignmentPane; private VanChartBackgroundWithOutShadowWithRadiusPane backgroundPane; private UIToggleButton useHtml; @@ -175,7 +175,9 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { } private JPanel createTitleStylePane() { - textAttrPane = new ChartTextAttrPaneWithPreStyle(); + //TODO Bjorn 标题预定义逻辑 + //textAttrPane = new ChartTextAttrPaneWithPreStyle(); + textAttrPane = new ChartTextAttrPane(); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitleWithAutoBackground.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitleWithAutoBackground.java index eb87f4363..e126c5359 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitleWithAutoBackground.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitleWithAutoBackground.java @@ -14,6 +14,8 @@ public class VanChartTitleWithAutoBackground extends VanChartTitlePane { } protected VanChartBackgroundWithOutShadowWithRadiusPane createBackgroundPane() { - return new VanChartBackgroundWithOutShadowWithRadiusPane(true); + //TODO Bjorn 地图标题背景自动逻辑 + //return new VanChartBackgroundWithOutShadowWithRadiusPane(true); + return new VanChartBackgroundWithOutShadowWithRadiusPane(); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java index fd122f40b..955be0a8c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java @@ -20,8 +20,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; -import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithPreStyle; -import com.fr.design.mainframe.chart.gui.style.ColorSelectBoxWithPreStyle; +import com.fr.design.style.color.ColorSelectBox; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.plugin.chart.attr.axis.VanChartAxis; @@ -85,7 +84,11 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { private JPanel labelDisplayPane; protected LineComboBox axisLineStyle; - protected ColorSelectBoxWithPreStyle axisLineColor; + + //TODO Bjorn 坐标轴面板回退 + protected ColorSelectBox axisLineColor; + //protected ColorSelectBoxWithPreStyle axisLineColor; + protected UIButtonGroup mainTick; protected UIButtonGroup secondTick; @@ -378,16 +381,31 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } protected ChartTextAttrPane getChartTextAttrPane() { - return new ChartTextAttrPaneWithPreStyle() { + //TODO Bjorn 坐标轴面板回退 + /* return new ChartTextAttrPaneWithPreStyle() { protected double getEdithAreaWidth() { return TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; } + };*/ + return new ChartTextAttrPane() { + @Override + protected JPanel getContentPane(JPanel buttonPane) { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; + double[] columnSize = {f, e}; + double[] rowSize = {p, p, p}; + + return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), rowSize, columnSize); + } }; } protected JPanel createLineStylePane(double[] row, double[] col) { axisLineStyle = createLineComboBox(); - axisLineColor = new ColorSelectBoxWithPreStyle(100); + //TODO Bjorn 坐标轴面板回退 + //axisLineColor = new ColorSelectBoxWithPreStyle(100); + axisLineColor = new ColorSelectBox(100); String[] strings = new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")}; AxisTickLineType[] values = new AxisTickLineType[]{AxisTickLineType.TICK_LINE_OUTSIDE, AxisTickLineType.TICK_LINE_NONE}; mainTick = new UIButtonGroup(strings, values); @@ -405,7 +423,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { return new Component[][]{ new Component[]{null, null}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle}, - new Component[]{axisLineColor, null}, + //TODO Bjorn 坐标轴面板回退 + //new Component[]{axisLineColor, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Main_Graduation_Line")), mainTick}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Second_Graduation_Line")), secondTick}, }; @@ -715,7 +735,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { axisLineStyle.setSelectedLineStyle(axis.getAxisStyle()); } if (axisLineColor != null) { - axisLineColor.populate(axis.getLineColorWithPreStyle()); + axisLineColor.setSelectObject(axis.getAxisColor()); + //TODO Bjorn 坐标轴面板回退 + //axisLineColor.populate(axis.getLineColorWithPreStyle()); } if (mainTick != null) { mainTick.setSelectedItem(axis.getMainTickLine()); @@ -858,7 +880,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { axis.setAxisStyle(axisLineStyle.getSelectedLineStyle()); } if (axisLineColor != null) { - axis.setLineColorWithPreStyle(axisLineColor.update()); + axis.setAxisColor(axisLineColor.getSelectObject()); + //TODO Bjorn 坐标轴面板回退 + //axis.setLineColorWithPreStyle(axisLineColor.update()); } if (mainTick != null) { axis.setMainTickLine(mainTick.getSelectedItem()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java index 60c77734c..1a4fccf58 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java @@ -8,7 +8,6 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto; -import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithPreStyle; import com.fr.design.style.color.ColorSelectBox; import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartGaugeAxis; @@ -103,7 +102,9 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { if (isMulti(gaugeStyle)) { return new ChartTextAttrPaneWithAuto(FontAutoType.SIZE_AND_COLOR); } else { - return new ChartTextAttrPaneWithPreStyle(); + return new ChartTextAttrPane(); + //TODO Bjorn 坐标轴面板回退 + //return new ChartTextAttrPaneWithPreStyle(); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java index 3558443c4..309a7daa6 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java @@ -46,7 +46,9 @@ public class VanChartRadarXAxisPane extends VanChartBaseAxisPane { return new Component[][]{ new Component[]{null,null} , new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle}, - new Component[]{axisLineColor, null}, + //TODO Bjorn 坐标轴面板回退 + //new Component[]{axisLineColor, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor}, }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java index 001567688..cf4ffb386 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java @@ -90,7 +90,9 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane { return new Component[][]{ new Component[]{null, null}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle}, - new Component[]{axisLineColor, null}, + //TODO Bjorn 坐标轴面板回退 + //new Component[]{axisLineColor, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor}, }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java index d53a7ebc6..6cef622eb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java @@ -6,11 +6,9 @@ import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; - import com.fr.van.chart.designer.AbstractVanChartScrollPane; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.background.VanChartBackgroundPane; -import com.fr.van.chart.designer.component.background.VanChartBackgroundPaneWithPreStyle; import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; import com.fr.van.chart.designer.style.background.radar.VanChartRadarAxisAreaPane; @@ -42,11 +40,13 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane { private LineTypeComboBox horizonLineType; private LineTypeComboBox verticalLineType; - private ColorSelectBoxWithPreStyle horizontalColorBox; - private ColorSelectBoxWithPreStyle verticalColorBox; + private ColorSelectBox horizontalColorBox; + private ColorSelectBox verticalColorBox; + //TODO Bjorn 背景坐标轴面板回退 + /* private ColorSelectBoxWithPreStyle horizontalColorBox; + private ColorSelectBoxWithPreStyle verticalColorBox;*/ private JPanel horizontalColorPane; private JPanel verticalColorPane; @@ -54,8 +56,11 @@ public class VanChartAxisAreaPane extends BasicBeanPane { } private void initComponents() { - horizontalColorBox = new ColorSelectBoxWithPreStyle(PREFERRED_WIDTH); - verticalColorBox = new ColorSelectBoxWithPreStyle(PREFERRED_WIDTH); + horizontalColorBox = new ColorSelectBox(PREFERRED_WIDTH); + verticalColorBox = new ColorSelectBox(PREFERRED_WIDTH); + //TODO Bjorn 背景坐标轴面板回退 + /* horizontalColorBox = new ColorSelectBoxWithPreStyle(PREFERRED_WIDTH); + verticalColorBox = new ColorSelectBoxWithPreStyle(PREFERRED_WIDTH);*/ horizonLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); verticalLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); @@ -88,15 +93,18 @@ public class VanChartAxisAreaPane extends BasicBeanPane { } protected void initGridLineComponents() { + //TODO Bjorn 背景坐标轴面板回退 Component[][] upComponent = new Component[][]{ new Component[]{null, null}, - new Component[]{horizontalColorBox, null} + new Component[]{null, horizontalColorBox} + //new Component[]{horizontalColorBox, null} }; horizontalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(upComponent); Component[][] downComponent = new Component[][]{ new Component[]{null, null}, - new Component[]{verticalColorBox, null} + new Component[]{null, verticalColorBox} + //new Component[]{verticalColorBox, null} }; verticalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(downComponent); @@ -220,13 +228,16 @@ public class VanChartAxisAreaPane extends BasicBeanPane { VanChartAxis defaultXAxis = rectanglePlot.getDefaultXAxis(); VanChartAxis defaultYAxis = rectanglePlot.getDefaultYAxis(); + //TODO Bjorn 背景坐标轴面板回退 if (defaultXAxis != null) { - verticalColorBox.populate(defaultXAxis.getMainGridColorWithPreStyle()); + //verticalColorBox.populate(defaultXAxis.getMainGridColorWithPreStyle()); + verticalColorBox.setSelectObject(defaultXAxis.getMainGridColor()); verticalLineType.setSelectedItem(defaultXAxis.getGridLineType()); } if (defaultYAxis != null) { - horizontalColorBox.populate(defaultYAxis.getMainGridColorWithPreStyle()); + //horizontalColorBox.populate(defaultYAxis.getMainGridColorWithPreStyle()); + horizontalColorBox.setSelectObject(defaultYAxis.getMainGridColor()); horizonLineType.setSelectedItem(defaultYAxis.getGridLineType()); } } @@ -253,13 +264,16 @@ public class VanChartAxisAreaPane extends BasicBeanPane { VanChartAxis defaultXAxis = rectanglePlot.getDefaultXAxis(); VanChartAxis defaultYAxis = rectanglePlot.getDefaultYAxis(); + //TODO Bjorn 背景坐标轴面板回退 if (defaultXAxis != null) { - defaultXAxis.setMainGridColorWithPreStyle(verticalColorBox.update()); + //defaultXAxis.setMainGridColorWithPreStyle(verticalColorBox.update()); + defaultXAxis.setMainGridColor(verticalColorBox.getSelectObject()); defaultXAxis.setGridLineType((LineType) verticalLineType.getSelectedItem()); } if (defaultYAxis != null) { - defaultYAxis.setMainGridColorWithPreStyle(horizontalColorBox.update()); + //defaultYAxis.setMainGridColorWithPreStyle(horizontalColorBox.update()); + defaultYAxis.setMainGridColor(horizontalColorBox.getSelectObject()); defaultYAxis.setGridLineType((LineType) horizonLineType.getSelectedItem()); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanChartDataSheetPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanChartDataSheetPane.java index 724fb6426..d6fa66bfb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanChartDataSheetPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanChartDataSheetPane.java @@ -10,7 +10,6 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; -import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithPreStyle; import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.VanChartAttrHelper; @@ -20,7 +19,6 @@ import com.fr.plugin.chart.type.AxisType; import com.fr.van.chart.designer.AbstractVanChartScrollPane; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.border.VanChartBorderPane; -import com.fr.van.chart.designer.component.border.VanChartBorderPaneWithPreStyle; import com.fr.van.chart.designer.component.format.FormatPaneWithNormalType; import javax.swing.JPanel; @@ -105,12 +103,15 @@ public class VanChartDataSheetPane extends AbstractVanChartScrollPane { return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); } + //TODO Bjorn 数据表面板回退 protected VanChartBorderPane createBorderPanePane() { - return new VanChartBorderPaneWithPreStyle(); + return new VanChartBorderPane(); + //return new VanChartBorderPaneWithPreStyle(); } protected ChartTextAttrPane createChartTextAttrPane() { - return new ChartTextAttrPaneWithPreStyle(); + return new ChartTextAttrPane(); + //return new ChartTextAttrPaneWithPreStyle(); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java index d8c321738..3d6ad86e8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java @@ -49,6 +49,11 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe return getGaugeStyle() == GaugeStyle.RING || getGaugeStyle() == GaugeStyle.SLOT; } + //TODO Bjorn 仪表盘自动逻辑 + protected boolean isFontColorAuto() { + return getGaugeStyle() == GaugeStyle.RING || getGaugeStyle() == GaugeStyle.SLOT; + } + protected boolean hasLabelPosition(Plot plot) { switch (getGaugeStyle()) { case RING: diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java index 09481a929..17910d38a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java @@ -80,8 +80,10 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { return false; } + //TODO Bjorn 仪表盘自动逻辑 protected boolean isFontColorAuto() { - return true; + return false; + //return true; } private FontAutoType getFontAutoType() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java index 0a6a7a39e..1ffb8fc2f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java @@ -270,7 +270,9 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP } protected VanChartBorderPane createDiffBorderPane() { - return new VanChartBorderPane(true); + return new VanChartBorderPane(); + //TODO Bjorn 边框自动回退 + //return new VanChartBorderPane(true); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java index 6886bae4d..a5d441a75 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java @@ -6,7 +6,6 @@ import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; @@ -76,13 +75,15 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith } }; - backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(true) { + //TODO Bjorn 钻取地图钻取目录背景自动逻辑 + /*backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(true) { @Override protected void initList() { paneList.add(new ColorBackgroundQuickPane()); } - }; + };*/ + backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(); selectBackgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(); catalogSuperLink = new VanChartCatalogHyperLinkPane(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java index ab0019f74..8a48837cb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java @@ -68,7 +68,8 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double[] columnSize = {f}; - double[] rowSize = {p,p,p,p,p,p,p,p,p,p}; + //TODO Bjorn + double[] rowSize = {p,p,p,p,p,p,p}; Component[][] components = new Component[][]{ new Component[]{createGaugeLayoutPane()}, new Component[]{createGaugeStylePane(rowSize, new double[]{f,e})}, @@ -140,12 +141,14 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { private Component[][] getDiffComponentsWithGaugeStyle() { GaugeStyle style = plot == null ? GaugeStyle.POINTER : ((VanChartGaugePlot)plot).getGaugeStyle(); switch (style) { + //TODO Bjorn 仪表盘样式自动逻辑 case RING: initRotate(); return new Component[][]{ new Component[]{null, null}, - getPaneBackgroundColorAuto(), - new Component[]{null, paneBackgroundColor}, + getPaneBackgroundColor(), + /* getPaneBackgroundColorAuto(), + new Component[]{null, paneBackgroundColor},*/ getInnerPaneBackgroundColor(), new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null}, getChutePercent() @@ -154,8 +157,9 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { return new Component[][]{ new Component[]{null, null}, getNeedleColor(), - getSlotBackgroundColorAuto(), - new Component[]{null, slotBackgroundColor}, + getSlotBackgroundColor(), + /* getSlotBackgroundColorAuto(), + new Component[]{null, slotBackgroundColor},*/ new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null}, getChutePercent() }; @@ -163,25 +167,33 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { return new Component[][]{ new Component[]{null, null}, getNeedleColor(), - getSlotBackgroundColorAuto(), - new Component[]{null, slotBackgroundColor}, + getSlotBackgroundColor(), + /*getSlotBackgroundColorAuto(), + new Component[]{null, slotBackgroundColor},*/ new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Length_Set")), null}, getThermometerWidth() }; default: return new Component[][]{ new Component[]{null, null}, - getHingeColorAuto(), - new Component[]{null, hingeColor}, + getHingeColor(), + /* getHingeColorAuto(), + new Component[]{null, hingeColor},*/ getHingeBackgroundColor(), getNeedleColor(), - getPaneBackgroundColorAuto(), - new Component[]{null, paneBackgroundColor}, + getPaneBackgroundColor(), + /* getPaneBackgroundColorAuto(), + new Component[]{null, paneBackgroundColor},*/ new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null} }; } } + private Component[] getHingeColor() { + hingeColor = new ColorSelectBox(120); + return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Hinge")), hingeColor}; + } + private Component[] getHingeColorAuto() { hingeColor = new ColorSelectBox(120); hingeColorAuto = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java index 714afadc2..00a847e2e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java @@ -261,7 +261,9 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { } protected JPanel createAreaPane() { - borderWithAlphaPane = new VanChartBorderWithAlphaPane(true); + //TODO Bjorn 地图背景自动 + //borderWithAlphaPane = new VanChartBorderWithAlphaPane(true); + borderWithAlphaPane = new VanChartBorderWithAlphaPane(); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; @@ -277,10 +279,11 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { } protected JPanel createNullValueColorPane() { - nullValueAuto = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), + //TODO Bjorn 地图空值背景自动 + /* nullValueAuto = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), Toolkit.i18nText("Fine-Design_Chart_Custom")}); - nullValueColorBox = new ColorSelectBox(80); initNullValueListener(); + nullValueColorBox = new ColorSelectBox(80); double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; @@ -294,7 +297,10 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { new Component[]{text, nullValueAuto}, new Component[]{null, nullValueColorBox}, }; - return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);*/ + + nullValueColorBox = new ColorSelectBox(80); + return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_NULL_Value_Color"), nullValueColorBox); } @@ -499,13 +505,15 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { markerTypeCom.setSelectedItem(((VanChartMapPlot) plot).getMapMarkerType().toLocalString()); } if (nullValueColorBox != null) { - if (((VanChartMapPlot) plot).isAutoNullValue()) { + //TODO Bjorn 地图空值背景自动 + /* if (((VanChartMapPlot) plot).isAutoNullValue()) { nullValueAuto.setSelectedIndex(0); } else { nullValueAuto.setSelectedIndex(1); } nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor()); - checkNullValueButton(); + checkNullValueButton();*/ + nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor()); } //大数据模式 恢复用注释。下面3行删除。 if (lineMapLargeDataModelGroup != null) { @@ -521,7 +529,8 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { ((VanChartMapPlot) plot).setMapMarkerType(MapMarkerType.parseInt(markerTypeCom.getSelectedIndex())); } if (nullValueColorBox != null) { - ((VanChartMapPlot) plot).setAutoNullValue(nullValueAuto.getSelectedIndex() == 0); + //TODO Bjorn 地图空值背景自动 + //((VanChartMapPlot) plot).setAutoNullValue(nullValueAuto.getSelectedIndex() == 0); ((VanChartMapPlot) plot).setNullValueColor(nullValueColorBox.getSelectObject()); } //大数据模式 恢复用注释。下面3行删除。 diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java index 17b275e30..bbe9d7dd4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java @@ -645,9 +645,14 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { } private void resetGisLayer(VanChartMapPlot mapPlot) { + //TODO Bjorn 地图gis图层自动逻辑 + /* mapPlot.getGisLayer().setGisLayerType(GISLayerType.AUTO); + mapPlot.getGisLayer().setLayerName(GISLayerType.getLocString(GISLayerType.AUTO));*/ - mapPlot.getGisLayer().setGisLayerType(GISLayerType.AUTO); - mapPlot.getGisLayer().setLayerName(GISLayerType.getLocString(GISLayerType.AUTO)); + String layerName = mapPlot.getDefaultGisLayerName(); + + mapPlot.getGisLayer().setGisLayerType(GISLayerType.PREDEFINED_LAYER); + mapPlot.getGisLayer().setLayerName(layerName); gisLayer.setSelectedItem(mapPlot.getGisLayer().getShowItemName()); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java index 9a48756cc..9c79f9b8c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java @@ -1,13 +1,10 @@ package com.fr.van.chart.scatter; -import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithPreStyle; -import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.van.chart.designer.component.VanChartHtmlLabelPane; import com.fr.van.chart.designer.component.VanChartHtmlLabelPaneWithBackGroundLabel; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; -import java.awt.BorderLayout; /** * 散点图标签界面 @@ -24,7 +21,8 @@ public class VanChartScatterLabelContentPane extends VanChartScatterTooltipCont return new VanChartHtmlLabelPaneWithBackGroundLabel(); } - public JPanel createCommonStylePane() { + //TODO Bjorn 散点图标签预定义样式 + /* public JPanel createCommonStylePane() { if (isInCondition()) { return super.createCommonStylePane(); } @@ -47,5 +45,5 @@ public class VanChartScatterLabelContentPane extends VanChartScatterTooltipCont attrTooltipContent.setCustom(true); } } - } + }*/ } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java index a565f4bf4..c002bceb3 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java @@ -20,8 +20,6 @@ import com.fr.design.mainframe.HelpDialogManager; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; import com.fr.design.module.DesignModuleFactory; import com.fr.form.ui.BaseChartEditor; -import com.fr.form.ui.NameComponentBackground; -import com.fr.form.ui.NameLayoutBorderStyle; import com.fr.form.ui.Widget; import com.fr.stable.Constants; import com.fr.stable.core.PropertyChangeAdapter; @@ -230,7 +228,6 @@ public class XChartEditor extends XBorderStyleWidgetCreator { * 渲染Painter */ public void paint(Graphics g) { - initBorderStyle(); designerEditor.paintEditor(g, this.getSize()); if (coverPanel != null) { coverPanel.setSize(this.getSize()); @@ -365,14 +362,4 @@ public class XChartEditor extends XBorderStyleWidgetCreator { return false; } - /** - * 初始化组件的预定义信息 - */ - public void initWidgetPredefinedInfo(String styleName){ - this.toData().setNameBorderStyle(NameLayoutBorderStyle.createPredefinedStyle(styleName)); - this.toData().setNameBackground(NameComponentBackground.createPredefinedStyle(styleName)); - initBorderStyle(); - } - - } 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 f3218e9a5..c7c91d9aa 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 @@ -815,14 +815,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo public boolean isTopable() { return true; } - - /** - * 初始化组件的预定义信息 - */ - public void initWidgetPredefinedInfo(String styleName){ - - } - + } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java index a0f902112..14e0a6511 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java @@ -18,9 +18,6 @@ import com.fr.form.FormElementCaseProvider; import com.fr.form.FormProvider; import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.ElementCaseEditorProvider; - -import com.fr.form.ui.NameComponentBackground; -import com.fr.form.ui.NameLayoutBorderStyle; import com.fr.report.fit.ReportFitAttr; import com.fr.stable.ArrayUtils; import com.fr.stable.CoreGraphHelper; @@ -374,20 +371,6 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme return true; } - /** - * 初始化组件的预定义信息 - */ - public void initWidgetPredefinedInfo(String styleName){ - this.toData().setNameBorderStyle(NameLayoutBorderStyle.createPredefinedStyle(styleName)); - this.toData().setNameBackground(NameComponentBackground.createPredefinedStyle(styleName)); - initBorderStyle(); - } - - @Override - public void paint(Graphics g) { - super.paint(g); - initBorderStyle(); - } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java index 917b73434..a43ed0125 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java @@ -7,10 +7,7 @@ import com.fr.design.form.util.XCreatorConstants; import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; -import com.fr.form.ui.NameFormBackground; import com.fr.form.ui.container.WAbsoluteBodyLayout; - -import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; import java.awt.Component; @@ -138,10 +135,4 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout { return false; } - /** - * 初始化组件的预定义信息 - */ - public void initWidgetPredefinedInfo(String styleName){ - this.toData().setNameBackground(NameFormBackground.createPredefinedStyle(styleName)); - } } 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 7379b8310..6d55c658f 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 @@ -12,7 +12,6 @@ import com.fr.design.mainframe.FormArea; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.utils.gui.LayoutUtils; -import com.fr.form.ui.NameFormBackground; import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; @@ -24,8 +23,6 @@ import com.fr.general.FRLogger; import com.fr.general.FRScreen; import com.fr.stable.ArrayUtils; import com.fr.stable.AssistUtils; -import com.fr.stable.StringUtils; - import javax.swing.JOptionPane; import java.awt.Component; import java.awt.Dimension; @@ -1344,11 +1341,5 @@ public class XWFitLayout extends XLayoutContainer { } } } - /** - * 初始化组件的预定义信息 - */ - public void initWidgetPredefinedInfo(String styleName){ - this.toData().setNameBackground(NameFormBackground.createPredefinedStyle(styleName)); - } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java index 076bd24d9..d72a8f4fe 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java @@ -17,7 +17,6 @@ import com.fr.design.mainframe.widget.editors.ButtonTypeEditor; import com.fr.design.mainframe.widget.editors.ImgBackgroundEditor; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.CardSwitchButton; -import com.fr.form.ui.NameComponentBackground; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout; @@ -640,14 +639,4 @@ public class XWTabFitLayout extends XWFitLayout { public boolean isTopable() { return true; } - - - - /** - * 初始化组件的预定义信息 - */ - public void initWidgetPredefinedInfo(String styleName){ - this.toData().setNameBackground(NameComponentBackground.createPredefinedStyle(styleName)); - } - } 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 7923c3fa2..62c89b9ca 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 @@ -37,10 +37,10 @@ import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWBorderLayout; import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; +import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; 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.form.util.XCreatorConstants; import com.fr.design.fun.RightSelectionHandlerProvider; @@ -969,9 +969,7 @@ public class FormDesigner extends TargetComponent
implements TreeSelection private void refreshCenter(Widget centerWidget, XLayoutContainer formLayoutContainer) { // 不存在center块, 说明是新建的模板 if (centerWidget == null) { - String styleName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle(); XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(new WFitLayout("body")); - layoutContainer.initWidgetPredefinedInfo(styleName); layoutContainer.setSize(LARGE_PREFERRED_SIZE); setRootComponent(layoutContainer); formLayoutContainer.add(rootComponent, WBorderLayout.CENTER); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 7f1aef52b..b7fb90fcb 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -644,7 +644,6 @@ public class JForm extends JTemplate implements BaseJForm { - private AccessibleBorderStyleEditor borderStyleEditor; + private AccessibleWLayoutBorderStyleEditor borderStyleEditor; public BorderStyleWidgetDefinePane(XCreator xCreator) { super(xCreator); @@ -29,7 +29,7 @@ public class BorderStyleWidgetDefinePane extends AbstractDataModify 0) { - extraPropertyGroupPane = new PropertyGroupPane(extraTableEditor, creator); - centerPane.add(extraPropertyGroupPane, BorderLayout.CENTER); - } + centerPane.add(extraPropertyGroupPane, BorderLayout.CENTER); return centerPane; } @@ -61,9 +60,7 @@ public class ElementEditorDefinePane extends WTitleLayoutDefinePane extends AbstractDataModify { - private AccessibleBorderStyleEditor borderStyleEditor; + private AccessibleWLayoutBorderStyleEditor borderStyleEditor; public WTitleLayoutDefinePane(XCreator xCreator) { super(xCreator); @@ -32,7 +34,7 @@ public abstract class WTitleLayoutDefinePane { private int resolution = ScreenResolution.getScreenResolution(); public JWorkBook() { - super(new WorkBook(createPredefinedWorkSheet()), DEFAULT_WB_FILE_PREFIX); + super(new WorkBook(new WorkSheet()), DEFAULT_WB_FILE_PREFIX); populateReportParameterAttr(); } - private static WorkSheet createPredefinedWorkSheet() { - WorkSheet sheet = new WorkSheet(); - NameBackground initBackground = NameBackground.createPredefinedStyle(StringUtils.EMPTY); - ((ReportSettings) sheet.getReportSettings()).setNameBackground(initBackground); - return sheet; - } - - public JWorkBook(WorkBookX workBookX) { super(new WorkBookAdapter(workBookX), DEFAULT_WBX_FILE_PREFIX); populateReportParameterAttr(); @@ -161,7 +151,6 @@ public class JWorkBook extends JTemplate { populateReportParameterAttr(); } - @Override protected void addPane(PropertyItemPaneProvider provider) { PaneHolder holder = provider.getPaneHolder(JWorkBook.class); @@ -787,7 +776,6 @@ public class JWorkBook extends JTemplate { } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } - refreshPredefinedState(); } private void applyAll(WorkBookUndoState u) { 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 bfe525eb7..ead1cf2f1 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 @@ -38,7 +38,6 @@ import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUIPaintUtils; -import com.fr.form.ui.NameBackground; import com.fr.general.ComparatorUtils; import com.fr.general.IOUtils; @@ -46,9 +45,7 @@ import com.fr.main.impl.WorkBook; import com.fr.poly.PolyDesigner; import com.fr.report.poly.PolyWorkSheet; import com.fr.report.report.TemplateReport; -import com.fr.report.stable.ReportSettings; import com.fr.report.worksheet.WorkSheet; -import com.fr.stable.StringUtils; /** * NameTabPane of sheets @@ -850,18 +847,11 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse protected abstract String getTemplateReportType(); } - private void initPredefinedInfo(TemplateReport report){ - NameBackground initBackground = NameBackground.createPredefinedStyle(StringUtils.EMPTY); - ((ReportSettings) report.getReportSettings()).setNameBackground(initBackground); - } - protected class GridReportInsertAction extends SheetInsertAction { @Override protected TemplateReport newTemplateReport() { - WorkSheet workSheet = new WorkSheet(); - initPredefinedInfo(workSheet); - return workSheet; + return new WorkSheet(); } @Override @@ -873,9 +863,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse protected class PolyReportInsertAction extends SheetInsertAction { @Override protected TemplateReport newTemplateReport() { - PolyWorkSheet polyWorkSheet = new PolyWorkSheet(); - initPredefinedInfo(polyWorkSheet); - return polyWorkSheet; + return new PolyWorkSheet(); } @Override 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 108cad815..487214a80 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 @@ -14,7 +14,7 @@ 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.DefaultPredefinedTemplateCellElement; +import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; @@ -112,7 +112,7 @@ public class CellElementEditPane extends BasicPane { CellElement cellElement = elementCase.getCellElement(cs.getColumn(), cs.getRow()); if (cellElement == null) { - cellElement = new DefaultPredefinedTemplateCellElement(cs.getColumn(), cs.getRow()); + cellElement = new DefaultTemplateCellElement(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/CellStylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java index 98311cd99..370677860 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 @@ -1,16 +1,17 @@ package com.fr.design.mainframe.cell.settingpane; -import com.fr.base.NameStyle; import com.fr.base.Style; import com.fr.design.constants.UIConstants; -import com.fr.design.mainframe.cell.settingpane.style.CellPredefinedStyleSettingPane; +import com.fr.design.mainframe.cell.settingpane.style.StylePane; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.report.cell.DefaultPredefinedTemplateCellElement; +import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import java.awt.*; /** @@ -18,15 +19,26 @@ import java.awt.*; * @since 2012-5-11下午3:59:39 */ public class CellStylePane extends AbstractCellAttrPane { - private CellPredefinedStyleSettingPane stylePane; + private StylePane stylePane; @Override public JPanel createContentPane() { JPanel content = new JPanel(new BorderLayout()); - content.setBorder(BorderFactory.createEmptyBorder()); - stylePane = new CellPredefinedStyleSettingPane(); + stylePane = new StylePane(); content.add(stylePane, BorderLayout.CENTER); stylePane.setBorder(UIConstants.CELL_ATTR_PRESENTBORDER); + stylePane.addPredefinedChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent e) { + attributeChanged(); + } + }); + stylePane.addCustomTabChangeListener(new ChangeListener() { + + @Override + public void stateChanged(ChangeEvent e) { + adjustValues();// 里面的Tab切换后要及时调整滚动条,因为一些界面可能不需要滚动条 + } + }); return content; } @@ -43,47 +55,68 @@ public class CellStylePane extends AbstractCellAttrPane { @Override public String getIconPath() { +// return "com/fr/design/images/m_format/cell.png"; return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Style"); } @Override public void updateBean(TemplateCellElement cellElement) { - cellElement.setStyle(stylePane.updateStyle()); + cellElement.setStyle(stylePane.updateBean()); } @Override public void updateBeans() { - Style s = stylePane.updateStyle(); - TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); - int cellRectangleCount = cs.getCellRectangleCount(); - for (int rect = 0; rect < cellRectangleCount; rect++) { - Rectangle cellRectangle = cs.getCellRectangle(rect); - for (int j = 0; j < cellRectangle.height; j++) { - for (int i = 0; i < cellRectangle.width; i++) { - int column = i + cellRectangle.x; - int row = j + cellRectangle.y; - TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); - if (cellElement == null) { - cellElement = new DefaultPredefinedTemplateCellElement(column, row); - elementCase.addCellElement(cellElement); + if (stylePane.getSelectedIndex() == 1) { + Style s = stylePane.updateBean(); + TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); + int cellRectangleCount = cs.getCellRectangleCount(); + for (int rect = 0; rect < cellRectangleCount; rect++) { + Rectangle cellRectangle = cs.getCellRectangle(rect); + for (int j = 0; j < cellRectangle.height; j++) { + for (int i = 0; i < cellRectangle.width; i++) { + int column = i + cellRectangle.x; + int row = j + cellRectangle.y; + TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); + if (cellElement == null) { + cellElement = new DefaultTemplateCellElement(column, row); + elementCase.addCellElement(cellElement); + } + cellElement.setStyle(s); + } + } + } + } else { + TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); + int cellRectangleCount = cs.getCellRectangleCount(); + for (int rect = 0; rect < cellRectangleCount; rect++) { + Rectangle cellRectangle = cs.getCellRectangle(rect); + for (int j = 0; j < cellRectangle.height; j++) { + for (int i = 0; i < cellRectangle.width; i++) { + int column = i + cellRectangle.x; + int row = j + cellRectangle.y; + TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); + if (cellElement == null) { + cellElement = new DefaultTemplateCellElement(column, row); + elementCase.addCellElement(cellElement); + } + Style style = cellElement.getStyle(); + if (style == null) { + style = Style.DEFAULT_STYLE; + + } + style = stylePane.updateStyle(style); + cellElement.setStyle(style); } - cellElement.setStyle(s); } } - } stylePane.updateBorder();// border必须特别处理 + } } @Override protected void populateBean() { - Style style = cellElement.getStyle(); - if (style instanceof NameStyle) { - stylePane.populateBean((NameStyle) style); - } else { - //说明是未经过转换的 - stylePane.populateBean(NameStyle.createCustomStyle(cellElement.getStyle())); - } + stylePane.populateBean(cellElement.getStyle()); stylePane.dealWithBorder(elementCasePane); } @@ -93,6 +126,7 @@ public class CellStylePane extends AbstractCellAttrPane { } public void setSelectedByIds(int level, String... id) { + stylePane.setSelctedByName(id[level]); } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java index 6a111b781..4f38c8baa 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java @@ -25,7 +25,7 @@ import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.predefined.ui.PredefinedStyleSettingPane; import com.fr.design.mainframe.predefined.ui.preview.StyleSettingPreviewPane; import com.fr.design.style.BorderUtils; -import com.fr.predefined.PredefinedPatternStyleManager; +//import com.fr.predefined.PredefinedPatternStyleManager; import com.fr.stable.Constants; import com.fr.stable.StringUtils; import com.fr.third.javax.annotation.Nonnull; @@ -84,21 +84,21 @@ public class CellPredefinedStyleSettingPane extends PredefinedStyleSettingPane allStyle = config.getAllStyles(); - this.applicationFormat.clearBoxItems(); - for (String name : allStyle.keySet()) { - this.applicationFormat.addItem(name); - } - if (allStyle.containsKey(ob.getName())) { - this.applicationFormat.setSelectedItem(ob.getName()); - }else { - this.applicationFormat.setSelectedItem(config.getDefaultStyleName()); - } - this.customPredefinedStylePane.populateBean(ob); - this.setPopulating(false); +// super.populate(ob); +// PredefinedStyle currentStyle = PredefinedPatternStyleManager.INSTANCE.getStyleFromName(getPredefinedStyleName()); +// PredefinedCellStyleConfig config = currentStyle.getCellStyleConfig(); +// Map allStyle = config.getAllStyles(); +// this.applicationFormat.clearBoxItems(); +// for (String name : allStyle.keySet()) { +// this.applicationFormat.addItem(name); +// } +// if (allStyle.containsKey(ob.getName())) { +// this.applicationFormat.setSelectedItem(ob.getName()); +// }else { +// this.applicationFormat.setSelectedItem(config.getDefaultStyleName()); +// } +// this.customPredefinedStylePane.populateBean(ob); +// this.setPopulating(false); } @@ -122,7 +122,7 @@ public class CellPredefinedStyleSettingPane extends PredefinedStyleSettingPane { 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 cb5acdf86..ad0c57b51 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 @@ -12,7 +12,7 @@ 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.DefaultPredefinedTemplateCellElement; +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 DefaultPredefinedTemplateCellElement(cs.getColumn(), cs.getRow()); + editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow()); } SheetUtils.calculateDefaultParent(tplEC); // 不知道这行代码的作用,怕去掉之后会出问题,先放在这里 diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java b/designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java index 5df13c242..4582983b6 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java @@ -67,8 +67,8 @@ public class ReportPredefinedBackgroundPane extends PredefinedStyleSettingPane