Browse Source

Merge pull request #2842 in DESIGN/design from release/10.0 to bugfix/10.0

* commit '88d0687213050bea8fc9441020e242d17385ac94':
  CHART-16721 预定义样式代码回退
  REPORT-43198 预定义样式功能优化代码回退遗漏部分
  REPORT-43198 预定义样式功能优化代码回退遗漏部分
  代码回退
  代码屏蔽
  代码屏蔽
  REPORT-43198 预定义样式功能优化代码回退
  代码修改
  REPORT-42887 && REPORT-42450 新建多sheet背景不生效;  单元格设置预定义样式的时候,使用工具栏设置边框设置失败
  REPORT-42550  注册RPC接口
  代码修改
  REPORT-42550 预定义样式优化及与图表统一迭代
bugfix/10.0
superman 4 years ago
parent
commit
a4362fbee6
  1. 2
      designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java
  2. 6
      designer-base/src/main/java/com/fr/design/gui/style/BackgroundNoImagePane.java
  3. 8
      designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java
  4. 6
      designer-base/src/main/java/com/fr/design/gui/style/BackgroundSpecialPane.java
  5. 104
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  6. 40
      designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java
  7. 56
      designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractTemplateInfoCollector.java
  8. 5
      designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java
  9. 4
      designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java
  10. 8
      designer-base/src/main/java/com/fr/design/mainframe/predefined/PatternStyle.java
  11. 140
      designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java
  12. 12
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java
  13. 2
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java
  14. 24
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java
  15. 6
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ColorDetailPane.java
  16. 7
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/component/ComponentFrameStylePane.java
  17. 7
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/component/ComponentTitleStylePane.java
  18. 2
      designer-base/src/main/java/com/fr/design/mainframe/template/info/SendHelper.java
  19. 4
      designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfoCollector.java
  20. 7
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  21. 36
      designer-base/src/main/java/com/fr/design/notification/SnapChatAllTypes.java
  22. 192
      designer-base/src/main/java/com/fr/design/style/background/impl/TextureBackgroundPane.java
  23. 29
      designer-base/src/main/java/com/fr/design/style/color/ColorSelectPane.java
  24. 27
      designer-base/src/main/java/com/fr/design/utils/DesignUtils.java
  25. 97
      designer-base/src/test/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollectorTest.java
  26. 2
      designer-base/src/test/resources/com/fr/design/mainframe/predefined/info/predefinedStyle.info
  27. 4
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java
  28. 17
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java
  29. 7
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java
  30. 6
      designer-chart/src/main/java/com/fr/van/chart/designer/style/MapRangeLegendPane.java
  31. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  32. 8
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java
  33. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitleWithAutoBackground.java
  34. 40
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java
  35. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java
  36. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java
  37. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java
  38. 8
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java
  39. 36
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java
  40. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanChartDataSheetPane.java
  41. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java
  42. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java
  43. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java
  44. 7
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java
  45. 34
      designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java
  46. 23
      designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java
  47. 9
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java
  48. 8
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java
  49. 13
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  50. 7
      designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java
  51. 17
      designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java
  52. 9
      designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java
  53. 9
      designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java
  54. 11
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java
  55. 4
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  56. 1
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  57. 3
      designer-form/src/main/java/com/fr/design/mainframe/ToolBarButton.java
  58. 13
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/BorderStyleWidgetDefinePane.java
  59. 13
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java
  60. 35
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java
  61. 32
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  62. 17
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java
  63. 17
      designer-realize/src/main/java/com/fr/design/actions/cell/GlobalStyleMenuDef.java
  64. 9
      designer-realize/src/main/java/com/fr/design/actions/report/ReportBackgroundAction.java
  65. 4
      designer-realize/src/main/java/com/fr/design/actions/server/predefined/ServerPredefinedStyleAction.java
  66. 6
      designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java
  67. 2
      designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java
  68. 14
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  69. 16
      designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java
  70. 4
      designer-realize/src/main/java/com/fr/design/mainframe/cell/CellElementEditPane.java
  71. 92
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java
  72. 37
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java
  73. 4
      designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java
  74. 6
      designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java
  75. 7
      designer-realize/src/main/java/com/fr/design/style/BorderUtils.java
  76. 6
      designer-realize/src/main/java/com/fr/grid/Grid.java
  77. 28
      designer-realize/src/main/java/com/fr/grid/GridUI.java
  78. 14
      designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java
  79. 5
      designer-realize/src/main/java/com/fr/start/MainDesigner.java

2
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)")};

6
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();
}
}

8
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<BackgroundQuickUIProvider> 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();
}
/**
* 事件监听

6
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();
}
}

104
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<T extends BaseBook, U extends BaseUndoState<?>> extends TargetComponent<T> 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<T extends BaseBook, U extends BaseUndoState<?>>
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<T extends BaseBook, U extends BaseUndoState<?>>
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<T extends BaseBook, U extends BaseUndoState<?>>
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<T extends BaseBook, U extends BaseUndoState<?>>
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<T extends BaseBook, U extends BaseUndoState<?>>
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<T extends BaseBook, U extends BaseUndoState<?>>
return getEditingFILE().getName();
}
public String getTemplatePredefinedStyle(){
return StringUtils.EMPTY;
}
}

40
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<T extends AbstractPointInfo> implements BasePointCollector {
protected Map<String, T> 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<String> removeList = new ArrayList<>();
List<String> 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();
}
/**
* 从文件中读取埋点信息
*/

56
designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractTemplateInfoCollector.java

@ -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<T extends AbstractPointInfo> extends AbstractPointCollector {
protected Map<String, T> 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<String> removeList = new ArrayList<>();
List<String> 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();
}
}

5
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);
}

4
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<ChartInfo> {
public class ChartInfoCollector extends AbstractPointCollector<ChartInfo> {
private static final String XML_TAG = "ChartInfoCollector";
private static final String XML_LAST_EDIT_DAY = "lastEditDay";

8
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();
}
};

140
designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java

@ -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();
}
}

12
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;
}

2
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());
}
}

24
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);
// }
// });
}
}

6
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ColorDetailPane.java

@ -72,7 +72,8 @@ public class ColorDetailPane extends AbstractBackgroundDetailPane<ColorBackgroun
}
private JPanel createNorthPane() {
UIButton transpanrentBtn = createTranspanrentButton();
// UIButton transpanrentBtn = createTranspanrentButton();
UIButton transpanrentBtn = new UIButton();
transpanrentBtn.setPreferredSize(new Dimension(160, 20));
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Color")),
@ -82,7 +83,8 @@ public class ColorDetailPane extends AbstractBackgroundDetailPane<ColorBackgroun
}
protected JPanel createCenterPane() {
JPanel centerPane = super.createCenterPane();
// JPanel centerPane = super.createCenterPane();
JPanel centerPane = new JPanel();
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{new UILabel(" "), centerPane}}, TableLayoutHelper.FILL_NONE, 33, 5);

7
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/component/ComponentFrameStylePane.java

@ -71,12 +71,7 @@ public class ComponentFrameStylePane extends ComponentStylePane {
currentLineColorPane.setPreferredSize(new Dimension(20, 20));
JPanel buttonPane = new JPanel(new BorderLayout());
buttonPane.add(currentLineColorPane, BorderLayout.WEST);
backgroundPane = new BackgroundSpecialPane(){
@Override
protected GradientBackgroundQuickPane createGradientBackgroundQuickPane(){
return new GradientBackgroundQuickPane(119);
}
};
backgroundPane = new BackgroundSpecialPane();
JPanel transparencyPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.numberDragPane = new UINumberDragPane(0, 100);
transparencyPane.add(numberDragPane, BorderLayout.CENTER);

7
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/component/ComponentTitleStylePane.java

@ -95,12 +95,7 @@ public class ComponentTitleStylePane extends ComponentStylePane {
JPanel hPaneContainer = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
hPaneContainer.add(hAlignmentPane);
titleBackgroundPane = new BackgroundNoImagePane(){
@Override
protected GradientBackgroundQuickPane createGradientBackgroundQuickPane(){
return new GradientBackgroundQuickPane(119);
}
};
titleBackgroundPane = new BackgroundNoImagePane();
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p, p, p, p};

2
designer-base/src/main/java/com/fr/design/mainframe/template/info/SendHelper.java

@ -27,7 +27,7 @@ public class SendHelper {
return success;
}
public static boolean sendSinglePointInfo(String url, String content) {
private static boolean sendSinglePointInfo(String url, String content) {
Map<String, Object> para = new HashMap<>();
para.put("token", SiteCenterToken.generateToken());
para.put("content", content);

4
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<TemplateInfo> {
public class TemplateInfoCollector extends AbstractPointCollector<TemplateInfo> {
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";

7
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(

36
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()}, "-"
);
}
}
}

192
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);
}
}
}
}

29
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() {

27
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);
}
}

97
designer-base/src/test/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollectorTest.java

@ -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"));
}
}

2
designer-base/src/test/resources/com/fr/design/mainframe/predefined/info/predefinedStyle.info

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<PredefinedStyleInfo xmlVersion="20170720" releaseVersion="10.0.0" clickNumber="0" useNumber="0"/>

4
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) {

17
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());
}

7
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);
}
}
}
}*/
}

6
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);
}
}

5
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);
}

8
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<VanChart> {
private JPanel titlePane;
private TinyFormulaPane titleContent;
private ChartTextAttrPaneWithPreStyle textAttrPane;
private ChartTextAttrPane textAttrPane;
private UIButtonGroup<Integer> alignmentPane;
private VanChartBackgroundWithOutShadowWithRadiusPane backgroundPane;
private UIToggleButton useHtml;
@ -175,7 +175,9 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
}
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);
}

4
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();
}
}

40
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<VanChartAxis> {
private JPanel labelDisplayPane;
protected LineComboBox axisLineStyle;
protected ColorSelectBoxWithPreStyle axisLineColor;
//TODO Bjorn 坐标轴面板回退
protected ColorSelectBox axisLineColor;
//protected ColorSelectBoxWithPreStyle axisLineColor;
protected UIButtonGroup<AxisTickLineType> mainTick;
protected UIButtonGroup<AxisTickLineType> secondTick;
@ -378,16 +381,31 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
}
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<AxisTickLineType>(strings, values);
@ -405,7 +423,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
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<VanChartAxis> {
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<VanChartAxis> {
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());

5
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();
}
}

4
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},
};
}

4
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},
};
}

8
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<Chart
protected JPanel createContentPane() {
contentPane = new JPanel(new BorderLayout());
chartBorderPane = new VanChartBorderWithRadiusPane();
if(isPlot) {
chartBackgroundPane = new VanChartBackgroundPane();
//TODO Bjorn 背景面板回退
/* if(isPlot) {
chartBackgroundPane = new VanChartBackgroundPane();
} else {
chartBackgroundPane = new VanChartBackgroundPaneWithPreStyle();
}
}*/
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;

36
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java

@ -7,7 +7,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ColorSelectBoxWithPreStyle;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.VanChartAttrHelper;
@ -44,8 +43,11 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
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<Plot> {
}
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<Plot> {
}
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<Plot> {
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<Plot> {
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());
}
}

9
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<Chart> {
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

5
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:

4
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() {

4
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);
}

7
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();

34
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"),

23
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行删除。

9
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());
}

8
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);
}
}
}
}*/
}

13
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();
}
}

7
designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java

@ -816,13 +816,6 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
return true;
}
/**
* 初始化组件的预定义信息
*/
public void initWidgetPredefinedInfo(String styleName){
}
}

17
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();
}
}

9
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));
}
}

9
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));
}
}

11
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));
}
}

4
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<Form> 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);

1
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -644,7 +644,6 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
} else {
this.undoState = u;
}
refreshPredefinedState();
}
@Override

3
designer-form/src/main/java/com/fr/design/mainframe/ToolBarButton.java

@ -3,7 +3,6 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.form.util.FormDesignerUtils;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.core.WidgetOption;
@ -94,9 +93,7 @@ public class ToolBarButton extends UIButton implements MouseListener, MouseMotio
creatorSource = no.getNameOption().createWidget();
}
if (creatorSource != null) {
String styleName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle();
XCreator xCreator = XCreatorUtils.createXCreator(creatorSource);
xCreator.initWidgetPredefinedInfo(styleName);
WidgetToolBarPane.getTarget().startDraggingBean(xCreator);
FormDesignerUtils.addWidgetProcessInfo(xCreator.toData());
lastPressEvent = null;

13
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/BorderStyleWidgetDefinePane.java

@ -7,10 +7,10 @@ import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleBorderStyleEditor;
import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor;
import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.form.ui.AbstractBorderStyleWidget;
import com.fr.form.ui.NameLayoutBorderStyle;
import com.fr.form.ui.LayoutBorderStyle;
import javax.swing.*;
@ -20,7 +20,7 @@ import java.awt.*;
* Created by kerry on 2017/8/29.
*/
public class BorderStyleWidgetDefinePane extends AbstractDataModify<AbstractBorderStyleWidget> {
private AccessibleBorderStyleEditor borderStyleEditor;
private AccessibleWLayoutBorderStyleEditor borderStyleEditor;
public BorderStyleWidgetDefinePane(XCreator xCreator) {
super(xCreator);
@ -29,7 +29,7 @@ public class BorderStyleWidgetDefinePane extends AbstractDataModify<AbstractBord
public void initComponent() {
borderStyleEditor = new AccessibleBorderStyleEditor();
borderStyleEditor = new AccessibleWLayoutBorderStyleEditor();
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
@ -50,15 +50,14 @@ public class BorderStyleWidgetDefinePane extends AbstractDataModify<AbstractBord
@Override
public void populateBean(AbstractBorderStyleWidget ob) {
borderStyleEditor.setValue(ob.getNameBorderStyle());
borderStyleEditor.setValue(ob.getBorderStyle());
}
@Override
public AbstractBorderStyleWidget updateBean() {
AbstractBorderStyleWidget abstractBorderStyleWidget = (AbstractBorderStyleWidget)creator.toData();
NameLayoutBorderStyle componentStyle = (NameLayoutBorderStyle) borderStyleEditor.getValue();
abstractBorderStyleWidget.setNameBorderStyle(componentStyle);
abstractBorderStyleWidget.setBorderStyle((LayoutBorderStyle) borderStyleEditor.getValue());
return abstractBorderStyleWidget;
}

13
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java

@ -11,6 +11,7 @@ import com.fr.form.ui.ElementCaseEditor;
import com.fr.form.web.FormToolBarManager;
import com.fr.general.ComparatorUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
@ -38,13 +39,11 @@ public class ElementEditorDefinePane extends WTitleLayoutDefinePane<ElementCaseE
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_EC_Toolbar")), elementCaseToolBarEditor},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0));
CRPropertyDescriptor[] extraTableEditor = ((XElementCase) creator).getExtraTableEditor();
extraPropertyGroupPane = new PropertyGroupPane(extraTableEditor, creator);
centerPane.add(panel, BorderLayout.NORTH);
if (extraTableEditor.length > 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<ElementCaseE
protected void populateSubBean(ElementCaseEditor ob) {
paddingBoundPane.populate(ob);
elementCaseToolBarEditor.setValue(ob.getToolBars());
if (extraPropertyGroupPane != null) {
extraPropertyGroupPane.populate(ob);
}
extraPropertyGroupPane.populate(ob);
}
}

35
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java

@ -8,7 +8,6 @@ import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.properties.items.FRLayoutTypeItems;
import com.fr.design.designer.properties.items.Item;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
@ -16,13 +15,12 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.accessibles.AccessibleBodyBackgroundEditor;
import com.fr.design.mainframe.widget.accessibles.AccessibleBodyWatermarkEditor;
import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.design.widget.ui.designer.component.WidgetBoundPane;
import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.NameComponentBackground;
import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WBodyLayoutType;
@ -40,7 +38,7 @@ import java.awt.Component;
public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
private static final int MAX_LABEL_WIDTH = 80;
private AccessibleBodyBackgroundEditor backgroundEditor;
private AccessibleWLayoutBorderStyleEditor borderStyleEditor;
private AccessibleBodyWatermarkEditor watermarkEditor;
private WidgetBoundPane boundPane;
@ -57,11 +55,11 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
boundPane = new WidgetBoundPane(creator);
centerPane.add(boundPane, BorderLayout.CENTER);
backgroundEditor = new AccessibleBodyBackgroundEditor();
borderStyleEditor = new AccessibleWLayoutBorderStyleEditor();
watermarkEditor = new AccessibleBodyWatermarkEditor();
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background")), backgroundEditor},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style")), borderStyleEditor},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")), watermarkEditor}
}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W3, IntervalConstants.INTERVAL_L1);
JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -115,9 +113,7 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
public void populateSubPane(WAbsoluteLayout ob) {
layoutCombox.setSelectedIndex(1);
NameComponentBackground formBackground = ob.getNameBackground();
backgroundEditor.setValue(formBackground);
borderStyleEditor.setValue(ob.getBorderStyle());
boundPane.populate();
watermarkEditor.setValue(ReportUtils.getWatermarkAttrFromTemplate(getCurrentIOFile()));
}
@ -135,29 +131,16 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
if (layoutType == WBodyLayoutType.ABSOLUTE) {
((XWFitLayout) creator.getBackupParent()).toData().resetStyle();
if (state == WBodyLayoutType.FIT.getTypeValue()) {
XWFitLayout xwFitLayout = ((XWFitLayout) creator.getBackupParent());
String predefinedName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle();
xwFitLayout.initWidgetPredefinedInfo(predefinedName);
xwFitLayout.switch2FitBodyLayout(creator);
copyLayoutAttr(layout, xwFitLayout.toData());
XWFitLayout xwFitLayout = ((XWFitLayout)creator.getBackupParent());
xwFitLayout.switch2FitBodyLayout(creator);
copyLayoutAttr(layout, xwFitLayout.toData());
}
}
LayoutBorderStyle borderStyle = new LayoutBorderStyle();
NameComponentBackground background = (NameComponentBackground) backgroundEditor.getValue();
updateBodyBackground(background, borderStyle);
layout.setBorderStyle(borderStyle);
layout.setNameBackground(background);
layout.setBorderStyle((LayoutBorderStyle) borderStyleEditor.getValue());
updateWatermark();
return layout;
}
private void updateBodyBackground(NameComponentBackground background, LayoutBorderStyle borderStyle) {
if (background != null) {
borderStyle.setBackground(background.createRealStyle().getBackground());
borderStyle.setAlpha(background.getBackgroundAlphaValue());
}
}
private void updateWatermark() {
WatermarkAttr watermark = (WatermarkAttr) watermarkEditor.getValue();
if (watermark != null) {

32
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

@ -12,7 +12,6 @@ import com.fr.design.designer.creator.XWScaleLayout;
import com.fr.design.designer.properties.items.FRFitConstraintsItems;
import com.fr.design.designer.properties.items.FRLayoutTypeItems;
import com.fr.design.designer.properties.items.Item;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
@ -23,13 +22,12 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelectionUtils;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.accessibles.AccessibleBodyBackgroundEditor;
import com.fr.design.mainframe.widget.accessibles.AccessibleBodyWatermarkEditor;
import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.design.widget.ui.designer.component.PaddingBoundPane;
import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.NameComponentBackground;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.form.ui.container.WAbsoluteLayout;
@ -57,7 +55,7 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
private UIComboBox adaptComboBox;
private UISpinner componentIntervel;
private PaddingBoundPane paddingBound;
private AccessibleBodyBackgroundEditor stylePane;
private AccessibleWLayoutBorderStyleEditor stylePane;
private AccessibleBodyWatermarkEditor watermarkEditor;
public FRFitLayoutDefinePane(XCreator xCreator) {
@ -79,12 +77,12 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
public JPanel createAdvancePane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
stylePane = new AccessibleBodyBackgroundEditor();
stylePane = new AccessibleWLayoutBorderStyleEditor();
watermarkEditor = new AccessibleBodyWatermarkEditor();
paddingBound = new PaddingBoundPane();
JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background")), stylePane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style")), stylePane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")), watermarkEditor}
}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W3, IntervalConstants.INTERVAL_L1);
jp2.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
@ -156,8 +154,7 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue());
adaptComboBox.setSelectedIndex(ob.getCompState());
componentIntervel.setValue(ob.getCompInterval());
NameComponentBackground formBackground = ob.getNameBackground();
stylePane.setValue(formBackground);
stylePane.setValue(ob.getBorderStyle());
watermarkEditor.setValue(ReportUtils.getWatermarkAttrFromTemplate(getCurrentIOFile()));
}
@ -176,12 +173,10 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout_Padding_Duplicate"))) {
paddingBound.update(layout);
}
LayoutBorderStyle borderStyle = new LayoutBorderStyle();
NameComponentBackground background = (NameComponentBackground) stylePane.getValue();
updateBodyBackground(background, borderStyle);
layout.setBorderStyle(borderStyle);
layout.setNameBackground(background);
LayoutBorderStyle borderStyle = (LayoutBorderStyle) stylePane.getValue();
if (borderStyle != null) {
layout.setBorderStyle(borderStyle);
}
updateWatermark();
Item item = (Item) layoutComboBox.getSelectedItem();
Object value = item.getValue();
@ -195,13 +190,11 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
try {
if (state == WBodyLayoutType.ABSOLUTE.getTypeValue()) {
WAbsoluteBodyLayout wAbsoluteBodyLayout = new WAbsoluteBodyLayout("body");
String predefinedName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle();
wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED);
Component[] components = xWFitLayout.getComponents();
xWFitLayout.removeAll();
layout.resetStyle();
XWAbsoluteBodyLayout xwAbsoluteBodyLayout = xWFitLayout.getBackupParent() == null ? new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0)) : (XWAbsoluteBodyLayout) xWFitLayout.getBackupParent();
xwAbsoluteBodyLayout.initWidgetPredefinedInfo(predefinedName);
xWFitLayout.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0);
for (Component component : components) {
XCreator xCreator = (XCreator) component;
@ -234,13 +227,6 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
return layout;
}
private void updateBodyBackground(NameComponentBackground background, LayoutBorderStyle borderStyle) {
if (background != null) {
borderStyle.setBackground(background.createRealStyle().getBackground());
borderStyle.setAlpha(background.getBackgroundAlphaValue());
}
}
private void updateWatermark() {
WatermarkAttr watermark = (WatermarkAttr) watermarkEditor.getValue();
if (watermark != null) {

17
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java

@ -7,10 +7,12 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleBorderStyleEditor;
import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor;
import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.form.ui.AbstractBorderStyleWidget;
import com.fr.form.ui.NameLayoutBorderStyle;
import com.fr.form.ui.LayoutBorderStyle;
import com.fr.general.ComparatorUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
@ -22,7 +24,7 @@ import java.awt.Component;
* Created by ibm on 2017/8/3.
*/
public abstract class WTitleLayoutDefinePane<T extends AbstractBorderStyleWidget> extends AbstractDataModify<T> {
private AccessibleBorderStyleEditor borderStyleEditor;
private AccessibleWLayoutBorderStyleEditor borderStyleEditor;
public WTitleLayoutDefinePane(XCreator xCreator) {
super(xCreator);
@ -32,7 +34,7 @@ public abstract class WTitleLayoutDefinePane<T extends AbstractBorderStyleWidget
public void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
borderStyleEditor = new AccessibleBorderStyleEditor();
borderStyleEditor = new AccessibleWLayoutBorderStyleEditor();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
@ -67,15 +69,16 @@ public abstract class WTitleLayoutDefinePane<T extends AbstractBorderStyleWidget
@Override
public void populateBean(T ob) {
populateSubBean(ob);
borderStyleEditor.setValue(ob.getNameBorderStyle());
borderStyleEditor.setValue(ob.getBorderStyle());
}
@Override
public T updateBean() {
T e = updateSubBean();
NameLayoutBorderStyle componentStyle = (NameLayoutBorderStyle) borderStyleEditor.getValue();
e.setNameBorderStyle(componentStyle);
if(!ComparatorUtils.equals(borderStyleEditor.getValue(), e.getBorderStyle())){
e.setBorderStyle((LayoutBorderStyle) borderStyleEditor.getValue());
}
return e;
}

17
designer-realize/src/main/java/com/fr/design/actions/cell/GlobalStyleMenuDef.java

@ -6,11 +6,9 @@ package com.fr.design.actions.cell;
import com.fr.base.BaseUtils;
import com.fr.base.NameStyle;
import com.fr.base.Style;
import com.fr.config.predefined.PredefinedStyle;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.actions.SelectionListenerAction;
import com.fr.design.actions.UpdateAction;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.imenu.UIMenu;
import com.fr.design.mainframe.CellElementPropertyPane;
import com.fr.design.mainframe.ElementCasePane;
@ -19,7 +17,6 @@ import com.fr.design.menu.MenuDef;
import com.fr.design.selection.SelectionListener;
import com.fr.design.style.StylePane;
import com.fr.predefined.PredefinedPatternStyleManager;
import com.fr.stable.StringUtils;
import com.fr.stable.pinyin.PinyinHelper;
@ -75,13 +72,11 @@ public class GlobalStyleMenuDef extends MenuDef {
public void updateMenu() {
UIMenu createdMenu = this.createJMenu();
createdMenu.removeAll();
String styleName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle();
PredefinedStyle currentStyle = PredefinedPatternStyleManager.INSTANCE.getStyleFromName(styleName);
Iterator iterator = currentStyle.getCellStyleConfig().getStyleNameIterator();
Iterator iterator = ServerPreferenceConfig.getInstance().getStyleNameIterator();
while (iterator.hasNext()) {
String name = (String) iterator.next();
NameStyle nameStyle = NameStyle.createPredefinedStyle(styleName, name, Style.getInstance());
UpdateAction.UseMenuItem useMenuItem = new GlobalStyleSelection(ePane, nameStyle).createUseMenuItem();
NameStyle nameStyle = NameStyle.getInstance(name);
UpdateAction.UseMenuItem useMenuItem =new GlobalStyleSelection(ePane, nameStyle).createUseMenuItem();
useMenuItem.setNameStyle(nameStyle);
createdMenu.add(useMenuItem);
}
@ -179,9 +174,9 @@ public class GlobalStyleMenuDef extends MenuDef {
if (StringUtils.isEmpty(this.getName())) {
stylePane.setGlobalStyle(this.getNameStyle());
} else {
String styleName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle();
stylePane.setGlobalStyle(NameStyle.createPredefinedStyle(styleName, this.getName(), Style.getInstance()));
stylePane.setGlobalStyle(NameStyle.getInstance(this.getName()));
}
stylePane.updateGlobalStyle(getEditingComponent());
CellElementPropertyPane.getInstance().GoToPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style"));
return true;

9
designer-realize/src/main/java/com/fr/design/actions/report/ReportBackgroundAction.java

@ -5,11 +5,12 @@ package com.fr.design.actions.report;
import com.fr.base.BaseUtils;
import com.fr.design.actions.ReportComponentAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ReportComponent;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.report.ReportBackgroundPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.report.ReportPredefinedBackgroundPane;
import com.fr.report.core.ReportUtils;
/**
@ -34,13 +35,13 @@ public class ReportBackgroundAction extends ReportComponentAction<ReportComponen
if (reportPane == null) {
return false;
}
final ReportPredefinedBackgroundPane bPane = new ReportPredefinedBackgroundPane();
bPane.populateBean(ReportUtils.getReportSettings(reportPane.getTemplateReport()));
final ReportBackgroundPane bPane = new ReportBackgroundPane();
bPane.populate(ReportUtils.getReportSettings(reportPane.getTemplateReport()));
bPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
bPane.updateBean(reportPane.getTemplateReport().getReportSettings());
bPane.update(reportPane.getTemplateReport().getReportSettings());
reportPane.fireTargetModified();
}
}).setVisible(true);

4
designer-realize/src/main/java/com/fr/design/actions/server/predefined/ServerPredefinedStyleAction.java

@ -7,7 +7,7 @@ import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.menu.SnapChatUpdateAction;
import com.fr.design.notification.SnapChatKey;
import com.fr.design.utils.DesignUtils;
//import com.fr.design.utils.PredefinedStyleUtils;
import com.fr.general.IOUtils;
import javax.swing.KeyStroke;
@ -21,7 +21,7 @@ public class ServerPredefinedStyleAction extends SnapChatUpdateAction {
public ServerPredefinedStyleAction(SnapChatKey uniqueKey) {
super(uniqueKey);
this.setEnabled(DesignUtils.checkDesignerRemoteVersion());
// this.setEnabled(PredefinedStyleUtils.isAllowPredefinedSetting());
this.setMenuKeySet(PREDEFINED_STYLES);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());

6
designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java

@ -11,7 +11,7 @@ import com.fr.grid.selection.Selection;
import com.fr.log.FineLoggerFactory;
import com.fr.privilege.finegrain.WidgetPrivilegeControl;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultPredefinedTemplateCellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
@ -59,7 +59,7 @@ public class CellWidgetPropertyPane extends BasicPane {
public void populate(TemplateCellElement cellElement) {
if (cellElement == null) {// 利用默认的CellElement.
cellElement = new DefaultPredefinedTemplateCellElement(0, 0, null);
cellElement = new DefaultTemplateCellElement(0, 0, null);
}
Widget cellWidget = cellElement.getWidget();
@ -88,7 +88,7 @@ public class CellWidgetPropertyPane extends BasicPane {
final TemplateElementCase tplEC = ePane.getEditingElementCase();
TemplateCellElement editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());
if (editCellElement == null) {
editCellElement = new DefaultPredefinedTemplateCellElement(cs.getColumn(), cs.getRow());
editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
}
this.cellElement = editCellElement;
this.populate(editCellElement);

2
designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java

@ -11,7 +11,6 @@ import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.mainframe.errorinfo.ErrorInfoUploader;
import com.fr.design.mainframe.messagecollect.impl.FocusPointMessageUploader;
import com.fr.design.mainframe.messagecollect.solid.SolidCollector;
import com.fr.design.mainframe.predefined.info.PredefinedStyleInfoCollector;
import com.fr.design.mainframe.template.info.TemplateInfoCollector;
import com.fr.general.CloudCenter;
import com.fr.general.ComparatorUtils;
@ -242,7 +241,6 @@ public class InformationCollector implements XMLReadable, XMLWriter {
TemplateInfoCollector.getInstance().sendPointInfo();
ChartInfoCollector.getInstance().sendPointInfo();
ErrorInfoUploader.getInstance().sendErrorInfo();
PredefinedStyleInfoCollector.getInstance().sendPointInfo();
}
}, SEND_DELAY, TimeUnit.MILLISECONDS);
service.shutdown();

14
designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

@ -2,7 +2,6 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.DynamicUnitList;
import com.fr.form.ui.NameBackground;
import com.fr.base.Parameter;
import com.fr.base.ScreenResolution;
import com.fr.base.extension.FileExtension;
@ -92,7 +91,6 @@ import com.fr.report.cell.cellattr.CellImage;
import com.fr.report.cell.painter.CellImagePainter;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.poly.PolyWorkSheet;
import com.fr.report.stable.ReportSettings;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ArrayUtils;
import com.fr.stable.AssistUtils;
@ -134,18 +132,10 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
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<WorkBook, WorkBookUndoState> {
populateReportParameterAttr();
}
@Override
protected void addPane(PropertyItemPaneProvider provider) {
PaneHolder<JWorkBook> holder = provider.getPaneHolder(JWorkBook.class);
@ -787,7 +776,6 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
refreshPredefinedState();
}
private void applyAll(WorkBookUndoState u) {

16
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

4
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);

92
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]);
}
}

37
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<N
@Override
public void populateBean(NameStyle ob) {
this.setPopulating(true);
super.populate(ob);
PredefinedStyle currentStyle = PredefinedPatternStyleManager.INSTANCE.getStyleFromName(getPredefinedStyleName());
PredefinedCellStyleConfig config = currentStyle.getCellStyleConfig();
Map<String, PredefinedCellStyle> 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<String, PredefinedCellStyle> 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<N
public NameStyle updateBean() {
Style style = updateStyle();
if (!(style instanceof NameStyle)) {
return NameStyle.createCustomStyle(style);
// return NameStyle.createCustomStyle(style);
}
return (NameStyle) style;
}
@ -138,7 +138,8 @@ public class CellPredefinedStyleSettingPane extends PredefinedStyleSettingPane<N
private NameStyle updatePredefinedStyle() {
Object selectItem = this.applicationFormat.getSelectedItem();
return NameStyle.createPredefinedStyle(getPredefinedStyleName(), selectItem == null ? StringUtils.EMPTY : selectItem.toString(), Style.getInstance());
// return NameStyle.createPredefinedStyle(getPredefinedStyleName(), selectItem == null ? StringUtils.EMPTY : selectItem.toString(), Style.getInstance());
return null;
}
class CustomStylePane extends MultiTabPane<Style> {

4
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); // 不知道这行代码的作用,怕去掉之后会出问题,先放在这里

6
designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java

@ -67,8 +67,8 @@ public class ReportPredefinedBackgroundPane extends PredefinedStyleSettingPane<R
@Override
public void populateBean(ReportSettingsProvider reportSettings) {
this.setPopulating(true);
PredefinedNameStyleProvider nameBackground = reportSettings.getNameBackground();
super.populate(nameBackground);
// PredefinedNameStyleProvider nameBackground = reportSettings.getNameBackground();
// super.populate(nameBackground);
this.backgroundPane.populateBean(reportSettings.getBackground());
this.isPrintBackgroundCheckBox.setSelected(reportSettings.isPrintBackground());
this.isExportBackgroundCheckBox.setSelected(reportSettings.isExportBackground());
@ -84,7 +84,7 @@ public class ReportPredefinedBackgroundPane extends PredefinedStyleSettingPane<R
public void updateBean(ReportSettingsProvider reportSettings) {
if (this.predefinedRadioBtn.isSelected()) {
((ReportSettings) reportSettings).setNameBackground(updatePredefinedStyle());
// ((ReportSettings) reportSettings).setNameBackground(updatePredefinedStyle());
} else {
reportSettings.setBackground(this.backgroundPane.updateBean());
}

7
designer-realize/src/main/java/com/fr/design/style/BorderUtils.java

@ -7,7 +7,6 @@ import java.util.Hashtable;
import java.util.List;
import com.fr.base.CellBorderStyle;
import com.fr.base.NameStyle;
import com.fr.base.Style;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.ComparatorUtils;
@ -15,7 +14,6 @@ import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultPredefinedTemplateCellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.FloatElement;
import com.fr.report.cell.TemplateCellElement;
@ -513,13 +511,10 @@ public abstract class BorderUtils {
for (int j = row; j < row + rowSpan; j++) {
TemplateCellElement tmpCellElement = report.getTemplateCellElement(i, j);
if (tmpCellElement == null) {
tmpCellElement = new DefaultPredefinedTemplateCellElement(i, j);
tmpCellElement = new DefaultTemplateCellElement(i, j);
report.addCellElement(tmpCellElement);
}
Style style = tmpCellElement.getStyle();
if (style instanceof NameStyle && ((NameStyle) style).usePredefinedStyle()) {
continue;
}
style = inspectStyle(row, column, rowSpan, columnSpan, cellBorderStyle, newCellBorderStyle, tmpCellElement, style);
tmpCellElement.setStyle(style);
}

6
designer-realize/src/main/java/com/fr/grid/Grid.java

@ -28,7 +28,7 @@ import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.ReportHelper;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultPredefinedTemplateCellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.FloatElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellGUIAttr;
@ -865,7 +865,7 @@ public class Grid extends BaseGridComponent {
}
// 必须保证editingCellElement不是null。
if (editingCellElement == null) {
editingCellElement = new DefaultPredefinedTemplateCellElement(column, row);
editingCellElement = new DefaultTemplateCellElement(column, row);
}
editorComponent = getCellEditingComp();
if (editorComponent == null) {
@ -1029,7 +1029,7 @@ public class Grid extends BaseGridComponent {
}
// 必须保证editingCellElement不是null。
if (editingCellElement == null) {
editingCellElement = new DefaultPredefinedTemplateCellElement(editingColumn, editingRow);
editingCellElement = new DefaultTemplateCellElement(editingColumn, editingRow);
tplEC.addCellElement(editingCellElement);
}
if (setValue4EditingElement(newValue)) {

28
designer-realize/src/main/java/com/fr/grid/GridUI.java

@ -4,16 +4,13 @@ import com.fr.base.BaseFormula;
import com.fr.base.DynamicUnitList;
import com.fr.base.GraphHelper;
import com.fr.base.Margin;
import com.fr.base.NameStyle;
import com.fr.base.PaperSize;
import com.fr.base.Utils;
import com.fr.base.background.ColorBackground;
import com.fr.base.background.ImageFileBackground;
import com.fr.base.chart.BaseChartCollection;
import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
@ -46,19 +43,16 @@ import com.fr.report.stable.ReportConstants;
import com.fr.report.stable.ReportSettings;
import com.fr.report.worksheet.FormElementCase;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.AssistUtils;
import com.fr.stable.ColumnRow;
import com.fr.stable.Constants;
import com.fr.stable.script.CalculatorUtils;
import com.fr.stable.unit.FU;
import com.fr.stable.AssistUtils;
import com.fr.third.antlr.ANTLRException;
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.awt.AlphaComposite;
import java.awt.BasicStroke;
import java.awt.Color;
@ -76,6 +70,9 @@ import java.awt.geom.Line2D;
import java.awt.geom.Line2D.Double;
import java.awt.geom.Path2D;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class GridUI extends ComponentUI {
@ -169,8 +166,6 @@ public class GridUI extends ComponentUI {
- reportSettings.getFooterHeight().toPixD(resolution);
}
//绘制背景之前需要先将全局预定义样式名称刷新到报表配置中
reportSettings.getNameBackground().resetPreferenceStyle(getGlobalPredefinedStyleName());
// denny:画背景.Background
Background background = reportSettings.getBackground();
@ -185,10 +180,6 @@ public class GridUI extends ComponentUI {
}
}
private String getGlobalPredefinedStyleName() {
return HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle();
}
private void clearBackground(Graphics2D g2d, Grid grid) {
if (grid.isEnabled()) {
g2d.setPaint(Color.WHITE);
@ -309,7 +300,7 @@ public class GridUI extends ComponentUI {
private int resolution;
private static final double THRESHOLD = 1.0E-4D;
private static final double THRESHOLD = 1.0E-4D;
DrawLineHelper(int startIndex, int endIndex, boolean showGridLine,
boolean showPaginateLine, DynamicUnitList sizeList, double paperPaintSize,
@ -510,12 +501,6 @@ public class GridUI extends ComponentUI {
double cellWidth = this.tmpRectangle.getWidth();
double cellHeight = this.tmpRectangle.getHeight();
if (tmpCellElement.getStyle() instanceof NameStyle) {
((NameStyle) tmpCellElement.getStyle()).setPredefinedStyleName(getGlobalPredefinedStyleName());
}
if (tmpCellElement.getValue() instanceof BaseChartCollection) {
((BaseChartCollection) tmpCellElement.getValue()).setPredefinedStyleName(getGlobalPredefinedStyleName(), false);
}
// denny_Grid: 画Grid中单元格的内容(包括单元格的背景Content + Background), 不包括边框
painter.paintBackground(g2d, report, tmpCellElement, cellWidth - 1, cellHeight - 1);
@ -962,9 +947,6 @@ public class GridUI extends ComponentUI {
g2d.translate(floatX, floatY);
if (tmpFloatElement.getValue() instanceof BaseChartCollection) {
((BaseChartCollection) tmpFloatElement.getValue()).setPredefinedStyleName(getGlobalPredefinedStyleName(), false);
}
PaintUtils.paintFloatElement(g2d, tmpFloatElement,
tmpFloatElement.getWidth().toPixI(resolution),
tmpFloatElement.getHeight().toPixI(resolution), resolution);

14
designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

@ -3,12 +3,10 @@ package com.fr.grid.selection;
import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.base.NameStyle;
import com.fr.base.Style;
import com.fr.base.Utils;
import com.fr.base.vcs.DesignerMode;
import com.fr.cache.list.IntList;
import com.fr.config.ServerPreferenceConfig;
import com.fr.config.predefined.PredefinedStyle;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.cell.CellAttributeAction;
import com.fr.design.actions.cell.CellExpandAttrAction;
@ -30,7 +28,6 @@ import com.fr.design.cell.clipboard.ElementsTransferable;
import com.fr.design.designer.TargetComponent;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.imenu.UIMenu;
import com.fr.design.gui.imenu.UIPopupMenu;
@ -44,7 +41,6 @@ import com.fr.design.report.RowColumnPane;
import com.fr.design.selection.QuickEditor;
import com.fr.grid.GridUtils;
import com.fr.predefined.PredefinedPatternStyleManager;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
@ -480,13 +476,11 @@ public class CellSelection extends Selection {
if (!ServerPreferenceConfig.getInstance().hasStyle()) {
UIMenu styleMenu = new UIMenu(KeySetUtils.GLOBAL_STYLE.getMenuName());
styleMenu.setIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cell.png"));
String styleName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle();
PredefinedStyle currentStyle = PredefinedPatternStyleManager.INSTANCE.getStyleFromName(styleName);
Iterator iterator = currentStyle.getCellStyleConfig().getStyleNameIterator();
while (iterator.hasNext()) {
String name = (String) iterator.next();
Iterator iterato = ServerPreferenceConfig.getInstance().getStyleNameIterator();
while (iterato.hasNext()) {
String name = (String) iterato.next();
name = GlobalStyleMenuDef.judgeChina(name);
NameStyle nameStyle = NameStyle.createPredefinedStyle(styleName, name, Style.getInstance());
NameStyle nameStyle = NameStyle.getInstance(name);
UpdateAction.UseMenuItem useMenuItem = new GlobalStyleSelection(ePane, nameStyle).createUseMenuItem();
useMenuItem.setNameStyle(nameStyle);
styleMenu.add(useMenuItem);

5
designer-realize/src/main/java/com/fr/start/MainDesigner.java

@ -7,7 +7,6 @@ import com.fr.design.actions.file.WebPreviewUtils;
import com.fr.design.actions.file.newReport.NewPolyReportAction;
import com.fr.design.actions.file.newReport.NewWorkBookAction;
import com.fr.design.actions.server.ServerConfigManagerAction;
import com.fr.design.actions.server.predefined.ServerPredefinedStyleAction;
import com.fr.design.actions.server.StyleListAction;
import com.fr.design.actions.server.WidgetManagerAction;
import com.fr.design.base.mode.DesignModeContext;
@ -37,7 +36,6 @@ import com.fr.design.menu.ShortCut;
import com.fr.design.module.ChartEmptyDataStyleAction;
import com.fr.design.module.ChartPreStyleAction;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.notification.SnapChatAllTypes;
import com.fr.design.utils.concurrent.ThreadFactoryBuilder;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.event.Event;
@ -163,8 +161,7 @@ public class MainDesigner extends BaseDesigner {
menuDef.addShortCut(SeparatorDef.DEFAULT);
if (WorkContext.getCurrent().isRoot()) {
menuDef.addShortCut(new ServerConfigManagerAction(), new ServerPredefinedStyleAction(SnapChatAllTypes.UpdateAction.PREDEFINED_STYLE),
new WidgetManagerAction());
menuDef.addShortCut(new ServerConfigManagerAction(), new StyleListAction(), new WidgetManagerAction());
menuDef.addShortCut(new ChartPreStyleAction(), new ChartEmptyDataStyleAction(),new ChartMapEditorAction());
}

Loading…
Cancel
Save