Browse Source

REPORT-35149【10.0.11】预定义样式优化及与图表统一

research/11.0
kerry 4 years ago
parent
commit
8afa1b4ae9
  1. 5
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  2. 4
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java
  3. 6
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ComponentStyleSettingPane.java
  4. 2
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/GradientDetailPane.java
  5. 10
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/PatternDetailPane.java
  6. 2
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/dialog/PredefinedStyleEditDialog.java
  7. 10
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/dialog/ReportPredefinedStyleDialog.java
  8. 24
      designer-base/src/main/java/com/fr/design/utils/DesignUtils.java
  9. 7
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  10. 10
      designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java
  11. 9
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java
  12. 11
      designer-form/src/main/java/com/fr/design/gui/xpane/FormPredefinedBackgroundPane.java
  13. 54
      designer-form/src/main/java/com/fr/design/gui/xpane/PredefinedComponentStyleSettingPane.java
  14. 6
      designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyBackgroundEditor.java
  15. 6
      designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBorderStyleEditor.java
  16. 9
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/BorderStyleWidgetDefinePane.java
  17. 35
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/ComponentStyle.java
  18. 10
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java
  19. 11
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java
  20. 9
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  21. 10
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java
  22. 22
      designer-realize/src/main/java/com/fr/design/actions/cell/GlobalStyleMenuDef.java
  23. 2
      designer-realize/src/main/java/com/fr/design/actions/server/predefined/ServerPredefinedStyleAction.java
  24. 4
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java
  25. 6
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java
  26. 9
      designer-realize/src/main/java/com/fr/design/style/BorderUtils.java
  27. 23
      designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

5
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.NameSeparator;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.preview.PagePreview; 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.DBManipulationInWidgetEventPane;
import com.fr.design.write.submit.DBManipulationPane; import com.fr.design.write.submit.DBManipulationPane;
import com.fr.file.FILE; import com.fr.file.FILE;
@ -77,7 +78,6 @@ import com.fr.stable.StringUtils;
import com.fr.stable.core.UUID; import com.fr.stable.core.UUID;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.server.lock.TplOperator; import com.fr.workspace.server.lock.TplOperator;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JComponent; import javax.swing.JComponent;
@ -1339,9 +1339,12 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
} }
}); });
preferenceButton.setEnabled(DesignUtils.checkDesignerRemoteVersion());
return preferenceButton; return preferenceButton;
} }
private void setPredefinedButtonSize(UIButton predefinedBtn) { private void setPredefinedButtonSize(UIButton predefinedBtn) {
String text = predefinedBtn.getText(); String text = predefinedBtn.getText();
FontMetrics metrics = predefinedBtn.getFontMetrics(predefinedBtn.getFont()); FontMetrics metrics = predefinedBtn.getFontMetrics(predefinedBtn.getFont());

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); PredefinedStyleEditPane editPane = PredefinedStyleEditPane.createNewEditPane(selectPane);
PredefinedStyleEditDialog editDialog = new PredefinedStyleEditDialog( PredefinedStyleEditDialog editDialog = new PredefinedStyleEditDialog(
SwingUtilities.getWindowAncestor(ServerPredefinedStylePane.this), editPane); SwingUtilities.getWindowAncestor(ServerPredefinedStylePane.this), editPane);
editPane.populate(style.getPredefinedStyle()); PredefinedStyle predefinedStyle = style.getPredefinedStyle();
predefinedStyle.setStyleName(StringUtils.EMPTY);
editPane.populate(predefinedStyle);
editDialog.setVisible(true); 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.BasicPane;
import com.fr.design.dialog.MultiTabPane; 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.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.detail.component.ComponentTitleStylePane;
import java.util.ArrayList; import java.util.ArrayList;
@ -16,7 +15,6 @@ import java.util.List;
public class ComponentStyleSettingPane extends MultiTabPane<PredefinedComponentStyle> { public class ComponentStyleSettingPane extends MultiTabPane<PredefinedComponentStyle> {
private ComponentFrameStylePane frameStylePane; private ComponentFrameStylePane frameStylePane;
private ComponentTitleStylePane titleStylePane; private ComponentTitleStylePane titleStylePane;
private ComponentMarginStylePane marginStylePane;
public ComponentStyleSettingPane() { public ComponentStyleSettingPane() {
} }
@ -26,11 +24,9 @@ public class ComponentStyleSettingPane extends MultiTabPane<PredefinedComponentS
protected List<BasicPane> initPaneList() { protected List<BasicPane> initPaneList() {
this.frameStylePane = new ComponentFrameStylePane(); this.frameStylePane = new ComponentFrameStylePane();
this.titleStylePane = ComponentTitleStylePane.createPredefinedSettingPane(); this.titleStylePane = ComponentTitleStylePane.createPredefinedSettingPane();
this.marginStylePane = new ComponentMarginStylePane();
paneList = new ArrayList<BasicPane>(); paneList = new ArrayList<BasicPane>();
paneList.add(this.frameStylePane); paneList.add(this.frameStylePane);
paneList.add(this.titleStylePane); paneList.add(this.titleStylePane);
paneList.add(this.marginStylePane);
return paneList; return paneList;
} }
@ -38,7 +34,6 @@ public class ComponentStyleSettingPane extends MultiTabPane<PredefinedComponentS
public void populateBean(PredefinedComponentStyle ob) { public void populateBean(PredefinedComponentStyle ob) {
this.frameStylePane.populate(ob); this.frameStylePane.populate(ob);
this.titleStylePane.populate(ob); this.titleStylePane.populate(ob);
this.marginStylePane.populate(ob);
} }
@Override @Override
@ -52,7 +47,6 @@ public class ComponentStyleSettingPane extends MultiTabPane<PredefinedComponentS
PredefinedComponentStyle componentStyle = new PredefinedComponentStyle(); PredefinedComponentStyle componentStyle = new PredefinedComponentStyle();
this.frameStylePane.update(componentStyle); this.frameStylePane.update(componentStyle);
this.titleStylePane.update(componentStyle); this.titleStylePane.update(componentStyle);
this.marginStylePane.update(componentStyle);
return 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 gradientPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel blankJp = new JPanel(); JPanel blankJp = new JPanel();
gradientBar = new GradientBar(4, 145); gradientBar = new GradientBar(4, 140);
blankJp.add(gradientBar); blankJp.add(gradientBar);
gradientPanel.add(gradientBar, BorderLayout.SOUTH); 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.base.background.PatternBackground;
import com.fr.design.designer.IntervalConstants; 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.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -106,14 +104,8 @@ public class PatternDetailPane extends AbstractBackgroundDetailPane<PatternBackg
IntervalConstants.INTERVAL_W4, IntervalConstants.INTERVAL_L1); IntervalConstants.INTERVAL_W4, IntervalConstants.INTERVAL_L1);
JPanel jPanel1 = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); JPanel jPanel1 = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
jPanel1.add(centerPane); jPanel1.add(centerPane);
BasicScrollPane basicScrollPane = new AttrScrollPane() {
@Override
protected JPanel createContentPane() {
return jPanel1;
}
};
jPanel1.setBorder(BorderFactory.createEmptyBorder()); jPanel1.setBorder(BorderFactory.createEmptyBorder());
this.add(basicScrollPane, BorderLayout.NORTH); this.add(jPanel1, BorderLayout.NORTH);
this.addChangeListener(new ChangeListener() { this.addChangeListener(new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { 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); 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.ReportPredefinedStylePane;
import com.fr.design.mainframe.predefined.ui.ServerPredefinedStylePane; import com.fr.design.mainframe.predefined.ui.ServerPredefinedStylePane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.workspace.WorkContext;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -63,9 +64,12 @@ public class ReportPredefinedStyleDialog extends JDialog {
} }
}); });
JPanel southPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel southPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel buttonPanel1 = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
buttonPanel1.add(managerBtn); if (WorkContext.getCurrent().isRoot()){
southPane.add(buttonPanel1, BorderLayout.CENTER); JPanel buttonPanel1 = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
buttonPanel1.add(managerBtn);
southPane.add(buttonPanel1, BorderLayout.CENTER);
}
JPanel buttonPanel2 = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); JPanel buttonPanel2 = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
buttonPanel2.add(settingBtn); 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.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.fun.DesignerEnvProcessor; import com.fr.design.fun.DesignerEnvProcessor;
import com.fr.design.gui.UILookAndFeel; import com.fr.design.gui.UILookAndFeel;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
@ -14,6 +15,7 @@ import com.fr.file.FileFILE;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.GeneralUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.CommonCodeUtils; import com.fr.stable.CommonCodeUtils;
@ -22,7 +24,8 @@ import com.fr.stable.StringUtils;
import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.OperatingSystem;
import com.fr.start.ServerStarter; import com.fr.start.ServerStarter;
import com.fr.workspace.WorkContext; 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.SwingUtilities;
import javax.swing.UIManager; import javax.swing.UIManager;
import java.awt.Desktop; import java.awt.Desktop;
@ -404,4 +407,23 @@ public class DesignUtils {
public static boolean sendFeedBack(FeedBackInfo feedBackInfo) throws Exception { public static boolean sendFeedBack(FeedBackInfo feedBackInfo) throws Exception {
return true; 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.mainframe.widget.editors.WLayoutBorderStyleEditor;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
import com.fr.form.ui.BaseChartEditor; import com.fr.form.ui.BaseChartEditor;
import com.fr.form.ui.NameComponentBackground;
import com.fr.form.ui.NameLayoutBorderStyle; import com.fr.form.ui.NameLayoutBorderStyle;
import com.fr.form.ui.NamePaddingMargin;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
@ -230,6 +230,7 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
* 渲染Painter * 渲染Painter
*/ */
public void paint(Graphics g) { public void paint(Graphics g) {
initBorderStyle();
designerEditor.paintEditor(g, this.getSize()); designerEditor.paintEditor(g, this.getSize());
if (coverPanel != null) { if (coverPanel != null) {
coverPanel.setSize(this.getSize()); coverPanel.setSize(this.getSize());
@ -368,10 +369,10 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
* 初始化组件的预定义信息 * 初始化组件的预定义信息
*/ */
public void initWidgetPredefinedInfo(String styleName){ public void initWidgetPredefinedInfo(String styleName){
this.toData().setNameMargin(NamePaddingMargin.createPredefinedStyle(styleName));
this.toData().setNameBorderStyle(NameLayoutBorderStyle.createPredefinedStyle(styleName)); this.toData().setNameBorderStyle(NameLayoutBorderStyle.createPredefinedStyle(styleName));
this.toData().setNameBackground(NameComponentBackground.createPredefinedStyle(styleName));
initBorderStyle(); 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.ElementCaseEditor;
import com.fr.form.ui.ElementCaseEditorProvider; import com.fr.form.ui.ElementCaseEditorProvider;
import com.fr.form.ui.NameComponentBackground;
import com.fr.form.ui.NameLayoutBorderStyle; import com.fr.form.ui.NameLayoutBorderStyle;
import com.fr.form.ui.NamePaddingMargin;
import com.fr.report.fit.ReportFitAttr; import com.fr.report.fit.ReportFitAttr;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.CoreGraphHelper; import com.fr.stable.CoreGraphHelper;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.report.fit.FitProvider; import com.fr.report.fit.FitProvider;
@ -379,10 +378,15 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
* 初始化组件的预定义信息 * 初始化组件的预定义信息
*/ */
public void initWidgetPredefinedInfo(String styleName){ public void initWidgetPredefinedInfo(String styleName){
this.toData().setNameMargin(NamePaddingMargin.createPredefinedStyle(styleName));
this.toData().setNameBorderStyle(NameLayoutBorderStyle.createPredefinedStyle(styleName)); this.toData().setNameBorderStyle(NameLayoutBorderStyle.createPredefinedStyle(styleName));
this.toData().setNameBackground(NameComponentBackground.createPredefinedStyle(styleName));
initBorderStyle(); 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.XCreator;
import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWFitLayout; 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.form.util.XCreatorConstants;
import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormHierarchyTreePane; 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.ButtonTypeEditor;
import com.fr.design.mainframe.widget.editors.ImgBackgroundEditor; import com.fr.design.mainframe.widget.editors.ImgBackgroundEditor;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.CardSwitchButton; 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.WAbsoluteLayout.BoundsWidget;
import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.form.ui.container.cardlayout.WTabFitLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.border.Border; import javax.swing.border.Border;
@ -652,7 +647,7 @@ public class XWTabFitLayout extends XWFitLayout {
* 初始化组件的预定义信息 * 初始化组件的预定义信息
*/ */
public void initWidgetPredefinedInfo(String styleName){ 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.PredefinedStyleSettingPane;
import com.fr.design.mainframe.predefined.ui.detail.background.BackgroundWithAlphaSettingPane; import com.fr.design.mainframe.predefined.ui.detail.background.BackgroundWithAlphaSettingPane;
import com.fr.design.mainframe.predefined.ui.preview.StyleSettingPreviewPane; import com.fr.design.mainframe.predefined.ui.preview.StyleSettingPreviewPane;
import com.fr.form.ui.NameComponentBackground;
import com.fr.form.ui.NameFormBackground; import com.fr.form.ui.NameFormBackground;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -19,7 +20,7 @@ import java.awt.geom.Rectangle2D;
/** /**
* Created by kerry on 2020-09-02 * Created by kerry on 2020-09-02
*/ */
public class FormPredefinedBackgroundPane extends PredefinedStyleSettingPane<NameFormBackground> { public class FormPredefinedBackgroundPane extends PredefinedStyleSettingPane<NameComponentBackground> {
private BackgroundWithAlphaSettingPane backgroundPane; private BackgroundWithAlphaSettingPane backgroundPane;
@Override @Override
@ -42,7 +43,7 @@ public class FormPredefinedBackgroundPane extends PredefinedStyleSettingPane<Nam
} }
@Override @Override
public void populateBean(NameFormBackground ob) { public void populateBean(NameComponentBackground ob) {
this.setPopulating(true); this.setPopulating(true);
super.populate(ob); super.populate(ob);
this.backgroundPane.populateBean(ob.createRealStyle()); this.backgroundPane.populateBean(ob.createRealStyle());
@ -52,7 +53,7 @@ public class FormPredefinedBackgroundPane extends PredefinedStyleSettingPane<Nam
@Override @Override
public NameFormBackground updateBean() { public NameComponentBackground updateBean() {
if (this.predefinedRadioBtn.isSelected()) { if (this.predefinedRadioBtn.isSelected()) {
return NameFormBackground.createPredefinedStyle(getPredefinedStyleName()); return NameFormBackground.createPredefinedStyle(getPredefinedStyleName());
} else { } else {
@ -62,8 +63,8 @@ public class FormPredefinedBackgroundPane extends PredefinedStyleSettingPane<Nam
private BackgroundWithAlpha getCurrentValue() { private BackgroundWithAlpha getCurrentValue() {
if (this.predefinedRadioBtn.isSelected()) { if (this.predefinedRadioBtn.isSelected()) {
NameFormBackground nameFormBackground = NameFormBackground.createPredefinedStyle(getPredefinedStyleName()); NameComponentBackground componentBackground = NameFormBackground.createPredefinedStyle(getPredefinedStyleName());
return nameFormBackground.createRealStyle(); return componentBackground.createRealStyle();
} else { } else {
return this.backgroundPane.updateBean(); 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.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.predefined.ui.PredefinedStyleSettingPane; 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.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.detail.component.ComponentTitleStylePane;
import com.fr.design.mainframe.predefined.ui.preview.StyleSettingPreviewPane; 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.LayoutBorderStyle;
import com.fr.form.ui.NameLayoutBorderStyle; import com.fr.form.ui.NameLayoutBorderStyle;
import com.fr.form.ui.NamePaddingMargin;
import com.fr.form.ui.PaddingMargin;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension; import java.awt.Dimension;
@ -23,7 +19,7 @@ import java.awt.FlowLayout;
/** /**
* Created by kerry on 2020-09-02 * Created by kerry on 2020-09-02
*/ */
public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingPane<ComponentStyle> { public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingPane<NameLayoutBorderStyle> {
private StyleSettingPane styleSettingPane; private StyleSettingPane styleSettingPane;
private TinyFormulaPane formulaPane; private TinyFormulaPane formulaPane;
@ -52,11 +48,10 @@ public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingP
} }
@Override @Override
public void populateBean(ComponentStyle ob) { public void populateBean(NameLayoutBorderStyle ob) {
this.setPopulating(true); this.setPopulating(true);
NameLayoutBorderStyle layoutBorderStyle = ob.getNameLayoutBorderStyle(); super.populate(ob);
super.populate(layoutBorderStyle); this.formulaPane.populateBean(ob.getTitleText().toString());
this.formulaPane.populateBean(layoutBorderStyle.getTitleText().toString());
styleSettingPane.populateBean(ob); styleSettingPane.populateBean(ob);
this.previewPane.refresh(); this.previewPane.refresh();
this.setPopulating(false); this.setPopulating(false);
@ -64,12 +59,11 @@ public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingP
@Override @Override
public ComponentStyle updateBean() { public NameLayoutBorderStyle updateBean() {
if (predefinedRadioBtn.isSelected()) { if (predefinedRadioBtn.isSelected()) {
NameLayoutBorderStyle layoutBorderStyle = NameLayoutBorderStyle.createPredefinedStyle(getPredefinedStyleName()); NameLayoutBorderStyle layoutBorderStyle = NameLayoutBorderStyle.createPredefinedStyle(getPredefinedStyleName());
layoutBorderStyle.setTitleText(formulaPane.updateBean()); layoutBorderStyle.setTitleText(formulaPane.updateBean());
return new ComponentStyle(layoutBorderStyle, return layoutBorderStyle;
NamePaddingMargin.createPredefinedStyle(getPredefinedStyleName()));
} }
return styleSettingPane.updateBean(); return styleSettingPane.updateBean();
} }
@ -79,10 +73,9 @@ public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingP
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Style"); 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 ComponentFrameStylePane frameStylePane;
private ComponentTitleStylePane titleStylePane; private ComponentTitleStylePane titleStylePane;
private ComponentMarginStylePane marginStylePane;
public StyleSettingPane() { public StyleSettingPane() {
initPane(); initPane();
@ -92,53 +85,37 @@ public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingP
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel frame = FRGUIPaneFactory.createTitledBorderNoGapPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Frame")); JPanel frame = FRGUIPaneFactory.createTitledBorderNoGapPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Frame"));
frameStylePane = new ComponentFrameStylePane(); frameStylePane = new ComponentFrameStylePane();
frameStylePane.setPreferredSize(new Dimension(233, 183)); frameStylePane.setPreferredSize(new Dimension(233, 225));
frame.add(frameStylePane); frame.add(frameStylePane);
JPanel title = FRGUIPaneFactory.createTitledBorderNoGapPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title")); JPanel title = FRGUIPaneFactory.createTitledBorderNoGapPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title"));
titleStylePane = ComponentTitleStylePane.createStyleSettingPane(); titleStylePane = ComponentTitleStylePane.createStyleSettingPane();
titleStylePane.setPreferredSize(new Dimension(233, 140)); titleStylePane.setPreferredSize(new Dimension(233, 220));
title.add(titleStylePane); 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(frame, BorderLayout.NORTH);
this.add(title, BorderLayout.CENTER); this.add(title, BorderLayout.CENTER);
this.add(margin, BorderLayout.SOUTH);
} }
@Override @Override
public void populateBean(ComponentStyle ob) { public void populateBean(NameLayoutBorderStyle ob) {
PredefinedComponentStyle componentStyle = new PredefinedComponentStyle(); PredefinedComponentStyle componentStyle = new PredefinedComponentStyle();
componentStyle.setBorderStyle(ob.getNameLayoutBorderStyle().createRealStyle()); componentStyle.setBorderStyle(ob.createRealStyle());
PaddingMargin margin = ob.getNamePaddingMargin().createRealStyle();
componentStyle.setTop(margin.getTop());
componentStyle.setBottom(margin.getBottom());
componentStyle.setLeft(margin.getLeft());
componentStyle.setRight(margin.getRight());
frameStylePane.populate(componentStyle); frameStylePane.populate(componentStyle);
titleStylePane.populate(componentStyle); titleStylePane.populate(componentStyle);
marginStylePane.populate(componentStyle);
} }
@Override @Override
public ComponentStyle updateBean() { public NameLayoutBorderStyle updateBean() {
PredefinedComponentStyle componentStyle = update(); PredefinedComponentStyle componentStyle = update();
NameLayoutBorderStyle nameLayoutBorderStyle = NameLayoutBorderStyle.createCustomStyle(componentStyle.getBorderStyle()); NameLayoutBorderStyle nameLayoutBorderStyle = NameLayoutBorderStyle.createCustomStyle(componentStyle.getBorderStyle());
NamePaddingMargin namePaddingMargin = NamePaddingMargin.createCustomStyle( return nameLayoutBorderStyle;
new PaddingMargin(componentStyle.getTop(), componentStyle.getLeft(), componentStyle.getBottom(), componentStyle.getRight()));
return new ComponentStyle(nameLayoutBorderStyle, namePaddingMargin);
} }
public PredefinedComponentStyle update() { public PredefinedComponentStyle update() {
PredefinedComponentStyle componentStyle = new PredefinedComponentStyle(); PredefinedComponentStyle componentStyle = new PredefinedComponentStyle();
frameStylePane.update(componentStyle); frameStylePane.update(componentStyle);
titleStylePane.update(componentStyle); titleStylePane.update(componentStyle);
marginStylePane.update(componentStyle);
return componentStyle; return componentStyle;
} }
@ -159,9 +136,8 @@ public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingP
} }
public void refresh() { public void refresh() {
ComponentStyle componentStyle = PredefinedComponentStyleSettingPane.this.updateBean(); NameLayoutBorderStyle componentStyle = PredefinedComponentStyleSettingPane.this.updateBean();
NameLayoutBorderStyle borderStyle = componentStyle.getNameLayoutBorderStyle(); this.layoutBorderPreviewPane.repaint((LayoutBorderStyle) componentStyle.createRealStyle());
this.layoutBorderPreviewPane.repaint((LayoutBorderStyle) borderStyle.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.gui.xpane.FormPredefinedBackgroundPane;
import com.fr.design.mainframe.widget.editors.ITextComponent; import com.fr.design.mainframe.widget.editors.ITextComponent;
import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer; 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 javax.swing.SwingUtilities;
import java.awt.Dimension; import java.awt.Dimension;
@ -43,7 +43,7 @@ public class AccessibleBodyBackgroundEditor extends UneditableAccessibleEditor {
fireStateChanged(); fireStateChanged();
} }
}); });
backgroundPane.populateBean((NameFormBackground) getValue()); backgroundPane.populateBean((NameComponentBackground) getValue());
dlg.setVisible(true); dlg.setVisible(true);
} }
@ -62,7 +62,7 @@ public class AccessibleBodyBackgroundEditor extends UneditableAccessibleEditor {
if (v == null) { if (v == null) {
return 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") return style.usePredefinedStyle() ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Predefined")
: com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom"); : 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.gui.xpane.PredefinedComponentStyleSettingPane;
import com.fr.design.mainframe.widget.editors.ITextComponent; import com.fr.design.mainframe.widget.editors.ITextComponent;
import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer; 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 javax.swing.SwingUtilities;
import java.awt.Dimension; import java.awt.Dimension;
@ -43,7 +43,7 @@ public class AccessibleBorderStyleEditor extends UneditableAccessibleEditor {
fireStateChanged(); fireStateChanged();
} }
}); });
borderPane.populateBean((ComponentStyle) getValue()); borderPane.populateBean((NameLayoutBorderStyle) getValue());
dlg.setVisible(true); dlg.setVisible(true);
} }
@ -63,7 +63,7 @@ public class AccessibleBorderStyleEditor extends UneditableAccessibleEditor {
if (v == null) { if (v == null) {
return 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") : 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"); 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.mainframe.widget.accessibles.AccessibleBorderStyleEditor;
import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.form.ui.AbstractBorderStyleWidget; import com.fr.form.ui.AbstractBorderStyleWidget;
import com.fr.form.ui.NameLayoutBorderStyle;
import javax.swing.*; import javax.swing.*;
@ -49,17 +50,15 @@ public class BorderStyleWidgetDefinePane extends AbstractDataModify<AbstractBord
@Override @Override
public void populateBean(AbstractBorderStyleWidget ob) { public void populateBean(AbstractBorderStyleWidget ob) {
ComponentStyle componentStyle = new ComponentStyle(ob.getNameBorderStyle(), ob.getNameMargin()); borderStyleEditor.setValue(ob.getNameBorderStyle());
borderStyleEditor.setValue(componentStyle);
} }
@Override @Override
public AbstractBorderStyleWidget updateBean() { public AbstractBorderStyleWidget updateBean() {
AbstractBorderStyleWidget abstractBorderStyleWidget = (AbstractBorderStyleWidget)creator.toData(); AbstractBorderStyleWidget abstractBorderStyleWidget = (AbstractBorderStyleWidget)creator.toData();
ComponentStyle componentStyle = (ComponentStyle) borderStyleEditor.getValue(); NameLayoutBorderStyle componentStyle = (NameLayoutBorderStyle) borderStyleEditor.getValue();
abstractBorderStyleWidget.setNameBorderStyle(componentStyle.getNameLayoutBorderStyle()); abstractBorderStyleWidget.setNameBorderStyle(componentStyle);
abstractBorderStyleWidget.setNameMargin(componentStyle.getNamePaddingMargin());
return abstractBorderStyleWidget; 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.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleElementCaseToolBarEditor; 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.ui.ElementCaseEditor;
import com.fr.form.web.FormToolBarManager; import com.fr.form.web.FormToolBarManager;
import com.fr.general.ComparatorUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -17,6 +20,7 @@ import java.awt.Component;
* Created by ibm on 2017/8/7. * Created by ibm on 2017/8/7.
*/ */
public class ElementEditorDefinePane extends WTitleLayoutDefinePane<ElementCaseEditor> { public class ElementEditorDefinePane extends WTitleLayoutDefinePane<ElementCaseEditor> {
private PaddingBoundPane paddingBoundPane;
private AccessibleElementCaseToolBarEditor elementCaseToolBarEditor; private AccessibleElementCaseToolBarEditor elementCaseToolBarEditor;
private PropertyGroupPane extraPropertyGroupPane; private PropertyGroupPane extraPropertyGroupPane;
@ -27,8 +31,10 @@ public class ElementEditorDefinePane extends WTitleLayoutDefinePane<ElementCaseE
protected JPanel createCenterPane() { protected JPanel createCenterPane() {
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
paddingBoundPane = new PaddingBoundPane();
elementCaseToolBarEditor = new AccessibleElementCaseToolBarEditor(); elementCaseToolBarEditor = new AccessibleElementCaseToolBarEditor();
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{paddingBoundPane, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_EC_Toolbar")), elementCaseToolBarEditor}, 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); 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() { protected ElementCaseEditor updateSubBean() {
ElementCaseEditor elementCaseEditor = (ElementCaseEditor) creator.toData(); 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()); elementCaseEditor.setToolBars((FormToolBarManager[]) elementCaseToolBarEditor.getValue());
return elementCaseEditor; return elementCaseEditor;
} }
protected void populateSubBean(ElementCaseEditor ob) { protected void populateSubBean(ElementCaseEditor ob) {
paddingBoundPane.populate(ob);
elementCaseToolBarEditor.setValue(ob.getToolBars()); elementCaseToolBarEditor.setValue(ob.getToolBars());
if (extraPropertyGroupPane != null) { if (extraPropertyGroupPane != null) {
extraPropertyGroupPane.populate(ob); 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.creator.XWFitLayout;
import com.fr.design.designer.properties.items.FRLayoutTypeItems; import com.fr.design.designer.properties.items.FRLayoutTypeItems;
import com.fr.design.designer.properties.items.Item; import com.fr.design.designer.properties.items.Item;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; 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.FRWidgetFactory;
import com.fr.design.widget.ui.designer.component.WidgetBoundPane; import com.fr.design.widget.ui.designer.component.WidgetBoundPane;
import com.fr.form.ui.LayoutBorderStyle; 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.WAbsoluteBodyLayout;
import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WBodyLayoutType;
@ -114,7 +115,7 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
public void populateSubPane(WAbsoluteLayout ob) { public void populateSubPane(WAbsoluteLayout ob) {
layoutCombox.setSelectedIndex(1); layoutCombox.setSelectedIndex(1);
NameFormBackground formBackground = ob.getNameBackground(); NameComponentBackground formBackground = ob.getNameBackground();
backgroundEditor.setValue(formBackground); backgroundEditor.setValue(formBackground);
boundPane.populate(); boundPane.populate();
@ -135,12 +136,14 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
((XWFitLayout) creator.getBackupParent()).toData().resetStyle(); ((XWFitLayout) creator.getBackupParent()).toData().resetStyle();
if (state == WBodyLayoutType.FIT.getTypeValue()) { if (state == WBodyLayoutType.FIT.getTypeValue()) {
XWFitLayout xwFitLayout = ((XWFitLayout) creator.getBackupParent()); XWFitLayout xwFitLayout = ((XWFitLayout) creator.getBackupParent());
String predefinedName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle();
xwFitLayout.initWidgetPredefinedInfo(predefinedName);
xwFitLayout.switch2FitBodyLayout(creator); xwFitLayout.switch2FitBodyLayout(creator);
copyLayoutAttr(layout, xwFitLayout.toData()); copyLayoutAttr(layout, xwFitLayout.toData());
} }
} }
LayoutBorderStyle borderStyle = new LayoutBorderStyle(); LayoutBorderStyle borderStyle = new LayoutBorderStyle();
NameFormBackground background = (NameFormBackground) backgroundEditor.getValue(); NameComponentBackground background = (NameComponentBackground) backgroundEditor.getValue();
updateBodyBackground(background, borderStyle); updateBodyBackground(background, borderStyle);
layout.setBorderStyle(borderStyle); layout.setBorderStyle(borderStyle);
layout.setNameBackground(background); layout.setNameBackground(background);
@ -148,7 +151,7 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
return layout; return layout;
} }
private void updateBodyBackground(NameFormBackground background, LayoutBorderStyle borderStyle) { private void updateBodyBackground(NameComponentBackground background, LayoutBorderStyle borderStyle) {
if (background != null) { if (background != null) {
borderStyle.setBackground(background.createRealStyle().getBackground()); borderStyle.setBackground(background.createRealStyle().getBackground());
borderStyle.setAlpha(background.getBackgroundAlphaValue()); 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.FRWidgetFactory;
import com.fr.design.widget.ui.designer.component.PaddingBoundPane; import com.fr.design.widget.ui.designer.component.PaddingBoundPane;
import com.fr.form.ui.LayoutBorderStyle; 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.Widget;
import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout;
@ -156,7 +156,7 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue()); layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue());
adaptComboBox.setSelectedIndex(ob.getCompState()); adaptComboBox.setSelectedIndex(ob.getCompState());
componentIntervel.setValue(ob.getCompInterval()); componentIntervel.setValue(ob.getCompInterval());
NameFormBackground formBackground = ob.getNameBackground(); NameComponentBackground formBackground = ob.getNameBackground();
stylePane.setValue(formBackground); stylePane.setValue(formBackground);
watermarkEditor.setValue(ReportUtils.getWatermarkAttrFromTemplate(getCurrentIOFile())); watermarkEditor.setValue(ReportUtils.getWatermarkAttrFromTemplate(getCurrentIOFile()));
} }
@ -177,7 +177,7 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
paddingBound.update(layout); paddingBound.update(layout);
} }
LayoutBorderStyle borderStyle = new LayoutBorderStyle(); LayoutBorderStyle borderStyle = new LayoutBorderStyle();
NameFormBackground background = (NameFormBackground) stylePane.getValue(); NameComponentBackground background = (NameComponentBackground) stylePane.getValue();
updateBodyBackground(background, borderStyle); updateBodyBackground(background, borderStyle);
layout.setBorderStyle(borderStyle); layout.setBorderStyle(borderStyle);
layout.setNameBackground(background); layout.setNameBackground(background);
@ -200,7 +200,6 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
Component[] components = xWFitLayout.getComponents(); Component[] components = xWFitLayout.getComponents();
xWFitLayout.removeAll(); xWFitLayout.removeAll();
layout.resetStyle(); layout.resetStyle();
layout.setNameBackground(NameFormBackground.createPredefinedStyle(predefinedName));
XWAbsoluteBodyLayout xwAbsoluteBodyLayout = xWFitLayout.getBackupParent() == null ? new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0)) : (XWAbsoluteBodyLayout) xWFitLayout.getBackupParent(); XWAbsoluteBodyLayout xwAbsoluteBodyLayout = xWFitLayout.getBackupParent() == null ? new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0)) : (XWAbsoluteBodyLayout) xWFitLayout.getBackupParent();
xwAbsoluteBodyLayout.initWidgetPredefinedInfo(predefinedName); xwAbsoluteBodyLayout.initWidgetPredefinedInfo(predefinedName);
xWFitLayout.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0); xWFitLayout.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0);
@ -235,7 +234,7 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
return layout; return layout;
} }
private void updateBodyBackground(NameFormBackground background, LayoutBorderStyle borderStyle) { private void updateBodyBackground(NameComponentBackground background, LayoutBorderStyle borderStyle) {
if (background != null) { if (background != null) {
borderStyle.setBackground(background.createRealStyle().getBackground()); borderStyle.setBackground(background.createRealStyle().getBackground());
borderStyle.setAlpha(background.getBackgroundAlphaValue()); 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.mainframe.widget.accessibles.AccessibleBorderStyleEditor;
import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.form.ui.AbstractBorderStyleWidget; import com.fr.form.ui.AbstractBorderStyleWidget;
import com.fr.form.ui.NameLayoutBorderStyle;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -65,17 +67,15 @@ public abstract class WTitleLayoutDefinePane<T extends AbstractBorderStyleWidget
@Override @Override
public void populateBean(T ob) { public void populateBean(T ob) {
populateSubBean(ob); populateSubBean(ob);
ComponentStyle componentStyle = new ComponentStyle(ob.getNameBorderStyle(), ob.getNameMargin()); borderStyleEditor.setValue(ob.getNameBorderStyle());
borderStyleEditor.setValue(componentStyle);
} }
@Override @Override
public T updateBean() { public T updateBean() {
T e = updateSubBean(); T e = updateSubBean();
ComponentStyle componentStyle = (ComponentStyle) borderStyleEditor.getValue(); NameLayoutBorderStyle componentStyle = (NameLayoutBorderStyle) borderStyleEditor.getValue();
e.setNameBorderStyle(componentStyle.getNameLayoutBorderStyle()); e.setNameBorderStyle(componentStyle);
e.setNameMargin(componentStyle.getNamePaddingMargin());
return e; 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.BaseUtils;
import com.fr.base.NameStyle; import com.fr.base.NameStyle;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.config.ServerPreferenceConfig;
import com.fr.config.predefined.PredefinedStyle; import com.fr.config.predefined.PredefinedStyle;
import com.fr.config.predefined.PredefinedStyleConfig;
import com.fr.design.actions.SelectionListenerAction; import com.fr.design.actions.SelectionListenerAction;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.file.HistoryTemplateListCache; 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.selection.SelectionListener;
import com.fr.design.style.StylePane; import com.fr.design.style.StylePane;
import com.fr.predefined.PredefinedPatternStyleManager;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.pinyin.PinyinHelper; import com.fr.stable.pinyin.PinyinHelper;
@ -76,18 +75,15 @@ public class GlobalStyleMenuDef extends MenuDef {
public void updateMenu() { public void updateMenu() {
UIMenu createdMenu = this.createJMenu(); UIMenu createdMenu = this.createJMenu();
createdMenu.removeAll(); createdMenu.removeAll();
PredefinedStyleConfig config = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig();
String styleName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle(); String styleName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle();
PredefinedStyle currentStyle = config.getStyle(styleName); PredefinedStyle currentStyle = PredefinedPatternStyleManager.INSTANCE.getStyleFromName(styleName);
if (currentStyle != null) { Iterator iterator = currentStyle.getCellStyleConfig().getStyleNameIterator();
Iterator iterator = config.getStyle(styleName).getCellStyleConfig().getStyleNameIterator(); while (iterator.hasNext()) {
while (iterator.hasNext()) { String name = (String) iterator.next();
String name = (String) iterator.next(); NameStyle nameStyle = NameStyle.createPredefinedStyle(styleName, name, Style.getInstance());
NameStyle nameStyle = NameStyle.createPredefinedStyle(styleName, name, Style.getInstance()); UpdateAction.UseMenuItem useMenuItem = new GlobalStyleSelection(ePane, nameStyle).createUseMenuItem();
UpdateAction.UseMenuItem useMenuItem = new GlobalStyleSelection(ePane, nameStyle).createUseMenuItem(); useMenuItem.setNameStyle(nameStyle);
useMenuItem.setNameStyle(nameStyle); createdMenu.add(useMenuItem);
createdMenu.add(useMenuItem);
}
} }
createdMenu.addSeparator(); createdMenu.addSeparator();
createdMenu.add(new CustomStyleAction(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Custom"))); 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.MenuKeySet;
import com.fr.design.menu.SnapChatUpdateAction; import com.fr.design.menu.SnapChatUpdateAction;
import com.fr.design.notification.SnapChatKey; import com.fr.design.notification.SnapChatKey;
import com.fr.design.utils.DesignUtils;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import javax.swing.KeyStroke; import javax.swing.KeyStroke;
@ -20,6 +21,7 @@ public class ServerPredefinedStyleAction extends SnapChatUpdateAction {
public ServerPredefinedStyleAction(SnapChatKey uniqueKey) { public ServerPredefinedStyleAction(SnapChatKey uniqueKey) {
super(uniqueKey); super(uniqueKey);
this.setEnabled(DesignUtils.checkDesignerRemoteVersion());
this.setMenuKeySet(PREDEFINED_STYLES); this.setMenuKeySet(PREDEFINED_STYLES);
this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic()); 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.mainframe.cell.settingpane.style.CellPredefinedStyleSettingPane;
import com.fr.design.utils.gui.GUICoreUtils; 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.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.elementcase.TemplateElementCase;
@ -66,7 +66,7 @@ public class CellStylePane extends AbstractCellAttrPane {
int row = j + cellRectangle.y; int row = j + cellRectangle.y;
TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row);
if (cellElement == null) { if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(column, row); cellElement = new DefaultPredefinedTemplateCellElement(column, row);
elementCase.addCellElement(cellElement); elementCase.addCellElement(cellElement);
} }
cellElement.setStyle(s); 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.PredefinedCellStyle;
import com.fr.config.predefined.PredefinedCellStyleConfig; import com.fr.config.predefined.PredefinedCellStyleConfig;
import com.fr.config.predefined.PredefinedStyle; import com.fr.config.predefined.PredefinedStyle;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.actions.utils.ReportActionUtils; import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.designer.IntervalConstants; 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.PredefinedStyleSettingPane;
import com.fr.design.mainframe.predefined.ui.preview.StyleSettingPreviewPane; import com.fr.design.mainframe.predefined.ui.preview.StyleSettingPreviewPane;
import com.fr.design.style.BorderUtils; import com.fr.design.style.BorderUtils;
import com.fr.predefined.PredefinedPatternStyleManager;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -87,8 +87,8 @@ public class CellPredefinedStyleSettingPane extends PredefinedStyleSettingPane<N
super.populate(ob); super.populate(ob);
JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
String styleName = template.getTemplatePredefinedStyle(); String styleName = template.getTemplatePredefinedStyle();
PredefinedStyle predefinedStyle = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig().getStyle(styleName); PredefinedStyle currentStyle = PredefinedPatternStyleManager.INSTANCE.getStyleFromName(styleName);
PredefinedCellStyleConfig config = predefinedStyle.getCellStyleConfig(); PredefinedCellStyleConfig config = currentStyle.getCellStyleConfig();
Map<String, PredefinedCellStyle> allStyle = config.getAllStyles(); Map<String, PredefinedCellStyle> allStyle = config.getAllStyles();
this.applicationFormat.clearBoxItems(); this.applicationFormat.clearBoxItems();
for (String name : allStyle.keySet()) { 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 java.util.List;
import com.fr.base.CellBorderStyle; import com.fr.base.CellBorderStyle;
import com.fr.base.NameStyle;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.ComparatorUtils; 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.FloatSelection;
import com.fr.grid.selection.Selection; import com.fr.grid.selection.Selection;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultPredefinedTemplateCellElement;
import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.FloatElement; import com.fr.report.cell.FloatElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
@ -511,10 +513,13 @@ public abstract class BorderUtils {
for (int j = row; j < row + rowSpan; j++) { for (int j = row; j < row + rowSpan; j++) {
TemplateCellElement tmpCellElement = report.getTemplateCellElement(i, j); TemplateCellElement tmpCellElement = report.getTemplateCellElement(i, j);
if (tmpCellElement == null) { if (tmpCellElement == null) {
tmpCellElement = new DefaultTemplateCellElement(i, j); tmpCellElement = new DefaultPredefinedTemplateCellElement(i, j);
report.addCellElement(tmpCellElement); report.addCellElement(tmpCellElement);
} }
Style style = tmpCellElement.getStyle(); Style style = tmpCellElement.getStyle();
if (style instanceof NameStyle && ((NameStyle) style).usePredefinedStyle()) {
continue;
}
style = inspectStyle(row, column, rowSpan, columnSpan, cellBorderStyle, newCellBorderStyle, tmpCellElement, style); style = inspectStyle(row, column, rowSpan, columnSpan, cellBorderStyle, newCellBorderStyle, tmpCellElement, style);
tmpCellElement.setStyle(style); tmpCellElement.setStyle(style);
} }
@ -675,4 +680,4 @@ public abstract class BorderUtils {
return false; 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.cache.list.IntList;
import com.fr.config.ServerPreferenceConfig; import com.fr.config.ServerPreferenceConfig;
import com.fr.config.predefined.PredefinedStyle; import com.fr.config.predefined.PredefinedStyle;
import com.fr.config.predefined.PredefinedStyleConfig;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.cell.CellAttributeAction; import com.fr.design.actions.cell.CellAttributeAction;
import com.fr.design.actions.cell.CellExpandAttrAction; 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.design.selection.QuickEditor;
import com.fr.grid.GridUtils; import com.fr.grid.GridUtils;
import com.fr.predefined.PredefinedPatternStyleManager;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
@ -480,19 +480,16 @@ public class CellSelection extends Selection {
if (!ServerPreferenceConfig.getInstance().hasStyle()) { if (!ServerPreferenceConfig.getInstance().hasStyle()) {
UIMenu styleMenu = new UIMenu(KeySetUtils.GLOBAL_STYLE.getMenuName()); UIMenu styleMenu = new UIMenu(KeySetUtils.GLOBAL_STYLE.getMenuName());
styleMenu.setIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cell.png")); styleMenu.setIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cell.png"));
PredefinedStyleConfig config = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig();
String styleName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle(); String styleName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle();
PredefinedStyle currentStyle = config.getStyle(styleName); PredefinedStyle currentStyle = PredefinedPatternStyleManager.INSTANCE.getStyleFromName(styleName);
if (currentStyle != null) { Iterator iterator = currentStyle.getCellStyleConfig().getStyleNameIterator();
Iterator iterator = config.getStyle(styleName).getCellStyleConfig().getStyleNameIterator(); while (iterator.hasNext()) {
while (iterator.hasNext()) { String name = (String) iterator.next();
String name = (String) iterator.next(); name = GlobalStyleMenuDef.judgeChina(name);
name = GlobalStyleMenuDef.judgeChina(name); NameStyle nameStyle = NameStyle.createPredefinedStyle(styleName, name, Style.getInstance());
NameStyle nameStyle = NameStyle.createPredefinedStyle(styleName, name, Style.getInstance()); UpdateAction.UseMenuItem useMenuItem = new GlobalStyleSelection(ePane, nameStyle).createUseMenuItem();
UpdateAction.UseMenuItem useMenuItem = new GlobalStyleSelection(ePane, nameStyle).createUseMenuItem(); useMenuItem.setNameStyle(nameStyle);
useMenuItem.setNameStyle(nameStyle); styleMenu.add(useMenuItem);
styleMenu.add(useMenuItem);
}
} }
styleMenu.addSeparator(); styleMenu.addSeparator();
styleMenu.add(new GlobalStyleMenuDef.CustomStyleAction(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom"))); styleMenu.add(new GlobalStyleMenuDef.CustomStyleAction(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom")));

Loading…
Cancel
Save