Browse Source

Pull request #2617: REPORT-35149【10.0.11】预定义样式优化及与图表统一

Merge in DESIGN/design from ~KERRY/design_10.0:feature/10.0 to feature/10.0

* commit '0bbb6a54f036836b0e45b88a857d102503e08343':
  增加一个提示
  修改网址key
  样式调整
  代码修改
  REPORT-35149【10.0.11】预定义样式优化及与图表统一
research/11.0
kerry 4 years ago
parent
commit
cd4423e540
  1. 17
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  2. 2
      designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java
  3. 9
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java
  4. 2
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSelectPane.java
  5. 4
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java
  6. 6
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ComponentStyleSettingPane.java
  7. 2
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/GradientDetailPane.java
  8. 10
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/PatternDetailPane.java
  9. 2
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/dialog/PredefinedStyleEditDialog.java
  10. 10
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/dialog/ReportPredefinedStyleDialog.java
  11. 24
      designer-base/src/main/java/com/fr/design/utils/DesignUtils.java
  12. 7
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  13. 10
      designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java
  14. 9
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java
  15. 11
      designer-form/src/main/java/com/fr/design/gui/xpane/FormPredefinedBackgroundPane.java
  16. 54
      designer-form/src/main/java/com/fr/design/gui/xpane/PredefinedComponentStyleSettingPane.java
  17. 6
      designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyBackgroundEditor.java
  18. 6
      designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBorderStyleEditor.java
  19. 9
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/BorderStyleWidgetDefinePane.java
  20. 35
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/ComponentStyle.java
  21. 10
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java
  22. 11
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java
  23. 9
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  24. 10
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java
  25. 22
      designer-realize/src/main/java/com/fr/design/actions/cell/GlobalStyleMenuDef.java
  26. 2
      designer-realize/src/main/java/com/fr/design/actions/server/predefined/ServerPredefinedStyleAction.java
  27. 4
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java
  28. 6
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java
  29. 9
      designer-realize/src/main/java/com/fr/design/style/BorderUtils.java
  30. 23
      designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

17
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -51,6 +51,7 @@ 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.utils.DesignUtils;
import com.fr.design.write.submit.DBManipulationInWidgetEventPane;
import com.fr.design.write.submit.DBManipulationPane;
import com.fr.file.FILE;
@ -59,6 +60,7 @@ 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;
@ -77,7 +79,6 @@ 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;
@ -154,13 +155,20 @@ 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) {
this.template.addAttrMark(new PredefinedStyleAttrMark());
PredefinedStyleAttrMark attrMark= new PredefinedStyleAttrMark();
if (!isNewFile){
attrMark.setPreferenceStyleName(InterProviderFactory.getProvider().getLocText("Fine-Engine_Predefined_Style_Compatibility"));
}
this.template.addAttrMark(attrMark);
}
}
private void initAndStartPlugin() {
initPluginPane();
startListenPlugin();
@ -1339,9 +1347,12 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
}
});
preferenceButton.setEnabled(DesignUtils.checkDesignerRemoteVersion());
return preferenceButton;
}
private void setPredefinedButtonSize(UIButton predefinedBtn) {
String text = predefinedBtn.getText();
FontMetrics metrics = predefinedBtn.getFontMetrics(predefinedBtn.getFont());

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

@ -18,7 +18,7 @@ public class PredefinedStyleInfoCollector extends AbstractPointCollector {
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("predefinedInfo.collector") + "/single";
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";

9
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java

@ -27,6 +27,7 @@ import javax.swing.SwingUtilities;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.util.Iterator;
import java.util.LinkedHashMap;
@ -36,6 +37,8 @@ import java.util.Map;
* Created by kerry on 2020-08-26
*/
public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane {
private static final Color TIP_COLOR = Color.decode("#8F8F92");
private PredefinedStylePreviewPane previewPane;
private UITextField styleNameField;
private PredefinedBackgroundSettingPane backgroundSettingPane;
@ -189,9 +192,13 @@ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane {
private JPanel createComponentStyleSettingPane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.setLayout(new BorderLayout(0, 5));
jPanel.setBorder(BorderFactory.createEmptyBorder(10, 5, 10, 5));
this.componentStyleSettingPane = new ComponentStyleSettingPane();
jPanel.add(this.componentStyleSettingPane);
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Predefined_ComponentStyle_Setting_Tip"));
label.setForeground(TIP_COLOR);
jPanel.add(label, BorderLayout.NORTH);
jPanel.add(this.componentStyleSettingPane, BorderLayout.CENTER);
return jPanel;
}

2
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSelectPane.java

@ -51,7 +51,7 @@ public class PredefinedStyleSelectPane extends BasicPane {
contentPane.removeAll();
Iterator<PredefinedStyle> iterator = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig().getPredefinedStyleIterator();
int rowCount = (ServerPreferenceConfig.getInstance().getPreferenceStyleConfig().getPredefinedSize() +2)/ 3;
contentPane.setPreferredSize(new Dimension(618, 210 * rowCount));
contentPane.setPreferredSize(new Dimension(618, 220 * rowCount));
while (iterator.hasNext()) {
PredefinedStyle tmpStyle = iterator.next();

4
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java

@ -190,7 +190,9 @@ public class ServerPredefinedStylePane extends BasicPane {
PredefinedStyleEditPane editPane = PredefinedStyleEditPane.createNewEditPane(selectPane);
PredefinedStyleEditDialog editDialog = new PredefinedStyleEditDialog(
SwingUtilities.getWindowAncestor(ServerPredefinedStylePane.this), editPane);
editPane.populate(style.getPredefinedStyle());
PredefinedStyle predefinedStyle = style.getPredefinedStyle();
predefinedStyle.setStyleName(StringUtils.EMPTY);
editPane.populate(predefinedStyle);
editDialog.setVisible(true);
}
}

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

@ -4,7 +4,6 @@ import com.fr.config.predefined.PredefinedComponentStyle;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.MultiTabPane;
import com.fr.design.mainframe.predefined.ui.detail.component.ComponentFrameStylePane;
import com.fr.design.mainframe.predefined.ui.detail.component.ComponentMarginStylePane;
import com.fr.design.mainframe.predefined.ui.detail.component.ComponentTitleStylePane;
import java.util.ArrayList;
@ -16,7 +15,6 @@ import java.util.List;
public class ComponentStyleSettingPane extends MultiTabPane<PredefinedComponentStyle> {
private ComponentFrameStylePane frameStylePane;
private ComponentTitleStylePane titleStylePane;
private ComponentMarginStylePane marginStylePane;
public ComponentStyleSettingPane() {
}
@ -26,11 +24,9 @@ public class ComponentStyleSettingPane extends MultiTabPane<PredefinedComponentS
protected List<BasicPane> initPaneList() {
this.frameStylePane = new ComponentFrameStylePane();
this.titleStylePane = ComponentTitleStylePane.createPredefinedSettingPane();
this.marginStylePane = new ComponentMarginStylePane();
paneList = new ArrayList<BasicPane>();
paneList.add(this.frameStylePane);
paneList.add(this.titleStylePane);
paneList.add(this.marginStylePane);
return paneList;
}
@ -38,7 +34,6 @@ public class ComponentStyleSettingPane extends MultiTabPane<PredefinedComponentS
public void populateBean(PredefinedComponentStyle ob) {
this.frameStylePane.populate(ob);
this.titleStylePane.populate(ob);
this.marginStylePane.populate(ob);
}
@Override
@ -52,7 +47,6 @@ public class ComponentStyleSettingPane extends MultiTabPane<PredefinedComponentS
PredefinedComponentStyle componentStyle = new PredefinedComponentStyle();
this.frameStylePane.update(componentStyle);
this.titleStylePane.update(componentStyle);
this.marginStylePane.update(componentStyle);
return componentStyle;
}

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

@ -38,7 +38,7 @@ public class GradientDetailPane extends AbstractBackgroundDetailPane<GradientBac
JPanel gradientPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel blankJp = new JPanel();
gradientBar = new GradientBar(4, 145);
gradientBar = new GradientBar(4, 140);
blankJp.add(gradientBar);
gradientPanel.add(gradientBar, BorderLayout.SOUTH);

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

@ -2,8 +2,6 @@ package com.fr.design.mainframe.predefined.ui.detail.background;
import com.fr.base.background.PatternBackground;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.AttrScrollPane;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ilable.UILabel;
@ -106,14 +104,8 @@ public class PatternDetailPane extends AbstractBackgroundDetailPane<PatternBackg
IntervalConstants.INTERVAL_W4, IntervalConstants.INTERVAL_L1);
JPanel jPanel1 = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
jPanel1.add(centerPane);
BasicScrollPane basicScrollPane = new AttrScrollPane() {
@Override
protected JPanel createContentPane() {
return jPanel1;
}
};
jPanel1.setBorder(BorderFactory.createEmptyBorder());
this.add(basicScrollPane, BorderLayout.NORTH);
this.add(jPanel1, BorderLayout.NORTH);
this.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {

2
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/dialog/PredefinedStyleEditDialog.java

@ -143,7 +143,7 @@ public class PredefinedStyleEditDialog extends JDialog {
});
this.setSize(new Dimension(300, 130));
this.setSize(new Dimension(300, 140));
GUICoreUtils.centerWindow(this);
}

10
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/dialog/ReportPredefinedStyleDialog.java

@ -5,6 +5,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.predefined.ui.ReportPredefinedStylePane;
import com.fr.design.mainframe.predefined.ui.ServerPredefinedStylePane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.workspace.WorkContext;
import javax.swing.JDialog;
import javax.swing.JPanel;
@ -63,9 +64,12 @@ public class ReportPredefinedStyleDialog extends JDialog {
}
});
JPanel southPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel buttonPanel1 = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
buttonPanel1.add(managerBtn);
southPane.add(buttonPanel1, BorderLayout.CENTER);
if (WorkContext.getCurrent().isRoot()){
JPanel buttonPanel1 = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
buttonPanel1.add(managerBtn);
southPane.add(buttonPanel1, BorderLayout.CENTER);
}
JPanel buttonPanel2 = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
buttonPanel2.add(settingBtn);

24
designer-base/src/main/java/com/fr/design/utils/DesignUtils.java

@ -6,6 +6,7 @@ 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.mainframe.DesignerContext;
@ -14,6 +15,7 @@ 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;
@ -22,7 +24,8 @@ import com.fr.stable.StringUtils;
import com.fr.stable.os.OperatingSystem;
import com.fr.start.ServerStarter;
import com.fr.workspace.WorkContext;
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;
@ -404,4 +407,23 @@ public class DesignUtils {
public static boolean sendFeedBack(FeedBackInfo feedBackInfo) throws Exception {
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);
}
}

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

@ -20,8 +20,8 @@ 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.NamePaddingMargin;
import com.fr.form.ui.Widget;
import com.fr.stable.Constants;
import com.fr.stable.core.PropertyChangeAdapter;
@ -230,6 +230,7 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
* 渲染Painter
*/
public void paint(Graphics g) {
initBorderStyle();
designerEditor.paintEditor(g, this.getSize());
if (coverPanel != null) {
coverPanel.setSize(this.getSize());
@ -368,10 +369,10 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
* 初始化组件的预定义信息
*/
public void initWidgetPredefinedInfo(String styleName){
this.toData().setNameMargin(NamePaddingMargin.createPredefinedStyle(styleName));
this.toData().setNameBorderStyle(NameLayoutBorderStyle.createPredefinedStyle(styleName));
this.toData().setNameBackground(NameComponentBackground.createPredefinedStyle(styleName));
initBorderStyle();
}
}

10
designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java

@ -19,12 +19,11 @@ 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.form.ui.NamePaddingMargin;
import com.fr.report.fit.ReportFitAttr;
import com.fr.stable.ArrayUtils;
import com.fr.stable.CoreGraphHelper;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.report.fit.FitProvider;
@ -379,10 +378,15 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
* 初始化组件的预定义信息
*/
public void initWidgetPredefinedInfo(String styleName){
this.toData().setNameMargin(NamePaddingMargin.createPredefinedStyle(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/cardlayout/XWTabFitLayout.java

@ -8,27 +8,22 @@ import com.fr.design.designer.creator.CRPropertyDescriptor;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.properties.mobile.MobileBooKMarkUsePropertyUI;
import com.fr.design.designer.properties.mobile.MobileBookMarkPropertyUI;
import com.fr.design.form.util.FormDesignerUtils;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormHierarchyTreePane;
import com.fr.design.mainframe.WidgetPropertyPane;
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.NameFormBackground;
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;
import com.fr.general.Background;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.border.Border;
@ -652,7 +647,7 @@ public class XWTabFitLayout extends XWFitLayout {
* 初始化组件的预定义信息
*/
public void initWidgetPredefinedInfo(String styleName){
this.toData().setNameBackground(NameFormBackground.createCustomStyleWithBackground(null));
this.toData().setNameBackground(NameComponentBackground.createPredefinedStyle(styleName));
}
}

11
designer-form/src/main/java/com/fr/design/gui/xpane/FormPredefinedBackgroundPane.java

@ -5,6 +5,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.predefined.ui.PredefinedStyleSettingPane;
import com.fr.design.mainframe.predefined.ui.detail.background.BackgroundWithAlphaSettingPane;
import com.fr.design.mainframe.predefined.ui.preview.StyleSettingPreviewPane;
import com.fr.form.ui.NameComponentBackground;
import com.fr.form.ui.NameFormBackground;
import javax.swing.JPanel;
@ -19,7 +20,7 @@ import java.awt.geom.Rectangle2D;
/**
* Created by kerry on 2020-09-02
*/
public class FormPredefinedBackgroundPane extends PredefinedStyleSettingPane<NameFormBackground> {
public class FormPredefinedBackgroundPane extends PredefinedStyleSettingPane<NameComponentBackground> {
private BackgroundWithAlphaSettingPane backgroundPane;
@Override
@ -42,7 +43,7 @@ public class FormPredefinedBackgroundPane extends PredefinedStyleSettingPane<Nam
}
@Override
public void populateBean(NameFormBackground ob) {
public void populateBean(NameComponentBackground ob) {
this.setPopulating(true);
super.populate(ob);
this.backgroundPane.populateBean(ob.createRealStyle());
@ -52,7 +53,7 @@ public class FormPredefinedBackgroundPane extends PredefinedStyleSettingPane<Nam
@Override
public NameFormBackground updateBean() {
public NameComponentBackground updateBean() {
if (this.predefinedRadioBtn.isSelected()) {
return NameFormBackground.createPredefinedStyle(getPredefinedStyleName());
} else {
@ -62,8 +63,8 @@ public class FormPredefinedBackgroundPane extends PredefinedStyleSettingPane<Nam
private BackgroundWithAlpha getCurrentValue() {
if (this.predefinedRadioBtn.isSelected()) {
NameFormBackground nameFormBackground = NameFormBackground.createPredefinedStyle(getPredefinedStyleName());
return nameFormBackground.createRealStyle();
NameComponentBackground componentBackground = NameFormBackground.createPredefinedStyle(getPredefinedStyleName());
return componentBackground.createRealStyle();
} else {
return this.backgroundPane.updateBean();
}

54
designer-form/src/main/java/com/fr/design/gui/xpane/PredefinedComponentStyleSettingPane.java

@ -7,14 +7,10 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.predefined.ui.PredefinedStyleSettingPane;
import com.fr.design.mainframe.predefined.ui.detail.component.ComponentFrameStylePane;
import com.fr.design.mainframe.predefined.ui.detail.component.ComponentMarginStylePane;
import com.fr.design.mainframe.predefined.ui.detail.component.ComponentTitleStylePane;
import com.fr.design.mainframe.predefined.ui.preview.StyleSettingPreviewPane;
import com.fr.design.widget.ui.designer.layout.ComponentStyle;
import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.NameLayoutBorderStyle;
import com.fr.form.ui.NamePaddingMargin;
import com.fr.form.ui.PaddingMargin;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Dimension;
@ -23,7 +19,7 @@ import java.awt.FlowLayout;
/**
* Created by kerry on 2020-09-02
*/
public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingPane<ComponentStyle> {
public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingPane<NameLayoutBorderStyle> {
private StyleSettingPane styleSettingPane;
private TinyFormulaPane formulaPane;
@ -52,11 +48,10 @@ public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingP
}
@Override
public void populateBean(ComponentStyle ob) {
public void populateBean(NameLayoutBorderStyle ob) {
this.setPopulating(true);
NameLayoutBorderStyle layoutBorderStyle = ob.getNameLayoutBorderStyle();
super.populate(layoutBorderStyle);
this.formulaPane.populateBean(layoutBorderStyle.getTitleText().toString());
super.populate(ob);
this.formulaPane.populateBean(ob.getTitleText().toString());
styleSettingPane.populateBean(ob);
this.previewPane.refresh();
this.setPopulating(false);
@ -64,12 +59,11 @@ public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingP
@Override
public ComponentStyle updateBean() {
public NameLayoutBorderStyle updateBean() {
if (predefinedRadioBtn.isSelected()) {
NameLayoutBorderStyle layoutBorderStyle = NameLayoutBorderStyle.createPredefinedStyle(getPredefinedStyleName());
layoutBorderStyle.setTitleText(formulaPane.updateBean());
return new ComponentStyle(layoutBorderStyle,
NamePaddingMargin.createPredefinedStyle(getPredefinedStyleName()));
return layoutBorderStyle;
}
return styleSettingPane.updateBean();
}
@ -79,10 +73,9 @@ public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingP
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Style");
}
class StyleSettingPane extends BasicBeanPane<ComponentStyle> {
class StyleSettingPane extends BasicBeanPane<NameLayoutBorderStyle> {
private ComponentFrameStylePane frameStylePane;
private ComponentTitleStylePane titleStylePane;
private ComponentMarginStylePane marginStylePane;
public StyleSettingPane() {
initPane();
@ -92,53 +85,37 @@ public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingP
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel frame = FRGUIPaneFactory.createTitledBorderNoGapPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Frame"));
frameStylePane = new ComponentFrameStylePane();
frameStylePane.setPreferredSize(new Dimension(233, 183));
frameStylePane.setPreferredSize(new Dimension(233, 225));
frame.add(frameStylePane);
JPanel title = FRGUIPaneFactory.createTitledBorderNoGapPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title"));
titleStylePane = ComponentTitleStylePane.createStyleSettingPane();
titleStylePane.setPreferredSize(new Dimension(233, 140));
titleStylePane.setPreferredSize(new Dimension(233, 220));
title.add(titleStylePane);
JPanel margin = FRGUIPaneFactory.createTitledBorderNoGapPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Base_Margin"));
marginStylePane = new ComponentMarginStylePane();
marginStylePane.setPreferredSize(new Dimension(233, 100));
margin.add(marginStylePane);
this.add(frame, BorderLayout.NORTH);
this.add(title, BorderLayout.CENTER);
this.add(margin, BorderLayout.SOUTH);
}
@Override
public void populateBean(ComponentStyle ob) {
public void populateBean(NameLayoutBorderStyle ob) {
PredefinedComponentStyle componentStyle = new PredefinedComponentStyle();
componentStyle.setBorderStyle(ob.getNameLayoutBorderStyle().createRealStyle());
PaddingMargin margin = ob.getNamePaddingMargin().createRealStyle();
componentStyle.setTop(margin.getTop());
componentStyle.setBottom(margin.getBottom());
componentStyle.setLeft(margin.getLeft());
componentStyle.setRight(margin.getRight());
componentStyle.setBorderStyle(ob.createRealStyle());
frameStylePane.populate(componentStyle);
titleStylePane.populate(componentStyle);
marginStylePane.populate(componentStyle);
}
@Override
public ComponentStyle updateBean() {
public NameLayoutBorderStyle updateBean() {
PredefinedComponentStyle componentStyle = update();
NameLayoutBorderStyle nameLayoutBorderStyle = NameLayoutBorderStyle.createCustomStyle(componentStyle.getBorderStyle());
NamePaddingMargin namePaddingMargin = NamePaddingMargin.createCustomStyle(
new PaddingMargin(componentStyle.getTop(), componentStyle.getLeft(), componentStyle.getBottom(), componentStyle.getRight()));
return new ComponentStyle(nameLayoutBorderStyle, namePaddingMargin);
return nameLayoutBorderStyle;
}
public PredefinedComponentStyle update() {
PredefinedComponentStyle componentStyle = new PredefinedComponentStyle();
frameStylePane.update(componentStyle);
titleStylePane.update(componentStyle);
marginStylePane.update(componentStyle);
return componentStyle;
}
@ -159,9 +136,8 @@ public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingP
}
public void refresh() {
ComponentStyle componentStyle = PredefinedComponentStyleSettingPane.this.updateBean();
NameLayoutBorderStyle borderStyle = componentStyle.getNameLayoutBorderStyle();
this.layoutBorderPreviewPane.repaint((LayoutBorderStyle) borderStyle.createRealStyle());
NameLayoutBorderStyle componentStyle = PredefinedComponentStyleSettingPane.this.updateBean();
this.layoutBorderPreviewPane.repaint((LayoutBorderStyle) componentStyle.createRealStyle());
}
}

6
designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyBackgroundEditor.java

@ -8,7 +8,7 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.xpane.FormPredefinedBackgroundPane;
import com.fr.design.mainframe.widget.editors.ITextComponent;
import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer;
import com.fr.form.ui.NameFormBackground;
import com.fr.form.ui.NameComponentBackground;
import javax.swing.SwingUtilities;
import java.awt.Dimension;
@ -43,7 +43,7 @@ public class AccessibleBodyBackgroundEditor extends UneditableAccessibleEditor {
fireStateChanged();
}
});
backgroundPane.populateBean((NameFormBackground) getValue());
backgroundPane.populateBean((NameComponentBackground) getValue());
dlg.setVisible(true);
}
@ -62,7 +62,7 @@ public class AccessibleBodyBackgroundEditor extends UneditableAccessibleEditor {
if (v == null) {
return null;
}
NameFormBackground style = (NameFormBackground) v;
NameComponentBackground style = (NameComponentBackground) v;
return style.usePredefinedStyle() ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Predefined")
: com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom");
}

6
designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBorderStyleEditor.java

@ -8,7 +8,7 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.xpane.PredefinedComponentStyleSettingPane;
import com.fr.design.mainframe.widget.editors.ITextComponent;
import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer;
import com.fr.design.widget.ui.designer.layout.ComponentStyle;
import com.fr.form.ui.NameLayoutBorderStyle;
import javax.swing.SwingUtilities;
import java.awt.Dimension;
@ -43,7 +43,7 @@ public class AccessibleBorderStyleEditor extends UneditableAccessibleEditor {
fireStateChanged();
}
});
borderPane.populateBean((ComponentStyle) getValue());
borderPane.populateBean((NameLayoutBorderStyle) getValue());
dlg.setVisible(true);
}
@ -63,7 +63,7 @@ public class AccessibleBorderStyleEditor extends UneditableAccessibleEditor {
if (v == null) {
return null;
}
ComponentStyle style = (ComponentStyle) v;
NameLayoutBorderStyle style = (NameLayoutBorderStyle) v;
return style.usePredefinedStyle() ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Predefined") :
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Custom");
}

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

@ -10,6 +10,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleBorderStyleEditor;
import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.form.ui.AbstractBorderStyleWidget;
import com.fr.form.ui.NameLayoutBorderStyle;
import javax.swing.*;
@ -49,17 +50,15 @@ public class BorderStyleWidgetDefinePane extends AbstractDataModify<AbstractBord
@Override
public void populateBean(AbstractBorderStyleWidget ob) {
ComponentStyle componentStyle = new ComponentStyle(ob.getNameBorderStyle(), ob.getNameMargin());
borderStyleEditor.setValue(componentStyle);
borderStyleEditor.setValue(ob.getNameBorderStyle());
}
@Override
public AbstractBorderStyleWidget updateBean() {
AbstractBorderStyleWidget abstractBorderStyleWidget = (AbstractBorderStyleWidget)creator.toData();
ComponentStyle componentStyle = (ComponentStyle) borderStyleEditor.getValue();
abstractBorderStyleWidget.setNameBorderStyle(componentStyle.getNameLayoutBorderStyle());
abstractBorderStyleWidget.setNameMargin(componentStyle.getNamePaddingMargin());
NameLayoutBorderStyle componentStyle = (NameLayoutBorderStyle) borderStyleEditor.getValue();
abstractBorderStyleWidget.setNameBorderStyle(componentStyle);
return abstractBorderStyleWidget;
}

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

@ -1,35 +0,0 @@
package com.fr.design.widget.ui.designer.layout;
import com.fr.config.AbstractPredefinedNameStyleProvider;
import com.fr.form.ui.NameLayoutBorderStyle;
import com.fr.form.ui.NamePaddingMargin;
/**
* Created by kerry on 2020-09-02
*/
public class ComponentStyle extends AbstractPredefinedNameStyleProvider {
private NamePaddingMargin namePaddingMargin;
private NameLayoutBorderStyle nameLayoutBorderStyle;
public ComponentStyle(NameLayoutBorderStyle nameLayoutBorderStyle, NamePaddingMargin namePaddingMargin) {
this.nameLayoutBorderStyle = nameLayoutBorderStyle;
this.namePaddingMargin = namePaddingMargin;
}
public NamePaddingMargin getNamePaddingMargin() {
return namePaddingMargin;
}
public NameLayoutBorderStyle getNameLayoutBorderStyle() {
return nameLayoutBorderStyle;
}
public boolean usePredefinedStyle() {
return this.nameLayoutBorderStyle.usePredefinedStyle();
}
}

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

@ -6,8 +6,11 @@ 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.AccessibleElementCaseToolBarEditor;
import com.fr.design.widget.ui.designer.component.PaddingBoundPane;
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;
@ -17,6 +20,7 @@ import java.awt.Component;
* Created by ibm on 2017/8/7.
*/
public class ElementEditorDefinePane extends WTitleLayoutDefinePane<ElementCaseEditor> {
private PaddingBoundPane paddingBoundPane;
private AccessibleElementCaseToolBarEditor elementCaseToolBarEditor;
private PropertyGroupPane extraPropertyGroupPane;
@ -27,8 +31,10 @@ public class ElementEditorDefinePane extends WTitleLayoutDefinePane<ElementCaseE
protected JPanel createCenterPane() {
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
paddingBoundPane = new PaddingBoundPane();
elementCaseToolBarEditor = new AccessibleElementCaseToolBarEditor();
Component[][] components = new Component[][]{
new Component[]{paddingBoundPane, null},
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);
@ -44,12 +50,16 @@ public class ElementEditorDefinePane extends WTitleLayoutDefinePane<ElementCaseE
protected ElementCaseEditor updateSubBean() {
ElementCaseEditor elementCaseEditor = (ElementCaseEditor) creator.toData();
if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout_Padding_Duplicate"))) {
paddingBoundPane.update(elementCaseEditor);
}
elementCaseEditor.setToolBars((FormToolBarManager[]) elementCaseToolBarEditor.getValue());
return elementCaseEditor;
}
protected void populateSubBean(ElementCaseEditor ob) {
paddingBoundPane.populate(ob);
elementCaseToolBarEditor.setValue(ob.getToolBars());
if (extraPropertyGroupPane != null) {
extraPropertyGroupPane.populate(ob);

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

@ -8,6 +8,7 @@ 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;
@ -21,7 +22,7 @@ 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.NameFormBackground;
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;
@ -114,7 +115,7 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
public void populateSubPane(WAbsoluteLayout ob) {
layoutCombox.setSelectedIndex(1);
NameFormBackground formBackground = ob.getNameBackground();
NameComponentBackground formBackground = ob.getNameBackground();
backgroundEditor.setValue(formBackground);
boundPane.populate();
@ -135,12 +136,14 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
((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());
}
}
LayoutBorderStyle borderStyle = new LayoutBorderStyle();
NameFormBackground background = (NameFormBackground) backgroundEditor.getValue();
NameComponentBackground background = (NameComponentBackground) backgroundEditor.getValue();
updateBodyBackground(background, borderStyle);
layout.setBorderStyle(borderStyle);
layout.setNameBackground(background);
@ -148,7 +151,7 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
return layout;
}
private void updateBodyBackground(NameFormBackground background, LayoutBorderStyle borderStyle) {
private void updateBodyBackground(NameComponentBackground background, LayoutBorderStyle borderStyle) {
if (background != null) {
borderStyle.setBackground(background.createRealStyle().getBackground());
borderStyle.setAlpha(background.getBackgroundAlphaValue());

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

@ -29,7 +29,7 @@ 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.NameFormBackground;
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;
@ -156,7 +156,7 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue());
adaptComboBox.setSelectedIndex(ob.getCompState());
componentIntervel.setValue(ob.getCompInterval());
NameFormBackground formBackground = ob.getNameBackground();
NameComponentBackground formBackground = ob.getNameBackground();
stylePane.setValue(formBackground);
watermarkEditor.setValue(ReportUtils.getWatermarkAttrFromTemplate(getCurrentIOFile()));
}
@ -177,7 +177,7 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
paddingBound.update(layout);
}
LayoutBorderStyle borderStyle = new LayoutBorderStyle();
NameFormBackground background = (NameFormBackground) stylePane.getValue();
NameComponentBackground background = (NameComponentBackground) stylePane.getValue();
updateBodyBackground(background, borderStyle);
layout.setBorderStyle(borderStyle);
layout.setNameBackground(background);
@ -200,7 +200,6 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
Component[] components = xWFitLayout.getComponents();
xWFitLayout.removeAll();
layout.resetStyle();
layout.setNameBackground(NameFormBackground.createPredefinedStyle(predefinedName));
XWAbsoluteBodyLayout xwAbsoluteBodyLayout = xWFitLayout.getBackupParent() == null ? new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0)) : (XWAbsoluteBodyLayout) xWFitLayout.getBackupParent();
xwAbsoluteBodyLayout.initWidgetPredefinedInfo(predefinedName);
xWFitLayout.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0);
@ -235,7 +234,7 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
return layout;
}
private void updateBodyBackground(NameFormBackground background, LayoutBorderStyle borderStyle) {
private void updateBodyBackground(NameComponentBackground background, LayoutBorderStyle borderStyle) {
if (background != null) {
borderStyle.setBackground(background.createRealStyle().getBackground());
borderStyle.setAlpha(background.getBackgroundAlphaValue());

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

@ -10,6 +10,8 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleBorderStyleEditor;
import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.form.ui.AbstractBorderStyleWidget;
import com.fr.form.ui.NameLayoutBorderStyle;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
@ -65,17 +67,15 @@ public abstract class WTitleLayoutDefinePane<T extends AbstractBorderStyleWidget
@Override
public void populateBean(T ob) {
populateSubBean(ob);
ComponentStyle componentStyle = new ComponentStyle(ob.getNameBorderStyle(), ob.getNameMargin());
borderStyleEditor.setValue(componentStyle);
borderStyleEditor.setValue(ob.getNameBorderStyle());
}
@Override
public T updateBean() {
T e = updateSubBean();
ComponentStyle componentStyle = (ComponentStyle) borderStyleEditor.getValue();
e.setNameBorderStyle(componentStyle.getNameLayoutBorderStyle());
e.setNameMargin(componentStyle.getNamePaddingMargin());
NameLayoutBorderStyle componentStyle = (NameLayoutBorderStyle) borderStyleEditor.getValue();
e.setNameBorderStyle(componentStyle);
return e;
}

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

@ -7,9 +7,7 @@ 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.ServerPreferenceConfig;
import com.fr.config.predefined.PredefinedStyle;
import com.fr.config.predefined.PredefinedStyleConfig;
import com.fr.design.actions.SelectionListenerAction;
import com.fr.design.actions.UpdateAction;
import com.fr.design.file.HistoryTemplateListCache;
@ -21,6 +19,7 @@ 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;
@ -76,18 +75,15 @@ public class GlobalStyleMenuDef extends MenuDef {
public void updateMenu() {
UIMenu createdMenu = this.createJMenu();
createdMenu.removeAll();
PredefinedStyleConfig config = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig();
String styleName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle();
PredefinedStyle currentStyle = config.getStyle(styleName);
if (currentStyle != null) {
Iterator iterator = config.getStyle(styleName).getCellStyleConfig().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();
useMenuItem.setNameStyle(nameStyle);
createdMenu.add(useMenuItem);
}
PredefinedStyle currentStyle = PredefinedPatternStyleManager.INSTANCE.getStyleFromName(styleName);
Iterator iterator = currentStyle.getCellStyleConfig().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();
useMenuItem.setNameStyle(nameStyle);
createdMenu.add(useMenuItem);
}
createdMenu.addSeparator();
createdMenu.add(new CustomStyleAction(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Custom")));

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

@ -7,6 +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.general.IOUtils;
import javax.swing.KeyStroke;
@ -20,6 +21,7 @@ public class ServerPredefinedStyleAction extends SnapChatUpdateAction {
public ServerPredefinedStyleAction(SnapChatKey uniqueKey) {
super(uniqueKey);
this.setEnabled(DesignUtils.checkDesignerRemoteVersion());
this.setMenuKeySet(PREDEFINED_STYLES);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());

4
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java

@ -6,7 +6,7 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.cell.settingpane.style.CellPredefinedStyleSettingPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.DefaultPredefinedTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
@ -66,7 +66,7 @@ public class CellStylePane extends AbstractCellAttrPane {
int row = j + cellRectangle.y;
TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row);
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(column, row);
cellElement = new DefaultPredefinedTemplateCellElement(column, row);
elementCase.addCellElement(cellElement);
}
cellElement.setStyle(s);

6
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java

@ -6,7 +6,6 @@ import com.fr.base.Style;
import com.fr.config.predefined.PredefinedCellStyle;
import com.fr.config.predefined.PredefinedCellStyleConfig;
import com.fr.config.predefined.PredefinedStyle;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.IntervalConstants;
@ -27,6 +26,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.stable.Constants;
import com.fr.stable.StringUtils;
@ -87,8 +87,8 @@ public class CellPredefinedStyleSettingPane extends PredefinedStyleSettingPane<N
super.populate(ob);
JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
String styleName = template.getTemplatePredefinedStyle();
PredefinedStyle predefinedStyle = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig().getStyle(styleName);
PredefinedCellStyleConfig config = predefinedStyle.getCellStyleConfig();
PredefinedStyle currentStyle = PredefinedPatternStyleManager.INSTANCE.getStyleFromName(styleName);
PredefinedCellStyleConfig config = currentStyle.getCellStyleConfig();
Map<String, PredefinedCellStyle> allStyle = config.getAllStyles();
this.applicationFormat.clearBoxItems();
for (String name : allStyle.keySet()) {

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

@ -7,6 +7,7 @@ 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;
@ -14,6 +15,7 @@ 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;
@ -511,10 +513,13 @@ public abstract class BorderUtils {
for (int j = row; j < row + rowSpan; j++) {
TemplateCellElement tmpCellElement = report.getTemplateCellElement(i, j);
if (tmpCellElement == null) {
tmpCellElement = new DefaultTemplateCellElement(i, j);
tmpCellElement = new DefaultPredefinedTemplateCellElement(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);
}
@ -675,4 +680,4 @@ public abstract class BorderUtils {
return false;
}
}
}
}

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

@ -9,7 +9,6 @@ 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.config.predefined.PredefinedStyleConfig;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.cell.CellAttributeAction;
import com.fr.design.actions.cell.CellExpandAttrAction;
@ -45,6 +44,7 @@ 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,19 +480,16 @@ 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"));
PredefinedStyleConfig config = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig();
String styleName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle();
PredefinedStyle currentStyle = config.getStyle(styleName);
if (currentStyle != null) {
Iterator iterator = config.getStyle(styleName).getCellStyleConfig().getStyleNameIterator();
while (iterator.hasNext()) {
String name = (String) iterator.next();
name = GlobalStyleMenuDef.judgeChina(name);
NameStyle nameStyle = NameStyle.createPredefinedStyle(styleName, name, Style.getInstance());
UpdateAction.UseMenuItem useMenuItem = new GlobalStyleSelection(ePane, nameStyle).createUseMenuItem();
useMenuItem.setNameStyle(nameStyle);
styleMenu.add(useMenuItem);
}
PredefinedStyle currentStyle = PredefinedPatternStyleManager.INSTANCE.getStyleFromName(styleName);
Iterator iterator = currentStyle.getCellStyleConfig().getStyleNameIterator();
while (iterator.hasNext()) {
String name = (String) iterator.next();
name = GlobalStyleMenuDef.judgeChina(name);
NameStyle nameStyle = NameStyle.createPredefinedStyle(styleName, name, Style.getInstance());
UpdateAction.UseMenuItem useMenuItem = new GlobalStyleSelection(ePane, nameStyle).createUseMenuItem();
useMenuItem.setNameStyle(nameStyle);
styleMenu.add(useMenuItem);
}
styleMenu.addSeparator();
styleMenu.add(new GlobalStyleMenuDef.CustomStyleAction(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom")));

Loading…
Cancel
Save