From c7644c0dc406a2590f1f319569f7474f1ebc7e12 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 7 Aug 2017 15:29:20 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-3293=209.0=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E8=AE=BE=E7=BD=AE=E9=87=8D=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/CellWidgetPropertyPane.java | 11 +-- .../com/fr/grid/selection/CellSelection.java | 7 ++ .../com/fr/grid/selection/FloatSelection.java | 5 ++ .../src/com/fr/grid/selection/Selection.java | 2 + .../src/com/fr/design/gui/frpane/RegPane.java | 1 - .../designer/creator/XWTitleLayout.java | 6 ++ .../widget/ui/FormWidgetCardPane.java | 16 +++- .../FormWidgetDefinePaneFactoryBase.java | 3 +- .../CustomWritableRepeatEditorPane.java | 57 ++++++++++++- .../ui/designer/FreeButtonDefinePane.java | 13 ++- .../component/BackgroundCompPane.java | 19 ++--- .../component/MouseActionBackground.java | 43 ++++++++++ .../layout/ElementEditorDefinePane.java | 58 +++++++++++++ .../layout/WCardLayoutDefinePane.java | 85 +++++++++++++++++++ .../layout/WTabFitLayoutDefinePane.java | 38 ++++++++- .../layout/WTitleLayoutDefinePane.java | 47 ++++++---- 16 files changed, 365 insertions(+), 46 deletions(-) create mode 100644 designer_form/src/com/fr/design/widget/ui/designer/component/MouseActionBackground.java create mode 100644 designer_form/src/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java create mode 100644 designer_form/src/com/fr/design/widget/ui/designer/layout/WCardLayoutDefinePane.java diff --git a/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java b/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java index 0c567f555..df2cbca53 100644 --- a/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java +++ b/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java @@ -86,11 +86,7 @@ public class CellWidgetPropertyPane extends BasicPane { } - public void populate(ElementCasePane ePane) { - Selection editingSelection = ePane.getSelection(); - if(editingSelection instanceof FloatSelection){ - return; - } + public void reInit(ElementCasePane ePane){ cellEditorDefPane = new WidgetPane(ePane); this.removeAll(); this.add(cellEditorDefPane, BorderLayout.CENTER); @@ -106,6 +102,11 @@ public class CellWidgetPropertyPane extends BasicPane { this.populate(editCellElement); } + public void populate(ElementCasePane ePane) { + Selection editingSelection = ePane.getSelection(); + editingSelection.populateWidgetPropertyPane(ePane); + } + public void update() { if (cellElement == null) {// 利用默认的CellElement. return; diff --git a/designer/src/com/fr/grid/selection/CellSelection.java b/designer/src/com/fr/grid/selection/CellSelection.java index a5b139af5..d3778d72a 100644 --- a/designer/src/com/fr/grid/selection/CellSelection.java +++ b/designer/src/com/fr/grid/selection/CellSelection.java @@ -18,12 +18,14 @@ import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.imenu.UIMenu; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.mainframe.CellElementPropertyPane; +import com.fr.design.mainframe.CellWidgetPropertyPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane.Clear; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.KeySetUtils; import com.fr.design.report.RowColumnPane; import com.fr.design.selection.QuickEditor; +import com.fr.form.ui.CellWidget; import com.fr.general.Inter; import com.fr.grid.GridUtils; import com.fr.report.cell.CellElement; @@ -687,4 +689,9 @@ public class CellSelection extends Selection { public void populatePropertyPane(ElementCasePane ePane) { CellElementPropertyPane.getInstance().reInit(ePane); } + + public void populateWidgetPropertyPane(ElementCasePane ePane){ + CellWidgetPropertyPane.getInstance().reInit(ePane); + } + } \ No newline at end of file diff --git a/designer/src/com/fr/grid/selection/FloatSelection.java b/designer/src/com/fr/grid/selection/FloatSelection.java index adc6b01f1..214e82e09 100644 --- a/designer/src/com/fr/grid/selection/FloatSelection.java +++ b/designer/src/com/fr/grid/selection/FloatSelection.java @@ -234,4 +234,9 @@ public class FloatSelection extends Selection { public void populatePropertyPane(ElementCasePane ePane) { CellElementPropertyPane.getInstance().removeAll(); } + + public void populateWidgetPropertyPane(ElementCasePane ePane){ + return; + } + } \ No newline at end of file diff --git a/designer/src/com/fr/grid/selection/Selection.java b/designer/src/com/fr/grid/selection/Selection.java index c12dda83b..6787e36a5 100644 --- a/designer/src/com/fr/grid/selection/Selection.java +++ b/designer/src/com/fr/grid/selection/Selection.java @@ -89,6 +89,8 @@ public abstract class Selection implements FCloneable, Serializable , Selectable public abstract boolean containsColumnRow(ColumnRow cr); public abstract void populatePropertyPane(ElementCasePane ePane); + + public abstract void populateWidgetPropertyPane(ElementCasePane ePane); @Override diff --git a/designer_base/src/com/fr/design/gui/frpane/RegPane.java b/designer_base/src/com/fr/design/gui/frpane/RegPane.java index 984665c8b..4edfe6807 100644 --- a/designer_base/src/com/fr/design/gui/frpane/RegPane.java +++ b/designer_base/src/com/fr/design/gui/frpane/RegPane.java @@ -84,7 +84,6 @@ public class RegPane extends BasicPane { uiLabel.setPreferredSize(new Dimension(20, 20)); contentPane.add(uiLabel); contentPane.add(regComboBox); - regErrorMsgPane = new RegErrorMsgPane(); final JPanel cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); detailedCardLayout = new CardLayout(); diff --git a/designer_form/src/com/fr/design/designer/creator/XWTitleLayout.java b/designer_form/src/com/fr/design/designer/creator/XWTitleLayout.java index 296a617f9..6860fc345 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWTitleLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWTitleLayout.java @@ -29,6 +29,8 @@ public class XWTitleLayout extends DedicateLayoutContainer { */ private static final long serialVersionUID = 5274572473978467325L; + private static final int INDEX = 0; + public XWTitleLayout() { super(new WTitleLayout("titlePane"), new Dimension()); } @@ -59,6 +61,10 @@ public class XWTitleLayout extends DedicateLayoutContainer { return new FRTitleLayoutAdapter(this); } + public XCreator getEditingChildCreator(){ + return getXCreator(INDEX); + } + /** * 返回容器对应的wlayout * diff --git a/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java b/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java index 35c74553d..33823f79d 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java +++ b/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java @@ -14,6 +14,7 @@ import com.fr.design.widget.ui.designer.component.WidgetAbsoluteBoundPane; import com.fr.design.widget.ui.designer.component.WidgetBoundPane; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WScaleLayout; +import com.fr.form.ui.container.WTitleLayout; import com.fr.form.ui.widget.CRBoundsWidget; import javax.swing.*; @@ -129,13 +130,16 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { private void initDefinePane() { currentEditorDefinePane = null; XCreator creator = xCreator; - if (xCreator instanceof XWScaleLayout) { + if (xCreator instanceof XWScaleLayout ) { if (xCreator.acceptType(XWScaleLayout.class)) { if (xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator()) { creator = (XCreator) xCreator.getComponent(0); } } } + if(xCreator.acceptType(XWTitleLayout.class)){ + creator = (XCreator) xCreator.getComponent(0); + } FormWidgetDefinePaneFactoryBase.RN rn = FormWidgetDefinePaneFactoryBase.createWidgetDefinePane(creator, creator.toData(), new Operator() { @Override public void did(DataCreatorUI ui, String cardName) { @@ -166,7 +170,10 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { if (cellWidget instanceof WScaleLayout) { Widget crBoundsWidget = ((WScaleLayout) cellWidget).getBoundsWidget(); currentEditorDefinePane.populateBean(((CRBoundsWidget) crBoundsWidget).getWidget()); - } else { + } else if(cellWidget instanceof WTitleLayout){ + CRBoundsWidget crBoundsWidget = ((WTitleLayout) cellWidget).getBodyBoundsWidget(); + currentEditorDefinePane.populateBean(crBoundsWidget.getWidget()); + }else{ currentEditorDefinePane.populateBean(cellWidget); } widgetPropertyPane.populate(cellWidget); @@ -188,6 +195,11 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { xCreator1.resetData(widget); xCreator.removeAll(); xCreator.add(xCreator1); + }else if(xCreator instanceof XWTitleLayout){ + XCreator xCreator1 = ((XWTitleLayout) xCreator).getXCreator(0); + xCreator1.resetData(widget); + xCreator.removeAll(); + xCreator.add(xCreator1); } else { xCreator.resetData(widget); } diff --git a/designer_form/src/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java b/designer_form/src/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java index cec27c534..4da3a9be2 100644 --- a/designer_form/src/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java +++ b/designer_form/src/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java @@ -58,10 +58,11 @@ public class FormWidgetDefinePaneFactoryBase { // } defineMap.put(WAbsoluteLayout.class, new Appearance(FRAbsoluteLayoutDefinePane.class, Inter.getLocText("FR-Designer_AbsoluteLayout"))); + defineMap.put(ElementCaseEditor.class, new Appearance(ElementEditorDefinePane.class, Inter.getLocText("FR-Designer_AbsoluteLayout"))); defineMap.put(WAbsoluteBodyLayout.class, new Appearance(FRAbsoluteBodyLayoutDefinePane.class, Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"))); defineMap.put(WParameterLayout.class, new Appearance(RootDesignDefinePane.class, Inter.getLocText("FR-Designer_Para-Body"))); defineMap.put(WCardMainBorderLayout.class, new Appearance(WCardMainLayoutDefinePane.class, "tab")); - defineMap.put(WTitleLayout.class, new Appearance(WTitleLayoutDefinePane.class, "tab")); + defineMap.put(WCardLayout.class, new Appearance(WCardLayoutDefinePane.class, "tablayout")); defineMap.put(Label.class, new Appearance(LabelDefinePane.class, "label")); defineMap.put(WTabFitLayout.class, new Appearance(WTabFitLayoutDefinePane.class, "label")); defineMap.putAll(ExtraDesignClassManager.getInstance().getCellWidgetOptionsMap()); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/CustomWritableRepeatEditorPane.java b/designer_form/src/com/fr/design/widget/ui/designer/CustomWritableRepeatEditorPane.java index 73f9cb521..d13535c62 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/CustomWritableRepeatEditorPane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/CustomWritableRepeatEditorPane.java @@ -1 +1,56 @@ -package com.fr.design.widget.ui.designer; import com.fr.base.GraphHelper; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : Shockway * Date: 13-9-18 * Time: 下午2:17 */ public abstract class CustomWritableRepeatEditorPane extends WritableRepeatEditorPane { private UICheckBox customDataCheckBox; private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30; private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30; public CustomWritableRepeatEditorPane(XCreator xCreator) { super(xCreator); } public JPanel setValidatePane(){ this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); this.customDataCheckBox.setPreferredSize( new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT)); JPanel otherContentPane = super.setValidatePane(); otherContentPane.add(GUICoreUtils.createFlowPane(new JComponent[]{customDataCheckBox}, FlowLayout.LEFT, 5)); return otherContentPane; } protected void populateSubWritableRepeatEditorBean(T e) { this.customDataCheckBox.setSelected(e.isCustomData()); populateSubCustomWritableRepeatEditorBean(e); } protected abstract void populateSubCustomWritableRepeatEditorBean(T e); protected T updateSubWritableRepeatEditorBean() { T e = updateSubCustomWritableRepeatEditorBean(); e.setCustomData(this.customDataCheckBox.isSelected()); return e; } protected abstract T updateSubCustomWritableRepeatEditorBean(); } \ No newline at end of file +package com.fr.design.widget.ui.designer; + +import com.fr.base.GraphHelper; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.form.ui.CustomWriteAbleRepeatEditor; +import com.fr.general.Inter; + +import javax.swing.*; +import java.awt.*; + +/** + * Author : Shockway + * Date: 13-9-18 + * Time: 下午2:17 + */ +public abstract class CustomWritableRepeatEditorPane extends WritableRepeatEditorPane { + + private UICheckBox customDataCheckBox; + private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30; + private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30; + + public CustomWritableRepeatEditorPane(XCreator xCreator) { + super(xCreator); + } + + + public JPanel setValidatePane(){ + this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); + this.customDataCheckBox.setPreferredSize( + new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT)); + JPanel otherContentPane = super.setValidatePane(); + otherContentPane.add(GUICoreUtils.createFlowPane(new JComponent[]{customDataCheckBox}, FlowLayout.LEFT, 5)); + return otherContentPane; + } + + + + protected void populateSubWritableRepeatEditorBean(T e) { + this.customDataCheckBox.setSelected(e.isCustomData()); + populateSubCustomWritableRepeatEditorBean(e); + } + + protected abstract void populateSubCustomWritableRepeatEditorBean(T e); + + protected T updateSubWritableRepeatEditorBean() { + T e = updateSubCustomWritableRepeatEditorBean(); + e.setCustomData(this.customDataCheckBox.isSelected()); + return e; + } + + protected abstract T updateSubCustomWritableRepeatEditorBean(); + +} \ No newline at end of file diff --git a/designer_form/src/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java index 832767ef1..43f038512 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java @@ -4,6 +4,7 @@ import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.style.FRFontPane; import com.fr.design.widget.ui.designer.component.BackgroundCompPane; +import com.fr.design.widget.ui.designer.component.MouseActionBackground; import com.fr.form.ui.FreeButton; import com.fr.general.FRFont; import com.fr.general.Inter; @@ -27,7 +28,7 @@ public class FreeButtonDefinePane extends ButtonDefinePane { return new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background") + ":"), backgroundCompPane}; } - public Component[] createFontPane(){ + public Component[] createFontPane() { UILabel fontLabel = new UILabel(Inter.getLocText("FR-Designer_Font")); fontLabel.setVerticalAlignment(SwingConstants.TOP); frFontPane = new FRFontPane(); @@ -35,16 +36,20 @@ public class FreeButtonDefinePane extends ButtonDefinePane { } public void populateSubButtonPane(FreeButton e) { - backgroundCompPane.populate(e); + MouseActionBackground mouseActionBackground = new MouseActionBackground(e.getInitialBackground(), e.getOverBackground(), e.getClickBackground()); + backgroundCompPane.populate(mouseActionBackground); FRFont frFont = e.getFont(); - if(frFont!=null){ + if (frFont != null) { frFontPane.populateBean(e.getFont()); } } public FreeButton updateSubButtonPane() { FreeButton freeButton = (FreeButton) creator.toData(); - backgroundCompPane.update(freeButton); + MouseActionBackground mouseActionBackground = backgroundCompPane.update(); + freeButton.setInitialBackground(mouseActionBackground.getInitialBackground()); + freeButton.setOverBackground(mouseActionBackground.getOverBackground()); + freeButton.setClickBackground(mouseActionBackground.getClickBackground()); frFontPane.update(freeButton.getFont()); return freeButton; } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/component/BackgroundCompPane.java b/designer_form/src/com/fr/design/widget/ui/designer/component/BackgroundCompPane.java index 67ed2bab0..bfe65a4a6 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/component/BackgroundCompPane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/component/BackgroundCompPane.java @@ -7,8 +7,6 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor; -import com.fr.form.ui.*; -import com.fr.form.ui.Button; import com.fr.general.Background; import com.fr.general.Inter; @@ -34,7 +32,7 @@ public class BackgroundCompPane extends BasicPane { initalBackgroundEditor = new AccessibleBackgroundEditor(); overBackgroundEditor = new AccessibleBackgroundEditor(); clickBackgroundEditor = new AccessibleBackgroundEditor(); - String [] titles = new String[]{"默认", "自定义"}; + String [] titles = new String[]{Inter.getLocText("FR-Designer_DEFAULT"), Inter.getLocText("FR-Designer_Custom")}; double f = TableLayout.FILL; final double p = TableLayout.PREFERRED; @@ -64,19 +62,18 @@ public class BackgroundCompPane extends BasicPane { } - public void update(FreeButton btn) { - btn.setInitialBackground((Background) initalBackgroundEditor.getValue()); - btn.setOverBackground((Background) overBackgroundEditor.getValue()); - btn.setClickBackground((Background) clickBackgroundEditor.getValue()); + public MouseActionBackground update() { + MouseActionBackground mouseActionBackground = new MouseActionBackground((Background) initalBackgroundEditor.getValue(), (Background) overBackgroundEditor.getValue(), (Background) clickBackgroundEditor.getValue()); + return mouseActionBackground; } protected String title4PopupWindow() { return ""; } - public void populate(FreeButton btn) { - initalBackgroundEditor.setValue(btn.getInitialBackground()); - overBackgroundEditor.setValue(btn.getOverBackground()); - clickBackgroundEditor.setValue(btn.getClickBackground()); + public void populate(MouseActionBackground background) { + initalBackgroundEditor.setValue(background.getInitialBackground()); + overBackgroundEditor.setValue(background.getOverBackground()); + clickBackgroundEditor.setValue(background.getClickBackground()); } } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/component/MouseActionBackground.java b/designer_form/src/com/fr/design/widget/ui/designer/component/MouseActionBackground.java new file mode 100644 index 000000000..483b87426 --- /dev/null +++ b/designer_form/src/com/fr/design/widget/ui/designer/component/MouseActionBackground.java @@ -0,0 +1,43 @@ +package com.fr.design.widget.ui.designer.component; + +import com.fr.general.Background; + +/** + * Created by ibm on 2017/8/7. + */ +public class MouseActionBackground { + + private Background initialBackground; + private Background overBackground; + private Background clickBackground; + + public MouseActionBackground(Background initialBackground, Background overBackground, Background clickBackground){ + this.initialBackground = initialBackground; + this.overBackground = overBackground; + this.clickBackground = clickBackground; + } + + public Background getInitialBackground() { + return initialBackground; + } + + public void setInitialBackground(Background initialBackground) { + this.initialBackground = initialBackground; + } + + public Background getOverBackground() { + return overBackground; + } + + public void setOverBackground(Background overBackground) { + this.overBackground = overBackground; + } + + public Background getClickBackground() { + return clickBackground; + } + + public void setClickBackground(Background clickBackground) { + this.clickBackground = clickBackground; + } +} diff --git a/designer_form/src/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java new file mode 100644 index 000000000..d33dadd0a --- /dev/null +++ b/designer_form/src/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java @@ -0,0 +1,58 @@ +package com.fr.design.widget.ui.designer.layout; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.TableLayout; +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.Inter; + +import javax.swing.*; +import java.awt.*; + +/** + * Created by ibm on 2017/8/7. + */ +public class ElementEditorDefinePane extends WTitleLayoutDefinePane { + private PaddingBoundPane paddingBoundPane; + private AccessibleElementCaseToolBarEditor elementCaseToolBarEditor; + + public ElementEditorDefinePane(XCreator xCreator){ + super(xCreator); + + } + + protected JPanel createCenterPane(){ + paddingBoundPane = new PaddingBoundPane(); + elementCaseToolBarEditor = new AccessibleElementCaseToolBarEditor(); + double f = TableLayout.FILL; + double p = TableLayout.PREFERRED; + double[] rowSize = {p, p}; + double[] columnSize = {p, f}; + int[][] rowCount = {{1, 1}, {1, 1}}; + Component[][] components = new Component[][]{ + new Component[]{paddingBoundPane, null}, + new Component[]{new UILabel("报表块工具栏"), elementCaseToolBarEditor} + }; + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7); + panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); + return panel; + } + + protected ElementCaseEditor updateSubBean(){ + ElementCaseEditor elementCaseEditor = (ElementCaseEditor)creator.toData(); + paddingBoundPane.update(elementCaseEditor); + elementCaseEditor.setToolBars((FormToolBarManager[])elementCaseToolBarEditor.getValue()); + return elementCaseEditor; + } + + protected void populateSubBean(ElementCaseEditor ob){ + paddingBoundPane.populate(ob); + elementCaseToolBarEditor.setValue(ob.getToolBars()); + } + +} diff --git a/designer_form/src/com/fr/design/widget/ui/designer/layout/WCardLayoutDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/layout/WCardLayoutDefinePane.java new file mode 100644 index 000000000..28ea054e8 --- /dev/null +++ b/designer_form/src/com/fr/design/widget/ui/designer/layout/WCardLayoutDefinePane.java @@ -0,0 +1,85 @@ +package com.fr.design.widget.ui.designer.layout; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.widget.accessibles.AccessibleCardTagWLayoutBorderStyleEditor; +import com.fr.design.widget.ui.designer.AbstractDataModify; +import com.fr.form.ui.LayoutBorderStyle; +import com.fr.form.ui.container.WCardLayout; +import com.fr.general.Inter; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * Created by ibm on 2017/8/7. + */ +public class WCardLayoutDefinePane extends AbstractDataModify { + private AccessibleCardTagWLayoutBorderStyleEditor accessibleCardTagWLayoutBorderStyleEditor; + private UICheckBox setCarousel; + private UISpinner carouselInterval; + private JPanel IntervalPane; + + public WCardLayoutDefinePane(XCreator xCreator) { + super(xCreator); + initComponent(); + } + + public void initComponent() { + carouselInterval = new UISpinner(0, 20, 1, 0); + accessibleCardTagWLayoutBorderStyleEditor = new AccessibleCardTagWLayoutBorderStyleEditor(); + accessibleCardTagWLayoutBorderStyleEditor.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); + JPanel accessibleCardlayout = FRGUIPaneFactory.createBorderLayout_S_Pane(); + accessibleCardlayout.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); + accessibleCardlayout.add(accessibleCardTagWLayoutBorderStyleEditor, BorderLayout.CENTER); + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, accessibleCardlayout); + final JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); + setCarousel = new UICheckBox(Inter.getLocText("FR-Designer_setCarousel")); + + IntervalPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_carouselInterval")), carouselInterval}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); + IntervalPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); + jPanel.add(setCarousel, BorderLayout.NORTH); + jPanel.add(IntervalPane, BorderLayout.CENTER); + setCarousel.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + IntervalPane.setVisible(setCarousel.isSelected()); + } + }); + UIExpandablePane setCarouselPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Tab_carousel"), 280, 20, jPanel); + this.add(advanceExpandablePane, BorderLayout.NORTH); + this.add(setCarouselPane, BorderLayout.CENTER); + } + + @Override + public String title4PopupWindow() { + return "tabFitLayout"; + } + + @Override + public void populateBean(WCardLayout ob) { + accessibleCardTagWLayoutBorderStyleEditor.setValue(ob.getBorderStyle()); + setCarousel.setSelected(ob.isCarousel()); + IntervalPane.setVisible(ob.isCarousel()); + carouselInterval.setValue(ob.getCarouselInterval()); + } + + + @Override + public WCardLayout updateBean() { + WCardLayout layout = (WCardLayout) creator.toData(); + layout.setBorderStyle((LayoutBorderStyle) accessibleCardTagWLayoutBorderStyleEditor.getValue()); + layout.setCarousel(setCarousel.isSelected()); + layout.setCarouselInterval((int)carouselInterval.getValue()); + return layout; + } +} diff --git a/designer_form/src/com/fr/design/widget/ui/designer/layout/WTabFitLayoutDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/layout/WTabFitLayoutDefinePane.java index 151d06d28..2e31902d4 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/layout/WTabFitLayoutDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/layout/WTabFitLayoutDefinePane.java @@ -1,12 +1,19 @@ package com.fr.design.widget.ui.designer.layout; import com.fr.design.designer.creator.XCreator; -import com.fr.design.foldablepane.UIExpandablePane;; +import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; import com.fr.design.widget.ui.designer.AbstractDataModify; +import com.fr.design.widget.ui.designer.component.BackgroundCompPane; +import com.fr.design.widget.ui.designer.component.MouseActionBackground; import com.fr.design.widget.ui.designer.component.PaddingBoundPane; import com.fr.form.ui.container.cardlayout.WTabFitLayout; import com.fr.general.Inter; + +import javax.swing.*; import java.awt.*; /** @@ -14,6 +21,8 @@ import java.awt.*; */ public class WTabFitLayoutDefinePane extends AbstractDataModify { private PaddingBoundPane paddingBoundPane; + private BackgroundCompPane borderStyle; + private UISpinner componentInterval; public WTabFitLayoutDefinePane(XCreator xCreator) { super(xCreator); @@ -21,10 +30,22 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify { } public void initComponent() { + JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); paddingBoundPane = new PaddingBoundPane(); + borderStyle = new BackgroundCompPane(); + JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Style")), borderStyle}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); + advancePane.add(jPanel, BorderLayout.NORTH); + advancePane.add(paddingBoundPane, BorderLayout.CENTER); this.setLayout(FRGUIPaneFactory.createBorderLayout()); - UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, paddingBoundPane); - this.add(advanceExpandablePane, BorderLayout.CENTER); + UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, advancePane); + this.add(advanceExpandablePane, BorderLayout.NORTH); + initLayoutComponent(); + } + + public void initLayoutComponent(){ + componentInterval = new UISpinner(0, 100, 1, 0); + JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Component_Interval")), componentInterval}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); + this.add(jPanel, BorderLayout.CENTER); } @Override @@ -34,13 +55,22 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify { @Override public void populateBean(WTabFitLayout ob) { - + MouseActionBackground mouseActionBackground = new MouseActionBackground(ob.getInitialBackground(), ob.getOverBackground(), ob.getClickBackground()); + borderStyle.populate(mouseActionBackground); + paddingBoundPane.populate(ob); + componentInterval.setValue(ob.getCompInterval()); } @Override public WTabFitLayout updateBean() { WTabFitLayout layout = (WTabFitLayout) creator.toData(); + MouseActionBackground mouseActionBackground = borderStyle.update(); + layout.setInitialBackground(mouseActionBackground.getInitialBackground()); + layout.setOverBackground(mouseActionBackground.getOverBackground()); + layout.setClickBackground(mouseActionBackground.getClickBackground()); + paddingBoundPane.update(layout); + layout.setCompInterval((int)componentInterval.getValue()); return layout; } } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java index d7cb828ad..bcb82d5e7 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java @@ -10,6 +10,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor; import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.design.widget.ui.designer.component.PaddingBoundPane; +import com.fr.form.ui.*; import com.fr.form.ui.container.WTitleLayout; import com.fr.general.Inter; @@ -19,10 +20,9 @@ import java.awt.*; /** * Created by ibm on 2017/8/3. */ -public class WTitleLayoutDefinePane extends AbstractDataModify { +public abstract class WTitleLayoutDefinePane extends AbstractDataModify { private AccessibleWLayoutBorderStyleEditor borderStyleEditor; - private PaddingBoundPane paddingBoundPane; - private UICheckBox displayECToolBar; + public WTitleLayoutDefinePane(XCreator xCreator) { super(xCreator); initComponent(); @@ -30,43 +30,56 @@ public class WTitleLayoutDefinePane extends AbstractDataModify { public void initComponent() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); borderStyleEditor = new AccessibleWLayoutBorderStyleEditor(); - paddingBoundPane = new PaddingBoundPane(); - displayECToolBar = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Display_Report_Tool")); + double f = TableLayout.FILL; double p = TableLayout.PREFERRED; - double[] rowSize = {p, p, p}; + double[] rowSize = {p}; double[] columnSize = {p, f}; - int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; + int[][] rowCount = {{1, 1}}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("FR-Designer_Style")), borderStyleEditor}, - new Component[]{paddingBoundPane, null}, - new Component[]{displayECToolBar, null} + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Style")), borderStyleEditor} }; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7); panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); - UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, panel); + advancePane.add(panel, BorderLayout.NORTH); + JPanel centerPane = createCenterPane(); + if(centerPane!=null){ + advancePane.add(centerPane, BorderLayout.CENTER); + } + UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, advancePane); this.add(advanceExpandablePane); } + protected JPanel createCenterPane(){ + return null; + } + + @Override public String title4PopupWindow() { return "titleLayout"; } @Override - public void populateBean(WTitleLayout ob) { - paddingBoundPane.populate(ob); -// displayECToolBar.setSelected(ob.); + public void populateBean(T ob) { + populateSubBean(ob); + borderStyleEditor.setValue(ob.getBorderStyle()); } @Override - public WTitleLayout updateBean() { - WTitleLayout layout = (WTitleLayout)creator.toData(); - return layout; + public T updateBean() { + T e = updateSubBean(); + e.setBorderStyle((LayoutBorderStyle) borderStyleEditor.getValue()); + return e; } + protected abstract T updateSubBean(); + + protected abstract void populateSubBean(T ob); + }