Browse Source

Merge remote-tracking branch 'origin/release/9.0' into release/9.0

master
mengao 7 years ago
parent
commit
17d7001247
  1. 20
      designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java
  2. 97
      designer/src/com/fr/design/mainframe/cell/CellEditorPane.java
  3. 29
      designer/src/com/fr/design/widget/WidgetPane.java
  4. 5
      designer/src/com/fr/design/widget/ui/PasswordDefinePane.java
  5. 5
      designer/src/com/fr/design/widget/ui/TextAreaDefinePane.java
  6. 20
      designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java
  7. 261
      designer/src/com/fr/quickeditor/CellQuickEditor.java
  8. 7
      designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java
  9. 34
      designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java
  10. 41
      designer/src/com/fr/quickeditor/cellquick/CellElementBarLayout.java
  11. 7
      designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java
  12. 7
      designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java
  13. 7
      designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java
  14. 5
      designer/src/com/fr/quickeditor/cellquick/CellStringQuickEditor.java
  15. 6
      designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java
  16. 5
      designer_base/src/com/fr/design/condition/LiteConditionPane.java
  17. 108
      designer_base/src/com/fr/design/gui/frpane/RegFieldPane.java
  18. 72
      designer_base/src/com/fr/design/gui/frpane/RegPane.java
  19. 6
      designer_base/src/com/fr/design/locale/designer.properties
  20. 6
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  21. 4
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  22. 2
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  23. 1
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  24. 2
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  25. 1
      designer_base/src/com/fr/file/FILEChooserPane.java
  26. 14
      designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java
  27. 2
      designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java
  28. 2
      designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java
  29. 2
      designer_form/src/com/fr/design/widget/ui/designer/MultiFileEditorPane.java
  30. 2
      designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java
  31. 13
      designer_form/src/com/fr/design/widget/ui/designer/PasswordDefinePane.java
  32. 2
      designer_form/src/com/fr/design/widget/ui/designer/RadioDefinePane.java
  33. 9
      designer_form/src/com/fr/design/widget/ui/designer/TextAreaDefinePane.java
  34. 25
      designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java
  35. 2
      designer_form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteLayoutDefinePane.java
  36. 2
      designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

20
designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java

@ -2,18 +2,14 @@ package com.fr.design.mainframe;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.actions.utils.ReportActionUtils; import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.CellWriteAttrPane;
import com.fr.design.widget.WidgetPane; import com.fr.design.widget.WidgetPane;
import com.fr.form.ui.NoneWidget; import com.fr.form.ui.NoneWidget;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection; import com.fr.grid.selection.Selection;
import com.fr.privilege.finegrain.WidgetPrivilegeControl; import com.fr.privilege.finegrain.WidgetPrivilegeControl;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
@ -34,7 +30,7 @@ public class CellWidgetPropertyPane extends BasicPane {
private WidgetPane cellEditorDefPane; private WidgetPane cellEditorDefPane;
private ElementCasePane ePane; private ElementCasePane ePane;
public static CellWidgetPropertyPane getInstance(){ public static CellWidgetPropertyPane getInstance() {
if (singleton == null) { if (singleton == null) {
singleton = new CellWidgetPropertyPane(); singleton = new CellWidgetPropertyPane();
} }
@ -43,11 +39,9 @@ public class CellWidgetPropertyPane extends BasicPane {
public CellWidgetPropertyPane() { public CellWidgetPropertyPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
// this.addAttributeChangeListener(listener);
// cellEditorDefPane = new WidgetPane(elementCasePane);
} }
public void clear (){ public void clear() {
singleton = null; singleton = null;
} }
@ -86,7 +80,7 @@ public class CellWidgetPropertyPane extends BasicPane {
} }
public void reInit(ElementCasePane ePane){ public void reInit(ElementCasePane ePane) {
this.ePane = ePane; this.ePane = ePane;
cellEditorDefPane = new WidgetPane(ePane); cellEditorDefPane = new WidgetPane(ePane);
this.removeAll(); this.removeAll();
@ -128,6 +122,7 @@ public class CellWidgetPropertyPane extends BasicPane {
} }
} }
}); });
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
} }
@ -143,14 +138,15 @@ public class CellWidgetPropertyPane extends BasicPane {
return newWidget; return newWidget;
} }
@Override
/** /**
*检测是否有效 * 检测是否有效
*
* @throws Exception e
*/ */
@Override
public void checkValid() throws Exception { public void checkValid() throws Exception {
this.cellEditorDefPane.checkValid(); this.cellEditorDefPane.checkValid();
} }
} }

97
designer/src/com/fr/design/mainframe/cell/CellEditorPane.java

@ -1,6 +1,15 @@
package com.fr.design.mainframe.cell; package com.fr.design.mainframe.cell;
import com.fr.design.dialog.BasicPane; import com.fr.design.gui.iscrollbar.UIScrollBar;
import com.fr.design.mainframe.CellElementPropertyPane;
import com.fr.quickeditor.cellquick.CellElementBarLayout;
import javax.swing.*;
import java.awt.*;
import java.awt.event.AdjustmentEvent;
import java.awt.event.AdjustmentListener;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
/** /**
* 右侧单元格元素面板抽象类 * 右侧单元格元素面板抽象类
@ -9,7 +18,20 @@ import com.fr.design.dialog.BasicPane;
* @version 2017年7月25日 * @version 2017年7月25日
* @since 9.0 * @since 9.0
*/ */
public abstract class CellEditorPane extends BasicPane { public abstract class CellEditorPane extends JPanel {
/*滚动条相关配置*/
private static final int MAXVALUE = 100;
private static final int TITLE_HEIGHT = 95;
private static final int CONTENT_PANE_WIDTH_GAP = 3;
private static final int SCROLLBAR_WIDTH = 7;
private static final int MOUSE_WHEEL_SPEED = 5;
private int maxHeight = 280;
private JPanel leftContentPane;
private UIScrollBar scrollBar;
protected abstract JPanel createContentPane();
public abstract String getIconPath(); public abstract String getIconPath();
@ -22,7 +44,76 @@ public abstract class CellEditorPane extends BasicPane {
/** /**
* 更新面板数据 * 更新面板数据
*
*/ */
public abstract void populate(); public abstract void populate();
protected void createScrollPane() {
leftContentPane = this.createContentPane();
this.prepareScrollBar();
leftContentPane.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 0, this.getBackground()));
this.setLayout(new CellElementBarLayout(leftContentPane) {
@Override
public void layoutContainer(Container parent) {
maxHeight = CellElementPropertyPane.getInstance().getHeight() - TITLE_HEIGHT;
int beginY;
if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) {
beginY = 0;
} else {
int preferredHeight = leftContentPane.getPreferredSize().height;
int value = scrollBar.getValue();
beginY = value * (preferredHeight - maxHeight) / (MAXVALUE - scrollBar.getVisibleAmount());
}
int width = parent.getWidth();
int height = parent.getHeight();
if (leftContentPane.getPreferredSize().height > maxHeight) {
leftContentPane.setBounds(0, -beginY, width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, height + beginY);
scrollBar.setBounds(width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, 0, SCROLLBAR_WIDTH + CONTENT_PANE_WIDTH_GAP, height);
} else {
leftContentPane.setBounds(0, 0, width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, height);
}
}
});
this.add(scrollBar);
this.add(leftContentPane);
}
private void prepareScrollBar() {
scrollBar = new UIScrollBar(UIScrollBar.VERTICAL) {
@Override
public int getVisibleAmount() {
int preferredHeight = leftContentPane.getPreferredSize().height;
int e = MAXVALUE * (maxHeight) / preferredHeight;
setVisibleAmount(e);
return e;
}
@Override
public int getMaximum() {
return MAXVALUE;
}
};
scrollBar.addAdjustmentListener(new AdjustmentListener() {
@Override
public void adjustmentValueChanged(AdjustmentEvent e) {
doLayout();
}
});
this.addMouseWheelListener(new MouseWheelListener() {
@Override
public void mouseWheelMoved(MouseWheelEvent e) {
int value = scrollBar.getValue();
value += MOUSE_WHEEL_SPEED * e.getWheelRotation();
scrollBar.setValue(value);
doLayout();
}
});
scrollBar.setPreferredSize(new Dimension(SCROLLBAR_WIDTH + CONTENT_PANE_WIDTH_GAP, this.getHeight()));
scrollBar.setBlockIncrement(SCROLLBAR_WIDTH + CONTENT_PANE_WIDTH_GAP);
scrollBar.setBorder(BorderFactory.createMatteBorder(0, CONTENT_PANE_WIDTH_GAP, 0, 0, this.getBackground()));
}
} }

29
designer/src/com/fr/design/widget/WidgetPane.java

@ -12,7 +12,6 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.CellWidgetPropertyPane; import com.fr.design.mainframe.CellWidgetPropertyPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.widget.btn.ButtonConstants; import com.fr.design.widget.btn.ButtonConstants;
import com.fr.form.ui.Button; import com.fr.form.ui.Button;
@ -66,7 +65,7 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
this.addAttributeChangeListener(listener); this.addAttributeChangeListener(listener);
} }
public JPanel initNorthPane(){ public JPanel initNorthPane() {
UILabel emptyLabel = new UILabel(); UILabel emptyLabel = new UILabel();
emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
@ -81,7 +80,7 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
return jPanel; return jPanel;
} }
protected CellWidgetCardPane initWidgetCardPane(ElementCasePane pane){ protected CellWidgetCardPane initWidgetCardPane(ElementCasePane pane) {
return new CellWidgetCardPane(pane); return new CellWidgetCardPane(pane);
} }
@ -94,7 +93,6 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
@Override @Override
public void attributeChange() { public void attributeChange() {
CellWidgetPropertyPane.getInstance().update(); CellWidgetPropertyPane.getInstance().update();
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
} }
}; };
@ -131,30 +129,29 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
editorTypeComboBox.setSelectedIndex(-1); editorTypeComboBox.setSelectedIndex(-1);
return; return;
} }
// 预定义组件
if (widget instanceof NameWidget) { if (widget instanceof NameWidget) {
String name = ((NameWidget) widget).getName(); String name = ((NameWidget) widget).getName();
shouldFireSelectedEvent = false; shouldFireSelectedEvent = false;
editorTypeComboBox.setSelectedItem(new Item(name, name)); editorTypeComboBox.setSelectedItem(new Item(name, name));
shouldFireSelectedEvent = true; shouldFireSelectedEvent = true;
cellEditorCardPane.populate(widget); cellEditorCardPane.populate(widget);
return;
} }
// 内置组件
else {
Class clazz = widget.getClass();
if (ArrayUtils.contains(ButtonConstants.CLASSES4BUTTON, clazz)) {
clazz = Button.class;
}
cellEditorCardPane.populate(widget);
Class clazz = widget.getClass(); shouldFireSelectedEvent = false;
if (ArrayUtils.contains(ButtonConstants.CLASSES4BUTTON, clazz)) { editorTypeComboBox.setSelectedItemByWidgetClass(clazz);
clazz = Button.class; shouldFireSelectedEvent = true;
} }
cellEditorCardPane.populate(widget);
shouldFireSelectedEvent = false;
editorTypeComboBox.setSelectedItemByWidgetClass(clazz);
shouldFireSelectedEvent = true;
removeAttributeChangeListener(); removeAttributeChangeListener();
initAllListeners(); initAllListeners();
this.addAttributeChangeListener(listener); this.addAttributeChangeListener(listener);
} }
public Widget update() { public Widget update() {

5
designer/src/com/fr/design/widget/ui/PasswordDefinePane.java

@ -1,5 +1,6 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.gui.frpane.RegFieldPane;
import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.frpane.RegPane;
import com.fr.form.ui.Password; import com.fr.form.ui.Password;
import com.fr.form.ui.TextEditor; import com.fr.form.ui.TextEditor;
@ -12,7 +13,7 @@ public class PasswordDefinePane extends TextFieldEditorDefinePane {
return new Password(); return new Password();
} }
protected RegPane createRegPane() { protected RegFieldPane createRegPane() {
return new RegPane(RegPane.PASSWORD_REG_TYPE); return new RegFieldPane(RegPane.PASSWORD_REG_TYPE);
} }
} }

5
designer/src/com/fr/design/widget/ui/TextAreaDefinePane.java

@ -1,5 +1,6 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.gui.frpane.RegFieldPane;
import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.frpane.RegPane;
import com.fr.form.ui.TextArea; import com.fr.form.ui.TextArea;
import com.fr.form.ui.TextEditor; import com.fr.form.ui.TextEditor;
@ -12,7 +13,7 @@ public class TextAreaDefinePane extends TextFieldEditorDefinePane {
return new TextArea(); return new TextArea();
} }
protected RegPane createRegPane() { protected RegFieldPane createRegPane() {
return new RegPane(RegPane.TEXTAREA_REG_TYPE); return new RegFieldPane(RegPane.TEXTAREA_REG_TYPE);
} }
} }

20
designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java

@ -1,5 +1,6 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.gui.frpane.RegFieldPane;
import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.frpane.RegPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.TextEditor; import com.fr.form.ui.TextEditor;
@ -9,13 +10,11 @@ import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor> { public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor> {
protected RegPane regPane; protected RegFieldPane regPane;
private WaterMarkDictPane waterMarkDictPane; private WaterMarkDictPane waterMarkDictPane;
public TextFieldEditorDefinePane() { public TextFieldEditorDefinePane() {
@ -51,13 +50,6 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
waterMarkDictPane.removeInputKeyListener(this); waterMarkDictPane.removeInputKeyListener(this);
} }
}); });
//监听填写规则下拉框的值的变化
regPane.getRegComboBox().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
RegExp regExp = (RegExp) regPane.getRegComboBox().getSelectedItem();
}
});
JPanel content = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel content = FRGUIPaneFactory.createBorderLayout_S_Pane();
waterMarkDictPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); waterMarkDictPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
content.add(waterMarkDictPane, BorderLayout.CENTER); content.add(waterMarkDictPane, BorderLayout.CENTER);
@ -70,8 +62,8 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
} }
protected RegPane createRegPane() { protected RegFieldPane createRegPane() {
return new RegPane(); return new RegFieldPane();
} }
@Override @Override
@ -81,14 +73,14 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
@Override @Override
protected void populateSubFieldEditorBean(TextEditor e) { protected void populateSubFieldEditorBean(TextEditor e) {
this.regPane.populate(e.getRegex()); this.regPane.populate(e);
waterMarkDictPane.populate(e); waterMarkDictPane.populate(e);
} }
@Override @Override
protected TextEditor updateSubFieldEditorBean() { protected TextEditor updateSubFieldEditorBean() {
TextEditor ob = newTextEditorInstance(); TextEditor ob = newTextEditorInstance();
ob.setRegex(this.regPane.update()); this.regPane.update(ob);
waterMarkDictPane.update(ob); waterMarkDictPane.update(ob);
return ob; return ob;

261
designer/src/com/fr/quickeditor/CellQuickEditor.java

@ -18,6 +18,7 @@ import com.fr.design.menu.ShortCut;
import com.fr.design.selection.QuickEditor; import com.fr.design.selection.QuickEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.quickeditor.cellquick.CellElementBarLayout;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.stable.ColumnRow; import com.fr.stable.ColumnRow;
@ -33,34 +34,145 @@ import java.util.ArrayList;
*/ */
public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> { public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
/*面板配置*/
protected UITextField columnRowTextField;
protected TemplateCellElement cellElement;
/*占位label*/
protected static final Dimension LABEL_DIMENSION = new Dimension(60, 20);
protected static final UILabel EMPTY_LABEL = new UILabel();
protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3;
static {
EMPTY_LABEL.setPreferredSize(LABEL_DIMENSION);
}
/*滚动条相关配置*/ /*滚动条相关配置*/
private static final int MAXVALUE = 100; private static final int MAXVALUE = 100;
private static final int TITLE_HEIGHT = 50; private static final int CONTENT_PANE_WIDTH_GAP = 3;
private static final int MOUSE_WHEEL_SPEED = 5; private static final int MOUSE_WHEEL_SPEED = 5;
private static final int CONTENT_PANE_WIDTH_GAP = 4; private static final int SCROLLBAR_WIDTH = 7;
private static final int SCROLLBAR_WIDTH = 8;
private int maxHeight = 280; private int maxHeight = 280;
/*面板配置*/ private static final int TITLE_HEIGHT = 50;
protected UITextField columnRowTextField;
protected TemplateCellElement cellElement;
private UIComboBox comboBox; private UIComboBox comboBox;
private UpdateAction[] cellInsertActions; private UpdateAction[] cellInsertActions;
private int selectedIndex; private int selectedIndex;
private int currentSelectedIndex;
private JPanel leftContentPane; private JPanel leftContentPane;
private UIScrollBar scrollBar; private UIScrollBar scrollBar;
/*占位label*/
protected static UILabel emptyLabel = new UILabel();
private int currentSelectedIndex; public CellQuickEditor() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p};
JComponent centerBody = createCenterBody();
JPanel topContent = initTopContent();
if (isScrollAll()) {
prepareScrollBar();
topContent.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 0, this.getBackground()));
centerBody.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 0, this.getBackground()));
Component[][] components = new Component[][]{
new Component[]{topContent, null},
new Component[]{centerBody, null}
};
leftContentPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
this.setLayout(new CellElementBarLayout(leftContentPane) {
@Override
public void layoutContainer(Container parent) {
maxHeight = CellElementPropertyPane.getInstance().getHeight() - TITLE_HEIGHT;
int beginY;
if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) {
beginY = 0;
} else {
int preferredHeight = leftContentPane.getPreferredSize().height;
int value = scrollBar.getValue();
beginY = value * (preferredHeight - maxHeight) / (MAXVALUE - scrollBar.getVisibleAmount());
}
int width = parent.getWidth();
int height = parent.getHeight();
if (leftContentPane.getPreferredSize().height > maxHeight) {
leftContentPane.setBounds(0, -beginY, width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, height + beginY);
scrollBar.setBounds(width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, 0, SCROLLBAR_WIDTH + CONTENT_PANE_WIDTH_GAP, height);
} else {
leftContentPane.setBounds(0, 0, width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, height);
}
leftContentPane.validate();
}
});
this.add(scrollBar);
this.add(leftContentPane);
} else {
topContent.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 10, this.getBackground()));
centerBody.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, this.getBackground()));
Component[][] components = new Component[][]{
new Component[]{topContent, null},
new Component[]{centerBody, null}
};
this.setLayout(new BorderLayout());
this.add(TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP), BorderLayout.CENTER);
}
}
static { /**
emptyLabel.setPreferredSize(new Dimension(60, 20)); * 初始化详细信息面板
*
* @return JComponent 待显示的详细信息面板
*/
public abstract JComponent createCenterBody();
/**
* 是否全局具有滚动条
*
* @return boolean 是否全局具有滚动条
*/
public abstract boolean isScrollAll();
/**
* 初始化下拉框中的类型
*
* @return JComponent 待显示的详细信息面板
*/
public abstract Object getComboBoxSelected();
/**
* 刷新
*/
@Override
protected void refresh() {
CellSelection cs = (CellSelection) tc.getSelection();
ColumnRow columnRow = ColumnRow.valueOf(cs.getColumn(), cs.getRow());
columnRowTextField.setText(columnRow.toString());
cellElement = tc.getEditingElementCase().getTemplateCellElement(cs.getColumn(), cs.getRow());
refreshDetails();
} }
protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3; /**
* 刷新详细信息
*/
protected abstract void refreshDetails();
public CellQuickEditor() {
private JPanel initTopContent() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p};
UILabel cellLabel = new UILabel(Inter.getLocText("FR-Designer_Cell"));
cellLabel.setPreferredSize(LABEL_DIMENSION);
UILabel insertContentLabel = new UILabel(Inter.getLocText("FR-Designer_Insert_Cell_Element"));
insertContentLabel.setPreferredSize(LABEL_DIMENSION);
UIComboBox cellElementEditComboBox = initCellElementEditComboBox();
Component[][] components = new Component[][]{
new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()},
new Component[]{insertContentLabel, cellElementEditComboBox},
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
}
private void prepareScrollBar() {
scrollBar = new UIScrollBar(UIScrollBar.VERTICAL) { scrollBar = new UIScrollBar(UIScrollBar.VERTICAL) {
@Override @Override
public int getVisibleAmount() { public int getVisibleAmount() {
@ -74,7 +186,6 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
public int getMaximum() { public int getMaximum() {
return MAXVALUE; return MAXVALUE;
} }
}; };
scrollBar.addAdjustmentListener(new AdjustmentListener() { scrollBar.addAdjustmentListener(new AdjustmentListener() {
@ -95,43 +206,11 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
} }
}); });
double p = TableLayout.PREFERRED; scrollBar.setPreferredSize(new Dimension(SCROLLBAR_WIDTH + CONTENT_PANE_WIDTH_GAP, this.getHeight()));
double f = TableLayout.FILL; scrollBar.setBlockIncrement(SCROLLBAR_WIDTH + CONTENT_PANE_WIDTH_GAP);
double[] columnSize = {p, f}; scrollBar.setBorder(BorderFactory.createMatteBorder(0, CONTENT_PANE_WIDTH_GAP, 0, 0, this.getBackground()));
double[] rowSize = {p, p};
JComponent centerBody = createCenterBody();
centerBody.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 0, this.getBackground()));
Component[][] components = new Component[][]{
new Component[]{initTopContent(), null},
new Component[]{centerBody, null}
};
leftContentPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
this.setLayout(new BarLayout());
this.add(scrollBar);
this.add(leftContentPane);
}
private JPanel initTopContent() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p};
UILabel cellLabel = new UILabel(Inter.getLocText("Cell"));
cellLabel.setPreferredSize(new Dimension(60, 20));
UILabel insertContentLabel = new UILabel(Inter.getLocText("HF-Insert_Content"));
insertContentLabel.setPreferredSize(new Dimension(60, 20));
UIComboBox cellElementEditComboBox = initCellElementEditComboBox();
Component[][] components = new Component[][]{
new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()},
new Component[]{insertContentLabel, cellElementEditComboBox},
};
JPanel topContent = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
topContent.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 0));
return topContent;
} }
/** /**
* 初始化添加按钮 * 初始化添加按钮
* *
@ -206,88 +285,4 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
}); });
return columnRowTextField; return columnRowTextField;
} }
/**
* 初始化详细信息面板
*
* @return JComponent 待显示的详细信息面板
*/
public abstract JComponent createCenterBody();
/**
* 初始化下拉框中的类型
*
* @return JComponent 待显示的详细信息面板
*/
public abstract Object getComboBoxSelected();
/**
* 刷新
*/
@Override
protected void refresh() {
CellSelection cs = (CellSelection) tc.getSelection();
ColumnRow columnRow = ColumnRow.valueOf(cs.getColumn(), cs.getRow());
columnRowTextField.setText(columnRow.toString());
cellElement = tc.getEditingElementCase().getTemplateCellElement(cs.getColumn(), cs.getRow());
refreshDetails();
}
/**
* 刷新详细信息
*/
protected abstract void refreshDetails();
/**
* 属性面板的滚动条和内容区域的布局管理类
* yaoh.wu 由于这边不能继承{@link com.fr.design.mainframe.AbstractAttrPane.BarLayout}所以冗余了一份滚动条代码进来
*
* @see com.fr.design.mainframe.AbstractAttrPane.BarLayout
*/
protected class BarLayout implements LayoutManager {
@Override
public void addLayoutComponent(String name, Component comp) {
}
@Override
public void removeLayoutComponent(Component comp) {
}
@Override
public Dimension preferredLayoutSize(Container parent) {
return leftContentPane.getPreferredSize();
}
@Override
public Dimension minimumLayoutSize(Container parent) {
return leftContentPane.getMinimumSize();
}
@Override
public void layoutContainer(Container parent) {
maxHeight = CellElementPropertyPane.getInstance().getHeight() - TITLE_HEIGHT;
int beginY;
if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) {
beginY = 0;
} else {
int preferredHeight = leftContentPane.getPreferredSize().height;
int value = scrollBar.getValue();
beginY = value * (preferredHeight - maxHeight) / (MAXVALUE - scrollBar.getVisibleAmount());
}
int width = parent.getWidth();
int height = parent.getHeight();
if (leftContentPane.getPreferredSize().height > maxHeight) {
leftContentPane.setBounds(0, -beginY, width - scrollBar.getWidth() - CONTENT_PANE_WIDTH_GAP, height + beginY);
scrollBar.setBounds(width - scrollBar.getWidth() - 1, 0, scrollBar.getWidth(), height);
} else {
leftContentPane.setBounds(0, 0, width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, height);
}
leftContentPane.validate();
}
}
} }

7
designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java

@ -35,7 +35,7 @@ public class CellBiasTextPainterEditor extends CellQuickEditor {
}); });
editButton.setOpaque(false); editButton.setOpaque(false);
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, editButton}}, new Component[]{EMPTY_LABEL, editButton}},
new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER); new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content; return content;
@ -68,4 +68,9 @@ public class CellBiasTextPainterEditor extends CellQuickEditor {
protected void refreshDetails() { protected void refreshDetails() {
} }
@Override
public boolean isScrollAll() {
return true;
}
} }

34
designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -98,6 +98,11 @@ public class CellDSColumnEditor extends CellQuickEditor {
return centerPane; return centerPane;
} }
@Override
public boolean isScrollAll() {
return false;
}
/** /**
* 内容全部重新动态生成不然容易出错 * 内容全部重新动态生成不然容易出错
* 刷新详细信息面板 * 刷新详细信息面板
@ -158,9 +163,11 @@ public class CellDSColumnEditor extends CellQuickEditor {
paneList = new ArrayList<>(); paneList = new ArrayList<>();
/*基本设置面板*/ /*基本设置面板*/
DSColumnBasicEditorPane cellDSColumnBasicPane = new DSColumnBasicEditorPane(); DSColumnBasicEditorPane cellDSColumnBasicPane = new DSColumnBasicEditorPane();
paneList.add(cellDSColumnBasicPane); paneList.add(cellDSColumnBasicPane);
/*高级设置面板*/ /*高级设置面板*/
cellDSColumnAdvancedPane = new DSColumnAdvancedEditorPane(); cellDSColumnAdvancedPane = new DSColumnAdvancedEditorPane();
paneList.add(cellDSColumnAdvancedPane); paneList.add(cellDSColumnAdvancedPane);
} }
@ -209,7 +216,6 @@ public class CellDSColumnEditor extends CellQuickEditor {
}; };
DSColumnBasicEditorPane() { DSColumnBasicEditorPane() {
this.setLayout(new BorderLayout());
dataPane = new SelectedDataColumnPane(true, true, tc, cellElement); dataPane = new SelectedDataColumnPane(true, true, tc, cellElement);
groupPane = new ResultSetGroupDockingPane(tc); groupPane = new ResultSetGroupDockingPane(tc);
dataPane.addListener(dataListener); dataPane.addListener(dataListener);
@ -217,7 +223,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
double[] rowSize = {P}, columnSize = {P, F}; double[] rowSize = {P}, columnSize = {P, F};
UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Filter_Conditions")); UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Filter_Conditions"));
uiLabel.setPreferredSize(new Dimension(60, 20)); uiLabel.setPreferredSize(LABEL_DIMENSION);
UIButton uiButton = new UIButton(); UIButton uiButton = new UIButton();
if (tc != null) { if (tc != null) {
//第一次初始化时tc为空,会引发NullPointerException //第一次初始化时tc为空,会引发NullPointerException
@ -231,8 +237,9 @@ public class CellDSColumnEditor extends CellQuickEditor {
new Component[]{uiLabel, uiButton} new Component[]{uiLabel, uiButton}
}; };
conditionPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); conditionPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
this.add(this.createContentPane(), BorderLayout.CENTER); this.createScrollPane();
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
} }
@ -265,7 +272,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
* *
* @return content JPanel * @return content JPanel
*/ */
private JPanel createContentPane() { protected JPanel createContentPane() {
double[] columnSize = {F}; double[] columnSize = {F};
double[] rowSize = {P, P, P}; double[] rowSize = {P, P, P};
@ -303,9 +310,8 @@ public class CellDSColumnEditor extends CellQuickEditor {
public DSColumnAdvancedEditorPane() { public DSColumnAdvancedEditorPane() {
this.setLayout(new BorderLayout());
this.add(this.createContentPane(), BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.createScrollPane();
} }
@ -415,7 +421,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
* *
* @return 内容面板 * @return 内容面板
*/ */
private JPanel createContentPane() { protected JPanel createContentPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
//结果集排序 //结果集排序
sortPane = new ResultSetSortConfigPane(); sortPane = new ResultSetSortConfigPane();
@ -481,14 +487,13 @@ public class CellDSColumnEditor extends CellQuickEditor {
multiNumSpinner = new UISpinner(1, 10000, 1, 1); multiNumSpinner = new UISpinner(1, 10000, 1, 1);
//数据倍数 //数据倍数
UILabel multipleLabel = new UILabel(Inter.getLocText("Column_Multiple")); UILabel multipleLabel = new UILabel(Inter.getLocText("Column_Multiple"));
multipleLabel.setPreferredSize(new Dimension(60, 20));
multiPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ multiPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{ new Component[]{
multipleLabel, multiNumSpinner multipleLabel, multiNumSpinner
} }
}, new double[]{P}, new double[]{P, F}, HGAP, VGAP }, new double[]{P}, new double[]{P, F}, HGAP, VGAP
); );
multiPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); multiPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
multiNumPane.add(multiPane); multiNumPane.add(multiPane);
useMultiplyNumCheckBox.addActionListener(new ActionListener() { useMultiplyNumCheckBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -563,7 +568,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
centerPane.add(new JPanel(), "none"); centerPane.add(new JPanel(), "none");
centerPane.add(formulaField, "content"); centerPane.add(formulaField, "content");
UILabel sortLabel = new UILabel(Inter.getLocText("Sort-Sort_Order")); UILabel sortLabel = new UILabel(Inter.getLocText("Sort-Sort_Order"));
sortLabel.setPreferredSize(new Dimension(60, 20)); sortLabel.setPreferredSize(LABEL_DIMENSION);
sortTypePane.addChangeListener(new ChangeListener() { sortTypePane.addChangeListener(new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
@ -982,7 +987,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
public CustomValuePane() { public CustomValuePane() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
UILabel customValueLabel = new UILabel(Inter.getLocText("FR-Designer_Display_Value")); UILabel customValueLabel = new UILabel(Inter.getLocText("FR-Designer_Display_Value"));
customValueLabel.setPreferredSize(new Dimension(60, 20)); customValueLabel.setPreferredSize(LABEL_DIMENSION);
formulaField = new JFormulaField(DEFAULT_VALUE); formulaField = new JFormulaField(DEFAULT_VALUE);
this.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ this.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{customValueLabel, formulaField}, new Component[]{customValueLabel, formulaField},
@ -994,14 +999,13 @@ public class CellDSColumnEditor extends CellQuickEditor {
Object value = cellElement.getValue(); Object value = cellElement.getValue();
if (value != null && value instanceof DSColumn) { if (value != null && value instanceof DSColumn) {
DSColumn dSColumn = (DSColumn) value; DSColumn dSColumn = (DSColumn) value;
//formula //formula
String valueFormula = dSColumn.getResult(); String valueFormula = dSColumn.getResult();
if (valueFormula == null) { if (valueFormula != null) {
valueFormula = DEFAULT_VALUE; formulaField.populate(valueFormula);
} }
formulaField.populateElement(cellElement); formulaField.populateElement(cellElement);
formulaField.populate(valueFormula);
} }
} }
} }

41
designer/src/com/fr/quickeditor/cellquick/CellElementBarLayout.java

@ -0,0 +1,41 @@
package com.fr.quickeditor.cellquick;
import javax.swing.*;
import java.awt.*;
/**
* 单元格元素面板的滚动条
*
* @see com.fr.design.mainframe.AbstractAttrPane.BarLayout
*/
public abstract class CellElementBarLayout implements LayoutManager {
private JPanel leftContentPane;
protected CellElementBarLayout(JPanel leftContentPane) {
this.leftContentPane = leftContentPane;
}
@Override
public void addLayoutComponent(String name, Component comp) {
}
@Override
public void removeLayoutComponent(Component comp) {
}
@Override
public Dimension preferredLayoutSize(Container parent) {
return leftContentPane.getPreferredSize();
}
@Override
public Dimension minimumLayoutSize(Container parent) {
return leftContentPane.getMinimumSize();
}
@Override
public abstract void layoutContainer(Container parent);
}

7
designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java

@ -121,7 +121,7 @@ public class CellFormulaQuickEditor extends CellQuickEditor {
content.add(pane, BorderLayout.NORTH); content.add(pane, BorderLayout.NORTH);
return TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ return TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, content}}, new Component[]{EMPTY_LABEL, content}},
new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP); new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP);
} }
@ -203,4 +203,9 @@ public class CellFormulaQuickEditor extends CellQuickEditor {
formulaTextField.getDocument().addDocumentListener(documentListener); formulaTextField.getDocument().addDocumentListener(documentListener);
} }
@Override
public boolean isScrollAll() {
return true;
}
} }

7
designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java

@ -43,7 +43,7 @@ public class CellImageQuickEditor extends CellQuickEditor {
}); });
editButton.setOpaque(false); editButton.setOpaque(false);
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, editButton}}, new Component[]{EMPTY_LABEL, editButton}},
new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER); new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content; return content;
@ -72,6 +72,11 @@ public class CellImageQuickEditor extends CellQuickEditor {
} }
@Override
public boolean isScrollAll() {
return true;
}
@Override @Override
public Object getComboBoxSelected() { public Object getComboBoxSelected() {
return ActionFactory.createAction(ImageCellAction.class); return ActionFactory.createAction(ImageCellAction.class);

7
designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java

@ -30,7 +30,7 @@ public class CellRichTextEditor extends CellQuickEditor {
richTextButton = new UIButton(); richTextButton = new UIButton();
richTextButton.setOpaque(false); richTextButton.setOpaque(false);
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, richTextButton}}, new Component[]{EMPTY_LABEL, richTextButton}},
new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER); new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content; return content;
@ -49,4 +49,9 @@ public class CellRichTextEditor extends CellQuickEditor {
richTextButton.setAction(subReportCellAction); richTextButton.setAction(subReportCellAction);
} }
@Override
public boolean isScrollAll() {
return true;
}
} }

5
designer/src/com/fr/quickeditor/cellquick/CellStringQuickEditor.java

@ -90,6 +90,11 @@ public class CellStringQuickEditor extends CellQuickEditor {
return content; return content;
} }
@Override
public boolean isScrollAll() {
return true;
}
private void changeReportPaneCell(String tmpText) { private void changeReportPaneCell(String tmpText) {
isEditing = true; isEditing = true;

6
designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java

@ -31,7 +31,7 @@ public class CellSubReportEditor extends CellQuickEditor {
subReportButton = new UIButton(); subReportButton = new UIButton();
subReportButton.setOpaque(false); subReportButton.setOpaque(false);
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, subReportButton}}, new Component[]{EMPTY_LABEL, subReportButton}},
new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER); new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content; return content;
@ -50,4 +50,8 @@ public class CellSubReportEditor extends CellQuickEditor {
return ActionFactory.createAction(SubReportCellAction.class); return ActionFactory.createAction(SubReportCellAction.class);
} }
@Override
public boolean isScrollAll() {
return true;
}
} }

5
designer_base/src/com/fr/design/condition/LiteConditionPane.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.data.DataConstants; import com.fr.data.DataConstants;
import com.fr.data.condition.*; import com.fr.data.condition.*;
import com.fr.data.core.Compare;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.formula.FormulaFactory; import com.fr.design.formula.FormulaFactory;
@ -21,6 +22,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.data.Condition; import com.fr.general.data.Condition;
import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.TreeExpansionEvent; import javax.swing.event.TreeExpansionEvent;
@ -165,6 +167,9 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
TreePath selectedTreePath = conditionsTree.getSelectionPath(); TreePath selectedTreePath = conditionsTree.getSelectionPath();
if (selectedTreePath == null) { if (selectedTreePath == null) {
// 清空编辑框
defaultConditionPane.populateBean((T)new ObjectCondition(new Compare(Compare.EQUALS, StringUtils.EMPTY)));
formulaTextArea.setText(StringUtils.EMPTY);
return; return;
} }

108
designer_base/src/com/fr/design/gui/frpane/RegFieldPane.java

@ -0,0 +1,108 @@
package com.fr.design.gui.frpane;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.TextEditor;
import com.fr.form.ui.reg.NoneReg;
import com.fr.form.ui.reg.RegExp;
import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*;
/**
* Created by kerry on 2017/9/4.
*/
public class RegFieldPane extends RegPane {
protected RegErrorMsgPane regErrorMsgPane;
public RegFieldPane(){
this(ALL_REG_TYPE);
}
public RegFieldPane(RegExp[] types) {
super(types);
initComponents();
}
public void initComponents() {
regErrorMsgPane = new RegErrorMsgPane();
final RegChangeListener regChangeListener = new RegChangeListener() {
@Override
public void regChangeAction() {
RegExp regExp = (RegExp)getRegComboBox().getSelectedItem();
if(regExp instanceof NoneReg){
regErrorMsgPane.setVisible(false);
return;
}
regErrorMsgPane.setVisible(true);
}
};
this.addRegChangeListener(regChangeListener);
this.add(regErrorMsgPane, BorderLayout.CENTER);
}
@Override
protected String title4PopupWindow() {
return "RegFieldPane";
}
public void populate(TextEditor textEditor) {
populate(textEditor.getRegex());
regErrorMsgPane.populate(textEditor);
}
public void update(TextEditor textEditor) {
textEditor.setRegex(update());
regErrorMsgPane.update(textEditor);
}
private static class RegErrorMsgPane extends BasicPane {
private UITextField regErrorMsgField;
public RegErrorMsgPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
initRegErrorMsgField();
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")), regErrorMsgField}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
this.add(panel);
}
private void initRegErrorMsgField() {
regErrorMsgField = new UITextField();
regErrorMsgField.getDocument().addDocumentListener(new DocumentListener() {
public void changedUpdate(DocumentEvent e) {
regErrorMsgField.setToolTipText(regErrorMsgField.getText());
}
public void insertUpdate(DocumentEvent e) {
regErrorMsgField.setToolTipText(regErrorMsgField.getText());
}
public void removeUpdate(DocumentEvent e) {
regErrorMsgField.setToolTipText(regErrorMsgField.getText());
}
});
}
@Override
protected String title4PopupWindow() {
return "RegErrorMsg";
}
public void populate(TextEditor textEditor) {
regErrorMsgField.setText(textEditor.getRegErrorMessage());
}
public void update(TextEditor textEditor) {
textEditor.setRegErrorMessage(regErrorMsgField.getText());
}
}
}

72
designer_base/src/com/fr/design/gui/frpane/RegPane.java

@ -16,8 +16,6 @@ import com.fr.general.Inter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -55,7 +53,6 @@ public class RegPane extends BasicPane {
private RegPhonePane regPhonePane; private RegPhonePane regPhonePane;
private DefaultRegPane defaultRegPane; private DefaultRegPane defaultRegPane;
private CustomRegRexPane customRegRexPane; private CustomRegRexPane customRegRexPane;
protected RegErrorMsgPane regErrorMsgPane;
public UIComboBox getRegComboBox(){ public UIComboBox getRegComboBox(){
@ -78,9 +75,10 @@ public class RegPane extends BasicPane {
regComboBox.setRenderer(listCellRender); regComboBox.setRenderer(listCellRender);
JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Input_Rule")), regComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Input_Rule")), regComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
this.add(contentPane, BorderLayout.NORTH); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.add(contentPane, BorderLayout.NORTH);
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
regErrorMsgPane = new RegErrorMsgPane();
final JPanel cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); final JPanel cardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
detailedCardLayout = new CardLayout(); detailedCardLayout = new CardLayout();
cardPane.setLayout(detailedCardLayout); cardPane.setLayout(detailedCardLayout);
@ -89,8 +87,8 @@ public class RegPane extends BasicPane {
cardPane.add((regPhonePane = new RegPhonePane()), "Phone"); cardPane.add((regPhonePane = new RegPhonePane()), "Phone");
cardPane.add((customRegRexPane = new CustomRegRexPane()), "Custom"); cardPane.add((customRegRexPane = new CustomRegRexPane()), "Custom");
centerPane.add(cardPane, BorderLayout.NORTH); centerPane.add(cardPane, BorderLayout.NORTH);
centerPane.add(regErrorMsgPane, BorderLayout.CENTER); jPanel.add(centerPane, BorderLayout.CENTER);
this.add(centerPane, BorderLayout.CENTER); this.add(jPanel, BorderLayout.NORTH);
regComboBox.addActionListener(new ActionListener(){ regComboBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
RegExp regExp = (RegExp)regComboBox.getSelectedItem(); RegExp regExp = (RegExp)regComboBox.getSelectedItem();
@ -113,11 +111,6 @@ public class RegPane extends BasicPane {
} }
fireRegChangeAction(); fireRegChangeAction();
} }
if(regExp instanceof NoneReg){
regErrorMsgPane.setVisible(false);
return;
}
regErrorMsgPane.setVisible(true);
} }
}); });
} }
@ -150,12 +143,10 @@ public class RegPane extends BasicPane {
} else { } else {
defaultRegPane.populate(regex); defaultRegPane.populate(regex);
} }
regErrorMsgPane.populate(regex);
} }
public RegExp update(){ public RegExp update(){
RegExp regExp = (RegExp)regComboBox.getSelectedItem(); RegExp regExp = (RegExp)regComboBox.getSelectedItem();
regErrorMsgPane.update();
if (regExp instanceof LengthReg){ if (regExp instanceof LengthReg){
return regLengthPane.update(); return regLengthPane.update();
} else if(regExp instanceof PhoneReg) { } else if(regExp instanceof PhoneReg) {
@ -174,6 +165,9 @@ public class RegPane extends BasicPane {
} }
} }
private static abstract class DisplayPane extends BasicPane { private static abstract class DisplayPane extends BasicPane {
public abstract void populate(RegExp regRex); public abstract void populate(RegExp regRex);
@ -481,56 +475,6 @@ public class RegPane extends BasicPane {
} }
} }
private static class RegErrorMsgPane extends DisplayPane{
private UITextField regErrorMsgField;
public RegErrorMsgPane(){
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
initRegErrorMsgField();
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")), regErrorMsgField}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
this.add(panel);
}
private void initRegErrorMsgField(){
regErrorMsgField = new UITextField();
regErrorMsgField.getDocument().addDocumentListener(new DocumentListener() {
public void changedUpdate(DocumentEvent e) {
regErrorMsgField.setToolTipText(regErrorMsgField.getText());
}
public void insertUpdate(DocumentEvent e) {
regErrorMsgField.setToolTipText(regErrorMsgField.getText());
}
public void removeUpdate(DocumentEvent e) {
regErrorMsgField.setToolTipText(regErrorMsgField.getText());
}
});
}
@Override
protected String title4PopupWindow() {
return "CUSTOM";
}
@Override
public void populate(RegExp regRex) {
if (!(regRex instanceof CustomReg)){
return;
}
regErrorMsgField.setText(regRex.toRegText());
}
@Override
public RegExp update() {
return new CustomReg(regErrorMsgField.getText());
}
public boolean isEmpty() {
return StringUtils.isEmpty(regErrorMsgField.getText());
}
}
ListCellRenderer listCellRender = new UIComboBoxRenderer(){ ListCellRenderer listCellRender = new UIComboBoxRenderer(){
@Override @Override

6
designer_base/src/com/fr/design/locale/designer.properties

@ -71,7 +71,7 @@ FR-Designer_Button-Icon=
FR-Designer_Button-Name= FR-Designer_Button-Name=
FR-Designer_Button-Type= FR-Designer_Button-Type=
FR-Designer_CardLayout= FR-Designer_CardLayout=
FR-Designer_Cell= FR-Designer_Cell=Cell
FR-Designer_Chart_Cell= FR-Designer_Chart_Cell=
FR-Designer_Chart_Float= FR-Designer_Chart_Float=
FR-Designer_Chart_Float_chart= FR-Designer_Chart_Float_chart=
@ -2132,3 +2132,7 @@ FR-Designer_Select_Color=Select Color
FR-Designer-Basic_Dynamic_Parameter_Injection=Injection FR-Designer-Basic_Dynamic_Parameter_Injection=Injection
FR-Designer_Label= FR-Designer_Label=
FR-Designer_Widgetname=Widget Name FR-Designer_Widgetname=Widget Name
FR-Designer_Insert_Cell_Element=Insert Cell Element
FR-Designer_Add_Condition=Add Condition
FR-Designer_Use_Params_Template=use parameter template
FR-Designer_Label_Name=label name

6
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -71,7 +71,7 @@ FR-Designer_Button-Icon=Button Icon
FR-Designer_Button-Name=Button Name FR-Designer_Button-Name=Button Name
FR-Designer_Button-Type=Button Type FR-Designer_Button-Type=Button Type
FR-Designer_CardLayout=TabLayout FR-Designer_CardLayout=TabLayout
FR-Designer_Cell=cell FR-Designer_Cell=Cell
FR-Designer_Chart_Cell=Chart Hyperlink-Link Cell FR-Designer_Chart_Cell=Chart Hyperlink-Link Cell
FR-Designer_Chart_Float=Chart Hyperlink-Floating Element FR-Designer_Chart_Float=Chart Hyperlink-Floating Element
FR-Designer_Chart_Float_chart=Chart Hyperlink-Floating Chart FR-Designer_Chart_Float_chart=Chart Hyperlink-Floating Chart
@ -2128,3 +2128,7 @@ FR-Designer_Select_Color=Select Color
FR-Designer-Basic_Dynamic_Parameter_Injection=Injection FR-Designer-Basic_Dynamic_Parameter_Injection=Injection
FR-Designer_Label=Label FR-Designer_Label=Label
FR-Designer_Widgetname=Widget Name FR-Designer_Widgetname=Widget Name
FR-Designer_Insert_Cell_Element=Insert Cell Element
FR-Designer_Add_Condition=Add Condition
FR-Designer_Use_Params_Template=use parameter template
FR-Designer_Label_Name=label name

4
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -2123,6 +2123,8 @@ FR-Designer_Mobile-Height-Percent=
FR-Designer_Mobile-Height-Limit= FR-Designer_Mobile-Height-Limit=
FR-Designer-Download_Online_Sources= FR-Designer-Download_Online_Sources=
FR-Designer_Select_Color= FR-Designer_Select_Color=
FR-Designer-Basic_Dynamic_Parameter_Injection=\ FR-Designer-Basic_Dynamic_Parameter_Injection=
FR-Designer_Label=\u30E9\u30D9\u30EBa FR-Designer_Label=\u30E9\u30D9\u30EBa
FR-Designer_Widgetname=\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB\u540D FR-Designer_Widgetname=\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB\u540D
FR-Designer_Insert_Cell_Element=
FR-Designer_Add_Condition=

2
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -2127,3 +2127,5 @@ FR-Designer_Select_Color=
FR-Designer-Basic_Dynamic_Parameter_Injection= FR-Designer-Basic_Dynamic_Parameter_Injection=
FR-Designer_Label=\uB808\uC774\uBE14 FR-Designer_Label=\uB808\uC774\uBE14
FR-Designer_Widgetname=\uC18C\uD504\uD2B8\uC6E8\uC5B4\uC81C\uC5B4\uC774\uB984 FR-Designer_Widgetname=\uC18C\uD504\uD2B8\uC6E8\uC5B4\uC81C\uC5B4\uC774\uB984
FR-Designer_Insert_Cell_Element=
FR-Designer_Add_Condition=

1
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -2140,3 +2140,4 @@ FR-Designer_Select_Color=\u9009\u62E9\u989C\u8272
FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165 FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165
FR-Designer_Label=\u6807\u7B7E FR-Designer_Label=\u6807\u7B7E
FR-Designer_Widgetname=\u63A7\u4EF6\u540D FR-Designer_Widgetname=\u63A7\u4EF6\u540D
FR-Designer_Insert_Cell_Element=\u63D2\u5165\u5143\u7D20

2
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -2131,3 +2131,5 @@ FR-Designer_Select_Color=
FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165 FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165
FR-Designer_Label=\u6A19\u7C3D FR-Designer_Label=\u6A19\u7C3D
FR-Designer_Widgetname=\u63A7\u5236\u9805\u540D FR-Designer_Widgetname=\u63A7\u5236\u9805\u540D
FR-Designer_Insert_Cell_Element=\u63D2\u5165\u5143\u7D20
FR-Designer_Add_Condition=

1
designer_base/src/com/fr/file/FILEChooserPane.java

@ -475,7 +475,6 @@ public class FILEChooserPane extends BasicPane {
this.type = type; this.type = type;
this.suffix = suffix; this.suffix = suffix;
dialog = showWindow(parent instanceof DesignerFrame ? (Window) parent : SwingUtilities.getWindowAncestor(parent), false); dialog = showWindow(parent instanceof DesignerFrame ? (Window) parent : SwingUtilities.getWindowAncestor(parent), false);
JPanel contentPane = (JPanel) dialog.getContentPane(); JPanel contentPane = (JPanel) dialog.getContentPane();
contentPane.setLayout(FRGUIPaneFactory.createM_BorderLayout()); contentPane.setLayout(FRGUIPaneFactory.createM_BorderLayout());

14
designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

@ -206,20 +206,6 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
widgetBoundPane.update(); widgetBoundPane.update();
} }
fireValueChanged(); fireValueChanged();
if (xCreator.acceptType(XWScaleLayout.class)) {
XCreator xCreator1 = xCreator.getEditingChildCreator();
xCreator1.resetData(widget);
xCreator.removeAll();
xCreator.add(xCreator1);
}else if(xCreator.acceptType(XWTitleLayout.class)){
XCreator xCreator1 = ((XWTitleLayout) xCreator).getXCreator(0);
xCreator1.resetData(widget);
xCreator.removeAll();
xCreator.add(xCreator1);
} else {
xCreator.resetData(widget);
}
} }

2
designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java

@ -185,7 +185,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override @Override
protected DateEditor updateSubDirectWriteEditorBean() { protected DateEditor updateSubDirectWriteEditorBean() {
DateEditor ob = new DateEditor(); DateEditor ob = (DateEditor)creator.toData();
waterMarkDictPane.update(ob); waterMarkDictPane.update(ob);
ob.setFormatText(this.getSimpleDateFormat().toPattern()); ob.setFormatText(this.getSimpleDateFormat().toPattern());
ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 0); ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 0);

2
designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java

@ -73,7 +73,7 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
@Override @Override
public IframeEditor updateBean() { public IframeEditor updateBean() {
IframeEditor ob = new IframeEditor(); IframeEditor ob = (IframeEditor)creator.toData();
ob.setSrc(srcTextField.getText()); ob.setSrc(srcTextField.getText());
List<ParameterProvider> parameterList = parameterViewPane.update(); List<ParameterProvider> parameterList = parameterViewPane.update();
ob.setParameters(parameterList.toArray(new ParameterProvider[parameterList.size()])); ob.setParameters(parameterList.toArray(new ParameterProvider[parameterList.size()]));

2
designer_form/src/com/fr/design/widget/ui/designer/MultiFileEditorPane.java

@ -85,7 +85,7 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
@Override @Override
protected MultiFileEditor updateSubFieldEditorBean() { protected MultiFileEditor updateSubFieldEditorBean() {
MultiFileEditor ob = new MultiFileEditor(); MultiFileEditor ob = (MultiFileEditor)creator.toData();
ob.setAccept((String) acceptType.getSelectedItem()); ob.setAccept((String) acceptType.getSelectedItem());
ob.setSingleFile(singleFileCheckBox.isSelected()); ob.setSingleFile(singleFileCheckBox.isSelected());
ob.setMaxSize(fileSizeField.getValue()); ob.setMaxSize(fileSizeField.getValue());

2
designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java

@ -278,7 +278,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
@Override @Override
protected NumberEditor updateSubFieldEditorBean() { protected NumberEditor updateSubFieldEditorBean() {
NumberEditor ob = new NumberEditor(); NumberEditor ob = (NumberEditor)creator.toData();
formWidgetValuePane.update(ob); formWidgetValuePane.update(ob);
ob.setAllowDecimals(allowDecimalsCheckBox.isSelected()); ob.setAllowDecimals(allowDecimalsCheckBox.isSelected());
if (allowDecimalsCheckBox.isSelected()) { if (allowDecimalsCheckBox.isSelected()) {

13
designer_form/src/com/fr/design/widget/ui/designer/PasswordDefinePane.java

@ -1,9 +1,9 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.frpane.RegFieldPane;
import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.frpane.RegPane;
import com.fr.form.ui.Password;
import com.fr.form.ui.TextEditor;
public class PasswordDefinePane extends TextFieldEditorDefinePane { public class PasswordDefinePane extends TextFieldEditorDefinePane {
@ -12,12 +12,7 @@ public class PasswordDefinePane extends TextFieldEditorDefinePane {
} }
private static final long serialVersionUID = 4737910705071750562L; private static final long serialVersionUID = 4737910705071750562L;
@Override protected RegFieldPane createRegPane() {
protected TextEditor newTextEditorInstance() { return new RegFieldPane(RegPane.PASSWORD_REG_TYPE);
return new Password();
}
protected RegPane createRegPane() {
return new RegPane(RegPane.PASSWORD_REG_TYPE);
} }
} }

2
designer_form/src/com/fr/design/widget/ui/designer/RadioDefinePane.java

@ -41,6 +41,6 @@ public class RadioDefinePane extends AbstractDataModify<Radio> {
@Override @Override
public Radio updateBean() { public Radio updateBean() {
return new Radio(); return (Radio)creator.toData();
} }
} }

9
designer_form/src/com/fr/design/widget/ui/designer/TextAreaDefinePane.java

@ -1,6 +1,7 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.frpane.RegFieldPane;
import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.frpane.RegPane;
import com.fr.form.ui.TextArea; import com.fr.form.ui.TextArea;
import com.fr.form.ui.TextEditor; import com.fr.form.ui.TextEditor;
@ -10,12 +11,8 @@ public class TextAreaDefinePane extends TextFieldEditorDefinePane {
public TextAreaDefinePane(XCreator xCreator) { public TextAreaDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
} }
@Override
protected TextEditor newTextEditorInstance() {
return new TextArea();
}
protected RegPane createRegPane() { protected RegFieldPane createRegPane() {
return new RegPane(RegPane.TEXTAREA_REG_TYPE); return new RegFieldPane(RegPane.TEXTAREA_REG_TYPE);
} }
} }

25
designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java

@ -1,6 +1,7 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.frpane.RegFieldPane;
import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.frpane.RegPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
@ -17,7 +18,7 @@ import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor> { public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor> {
protected RegPane regPane; protected RegFieldPane regPane;
private UITextField waterMarkDictPane; private UITextField waterMarkDictPane;
FormWidgetValuePane formWidgetValuePane; FormWidgetValuePane formWidgetValuePane;
@ -55,15 +56,6 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
waterMarkDictPane.removeKeyListener(this); waterMarkDictPane.removeKeyListener(this);
} }
}); });
//监听填写规则下拉框的值的变化
// regPane.getRegComboBox().addActionListener(new ActionListener() {
// public void actionPerformed(ActionEvent e) {
// RegExp regExp = (RegExp) regPane.getRegComboBox().getSelectedItem();
//// regErrorMsgTextField.setEnabled(regExp.errorMessageEditable());
//
// }
// });
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
double f = TableLayout.FILL; double f = TableLayout.FILL;
@ -90,8 +82,8 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
protected RegPane createRegPane() { protected RegFieldPane createRegPane() {
return new RegPane(); return new RegFieldPane();
} }
@Override @Override
@ -101,22 +93,19 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
@Override @Override
protected void populateSubFieldEditorBean(TextEditor e) { protected void populateSubFieldEditorBean(TextEditor e) {
this.regPane.populate(e.getRegex()); this.regPane.populate(e);
waterMarkDictPane.setText(e.getWaterMark()); waterMarkDictPane.setText(e.getWaterMark());
formWidgetValuePane.populate(e); formWidgetValuePane.populate(e);
} }
@Override @Override
protected TextEditor updateSubFieldEditorBean() { protected TextEditor updateSubFieldEditorBean() {
TextEditor ob = newTextEditorInstance(); TextEditor ob = (TextEditor)creator.toData();
ob.setRegex(this.regPane.update()); this.regPane.update(ob);
ob.setWaterMark(waterMarkDictPane.getText()); ob.setWaterMark(waterMarkDictPane.getText());
formWidgetValuePane.update(ob); formWidgetValuePane.update(ob);
return ob; return ob;
} }
protected TextEditor newTextEditorInstance() {
return new TextEditor();
}
} }

2
designer_form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteLayoutDefinePane.java

@ -99,7 +99,7 @@ public class FRAbsoluteLayoutDefinePane extends AbstractDataModify<WAbsoluteLayo
} }
public WAbsoluteLayout updateSubPane() { public WAbsoluteLayout updateSubPane() {
return new WAbsoluteLayout(); return (WAbsoluteLayout)creator.toData();
} }
public void populateSubPane(WAbsoluteLayout ob) { public void populateSubPane(WAbsoluteLayout ob) {

2
designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

@ -116,7 +116,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<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());
background.setValue(ob.getBackground()); background.setValue(ob.getBorderStyle());
} }

Loading…
Cancel
Save