Browse Source

REPORT-3293 9.0设计器控件设置重画

master
kerry 7 years ago
parent
commit
c7644c0dc4
  1. 11
      designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java
  2. 7
      designer/src/com/fr/grid/selection/CellSelection.java
  3. 5
      designer/src/com/fr/grid/selection/FloatSelection.java
  4. 2
      designer/src/com/fr/grid/selection/Selection.java
  5. 1
      designer_base/src/com/fr/design/gui/frpane/RegPane.java
  6. 6
      designer_form/src/com/fr/design/designer/creator/XWTitleLayout.java
  7. 16
      designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java
  8. 3
      designer_form/src/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java
  9. 57
      designer_form/src/com/fr/design/widget/ui/designer/CustomWritableRepeatEditorPane.java
  10. 13
      designer_form/src/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java
  11. 19
      designer_form/src/com/fr/design/widget/ui/designer/component/BackgroundCompPane.java
  12. 43
      designer_form/src/com/fr/design/widget/ui/designer/component/MouseActionBackground.java
  13. 58
      designer_form/src/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java
  14. 85
      designer_form/src/com/fr/design/widget/ui/designer/layout/WCardLayoutDefinePane.java
  15. 38
      designer_form/src/com/fr/design/widget/ui/designer/layout/WTabFitLayoutDefinePane.java
  16. 47
      designer_form/src/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java

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

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

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

2
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

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

6
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
*

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

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

57
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<T extends CustomWriteAbleRepeatEditor> extends WritableRepeatEditorPane<T> { 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(); }
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<T extends CustomWriteAbleRepeatEditor> extends WritableRepeatEditorPane<T> {
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();
}

13
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<FreeButton> {
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<FreeButton> {
}
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;
}

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

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

58
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<ElementCaseEditor> {
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());
}
}

85
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<WCardLayout> {
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;
}
}

38
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<WTabFitLayout> {
private PaddingBoundPane paddingBoundPane;
private BackgroundCompPane borderStyle;
private UISpinner componentInterval;
public WTabFitLayoutDefinePane(XCreator xCreator) {
super(xCreator);
@ -21,10 +30,22 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
}
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<WTabFitLayout> {
@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;
}
}

47
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<WTitleLayout> {
public abstract class WTitleLayoutDefinePane<T extends AbstractBorderStyleWidget> extends AbstractDataModify<T> {
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<WTitleLayout> {
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);
}

Loading…
Cancel
Save