Browse Source

merge

master
hzzz 7 years ago
parent
commit
d876761141
  1. 57
      designer/src/com/fr/design/expand/ExpandFatherPane.java
  2. 2
      designer/src/com/fr/design/mainframe/CellElementPropertyPane.java
  3. 9
      designer/src/com/fr/design/mainframe/ReportFloatPane.java
  4. 13
      designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java
  5. 67
      designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java
  6. 30
      designer/src/com/fr/design/mainframe/cell/settingpane/CellStylePane.java
  7. 2
      designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java
  8. 2
      designer/src/com/fr/design/mainframe/cell/settingpane/style/PredefinedStylePane.java
  9. 8
      designer/src/com/fr/design/present/PresentPane.java
  10. 16
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  11. 31
      designer/src/com/fr/design/widget/WidgetPane.java
  12. 36
      designer/src/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java
  13. 38
      designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java
  14. 35
      designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java
  15. 94
      designer/src/com/fr/poly/PolyBlockProperTable.java
  16. 2
      designer/src/com/fr/poly/creator/ECBlockEditor.java
  17. 2
      designer/src/com/fr/quickeditor/floatquick/FloatImageQuickEditor.java
  18. 3
      designer/src/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java
  19. 194
      designer_base/src/com/fr/design/constants/UIConstants.java
  20. 31
      designer_base/src/com/fr/design/foldablepane/HeaderPane.java
  21. 3
      designer_base/src/com/fr/design/foldablepane/UIExpandablePane.java
  22. 20
      designer_base/src/com/fr/design/formula/TinyFormulaPane.java
  23. 265
      designer_base/src/com/fr/design/gui/frpane/RegPane.java
  24. 3
      designer_base/src/com/fr/design/gui/frpane/UIComboBoxPane.java
  25. 7
      designer_base/src/com/fr/design/gui/style/FormatPane.java
  26. BIN
      designer_base/src/com/fr/design/images/buttonicon/downSelected.png
  27. BIN
      designer_base/src/com/fr/design/images/buttonicon/leftNormal.png
  28. 2
      designer_base/src/com/fr/design/locale/designer.properties
  29. 2
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  30. 2
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  31. 2
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  32. 2
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  33. 2
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  34. 50
      designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java
  35. 52
      designer_base/src/com/fr/design/widget/WidgetBoundsPaneFactory.java
  36. 41
      designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicPropertyPane.java
  37. 27
      designer_form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java
  38. 24
      designer_form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

57
designer/src/com/fr/design/expand/ExpandFatherPane.java

@ -7,13 +7,13 @@ import com.fr.design.event.GlobalNameObserver;
import com.fr.design.gui.columnrow.ColumnRowPane; import com.fr.design.gui.columnrow.ColumnRowPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.selection.SelectionEvent;
import com.fr.design.selection.SelectionListener;
import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection; import com.fr.grid.selection.Selection;
import com.fr.report.cell.cellattr.CellExpandAttr; import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.design.selection.SelectionEvent;
import com.fr.design.selection.SelectionListener;
import com.fr.stable.ColumnRow; import com.fr.stable.ColumnRow;
import javax.swing.*; import javax.swing.*;
@ -22,12 +22,10 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
public abstract class ExpandFatherPane extends JPanel implements GlobalNameObserver { public abstract class ExpandFatherPane extends JPanel implements GlobalNameObserver {
private UIComboBox comboBox; public UIComboBox comboBox;
private ColumnRowPane customParentColumnRowPane; private ColumnRowPane customParentColumnRowPane;
private ElementCasePane ePane; private ElementCasePane ePane;
private SelectionListener gridSelectionChangeListener; private SelectionListener gridSelectionChangeListener;
@ -35,7 +33,8 @@ public abstract class ExpandFatherPane extends JPanel implements GlobalNameObser
private String expandFatherName = ""; private String expandFatherName = "";
private GlobalNameListener globalNameListener = null; private GlobalNameListener globalNameListener = null;
private boolean isAlreadyAddListener = false; private boolean isAlreadyAddListener = false;
private final JPanel customPane; public JPanel customPane;
private CardLayout cardLayout;
public ExpandFatherPane() { public ExpandFatherPane() {
this.setLayout(new BorderLayout(0, LayoutConstants.VGAP_SMALL)); this.setLayout(new BorderLayout(0, LayoutConstants.VGAP_SMALL));
@ -43,7 +42,7 @@ public abstract class ExpandFatherPane extends JPanel implements GlobalNameObser
Inter.getLocText("FR-Designer_None"), Inter.getLocText("FR-Designer_None"),
Inter.getLocText("FR-Designer_DEFAULT"), Inter.getLocText("FR-Designer_DEFAULT"),
Inter.getLocText("FR-Designer_Custom")}); Inter.getLocText("FR-Designer_Custom")});
final CardLayout cardLayout = new CardLayout(); cardLayout = new CardLayout();
customPane = new JPanel(cardLayout); customPane = new JPanel(cardLayout);
customParentColumnRowPane = new ColumnRowPane() { customParentColumnRowPane = new ColumnRowPane() {
@ -66,7 +65,7 @@ public abstract class ExpandFatherPane extends JPanel implements GlobalNameObser
cc.add(imageButton, BorderLayout.EAST); cc.add(imageButton, BorderLayout.EAST);
customPane.add(cc, "content"); customPane.add(cc, "content");
customPane.add(new JPanel(), "none"); customPane.add(new JPanel(), "none");
customPane.setPreferredSize(new Dimension(0, 0) ); customPane.setPreferredSize(new Dimension(0, 0));
this.add(comboBox, BorderLayout.NORTH); this.add(comboBox, BorderLayout.NORTH);
this.add(customPane, BorderLayout.CENTER); this.add(customPane, BorderLayout.CENTER);
@ -74,12 +73,12 @@ public abstract class ExpandFatherPane extends JPanel implements GlobalNameObser
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
if(comboBox.getSelectedIndex() == 2){ if (comboBox.getSelectedIndex() == 2) {
customPane.setPreferredSize(new Dimension(100, 20) ); customPane.setPreferredSize(new Dimension(100, 20));
cardLayout.show(customPane,"content"); cardLayout.show(customPane, "content");
}else { } else {
cardLayout.show(customPane,"none"); cardLayout.show(customPane, "none");
customPane.setPreferredSize(new Dimension(0, 0) ); customPane.setPreferredSize(new Dimension(0, 0));
} }
// cardLayout.show(customPane, comboBox.getSelectedIndex() == 2 ? "content" : "none"); // cardLayout.show(customPane, comboBox.getSelectedIndex() == 2 ? "content" : "none");
if (globalNameListener != null && shouldResponseNameListener()) { if (globalNameListener != null && shouldResponseNameListener()) {
@ -87,11 +86,30 @@ public abstract class ExpandFatherPane extends JPanel implements GlobalNameObser
} }
} }
}); });
imageButton.addActionListener(new ActionListener() { imageButton.addActionListener(imageActionListener);
comboBox.setSelectedIndex(1);
}
ItemListener comboBoxItemListener = new ItemListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void itemStateChanged(ItemEvent e) {
if (comboBox.getSelectedIndex() == 2) {
customPane.setPreferredSize(new Dimension(100, 20));
cardLayout.show(customPane, "content");
} else {
cardLayout.show(customPane, "none");
customPane.setPreferredSize(new Dimension(0, 0));
}
// cardLayout.show(customPane, comboBox.getSelectedIndex() == 2 ? "content" : "none");
if (globalNameListener != null && shouldResponseNameListener()) {
globalNameListener.setGlobalName(expandFatherName);
}
}
};
ActionListener imageActionListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (ePane == null || isAlreadyAddListener) { if (ePane == null || isAlreadyAddListener) {
return; return;
} }
@ -121,9 +139,8 @@ public abstract class ExpandFatherPane extends JPanel implements GlobalNameObser
ePane.addSelectionChangeListener(gridSelectionChangeListener); ePane.addSelectionChangeListener(gridSelectionChangeListener);
isAlreadyAddListener = true; isAlreadyAddListener = true;
} }
}); };
comboBox.setSelectedIndex(1);
}
/** /**
* @param listener 观察者监听事件 * @param listener 观察者监听事件

2
designer/src/com/fr/design/mainframe/CellElementPropertyPane.java

@ -101,7 +101,7 @@ public class CellElementPropertyPane extends DockingView {
title.setHorizontalAlignment(SwingConstants.CENTER); title.setHorizontalAlignment(SwingConstants.CENTER);
title.setVerticalAlignment(SwingConstants.CENTER); title.setVerticalAlignment(SwingConstants.CENTER);
titlePane.add(title, BorderLayout.CENTER); titlePane.add(title, BorderLayout.CENTER);
titlePane.setBorder(BorderFactory.createEmptyBorder(0,0,1,0)); titlePane.setBorder(BorderFactory.createEmptyBorder(10,0,1,0));
// this.add(titlePane, BorderLayout.NORTH); // this.add(titlePane, BorderLayout.NORTH);
this.add(cellElementEditPane, BorderLayout.CENTER); this.add(cellElementEditPane, BorderLayout.CENTER);

9
designer/src/com/fr/design/mainframe/ReportFloatPane.java

@ -43,17 +43,18 @@ public class ReportFloatPane extends JPanel {
topToolBar.setLayout(new BorderLayout()); topToolBar.setLayout(new BorderLayout());
insertFloatMenu = createInsertToolBar(); insertFloatMenu = createInsertToolBar();
topToolBar.add(createButtonUI()); topToolBar.add(createButtonUI());
topToolBar.setBorder(BorderFactory.createEmptyBorder(2, 10, 2, 0)); UILabel emptyLabel = new UILabel();
emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; double[] columnSize = {p, p, p, f};
double[] rowSize = {p}; double[] rowSize = {p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Add_FloatElement")), topToolBar}, new Component[]{new UILabel(), new UILabel(Inter.getLocText("FR-Designer_Add_FloatElement")), emptyLabel, topToolBar},
}; };
JPanel leftTopPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel leftTopPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
leftTopPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 10)); leftTopPane.setBorder(BorderFactory.createEmptyBorder(10, 4, 0, 13));
this.add(leftTopPane, BorderLayout.NORTH); this.add(leftTopPane, BorderLayout.NORTH);
} }

13
designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java

@ -10,6 +10,7 @@ import com.fr.design.gui.itabpane.TitleChangeListener;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.cell.settingpane.*; import com.fr.design.mainframe.cell.settingpane.*;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
@ -49,6 +50,17 @@ public class CellElementEditPane extends BasicPane {
private CellAttributeProvider cellAttributeProvider = null; private CellAttributeProvider cellAttributeProvider = null;
public static void main(String[] args){
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(new BorderLayout());
content.add(new CellElementEditPane(), BorderLayout.CENTER);
GUICoreUtils.centerWindow(jf);
jf.setSize(290, 400);
jf.setVisible(true);
}
public CellElementEditPane() { public CellElementEditPane() {
setLayout(new BorderLayout()); setLayout(new BorderLayout());
initPaneList(); initPaneList();
@ -77,6 +89,7 @@ public class CellElementEditPane extends BasicPane {
downTitle = new JPanel(); downTitle = new JPanel();
downTitle.setLayout(new BorderLayout()); downTitle.setLayout(new BorderLayout());
downTitle.add(tabsHeaderIconPane, BorderLayout.NORTH); downTitle.add(tabsHeaderIconPane, BorderLayout.NORTH);
center.setBorder(BorderFactory.createEmptyBorder(0, -10, 0, -10));
downTitle.add(center, BorderLayout.CENTER); downTitle.add(center, BorderLayout.CENTER);
this.add(downTitle, BorderLayout.CENTER); this.add(downTitle, BorderLayout.CENTER);

67
designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java

@ -5,12 +5,12 @@ import com.fr.design.constants.LayoutConstants;
import com.fr.design.expand.ExpandLeftFatherPane; import com.fr.design.expand.ExpandLeftFatherPane;
import com.fr.design.expand.ExpandUpFatherPane; import com.fr.design.expand.ExpandUpFatherPane;
import com.fr.design.expand.SortExpandAttrPane; import com.fr.design.expand.SortExpandAttrPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
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.foldablepane.UIExpandablePane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -27,6 +27,8 @@ import java.awt.*;
* 单元格扩展属性面板是属性表面板的一个种类 * 单元格扩展属性面板是属性表面板的一个种类
*/ */
public class CellExpandAttrPane extends AbstractCellAttrPane { public class CellExpandAttrPane extends AbstractCellAttrPane {
private static final int SENIOR_HORIZONTAL_GAP = 12;
private static final int BASIC_HORIZONTAL_GAP = 20;
private UIButtonGroup<Byte> expandDirectionButton; private UIButtonGroup<Byte> expandDirectionButton;
private ExpandLeftFatherPane leftFatherPane; private ExpandLeftFatherPane leftFatherPane;
private ExpandUpFatherPane rightFatherPane; private ExpandUpFatherPane rightFatherPane;
@ -38,7 +40,6 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
private JPanel seniorPane; private JPanel seniorPane;
/** /**
*
* @return * @return
*/ */
public JPanel createContentPane() { public JPanel createContentPane() {
@ -61,15 +62,15 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
} }
public static void main(String[] args){ public static void main(String[] args) {
// JFrame jf = new JFrame("test"); JFrame jf = new JFrame("test");
// jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// JPanel content = (JPanel) jf.getContentPane(); JPanel content = (JPanel) jf.getContentPane();
// content.setLayout(new BorderLayout()); content.setLayout(new BorderLayout());
// content.add(new CellExpandAttrPane().layoutPane(), BorderLayout.CENTER); content.add(new CellExpandAttrPane().layoutPane(), BorderLayout.CENTER);
// GUICoreUtils.centerWindow(jf); GUICoreUtils.centerWindow(jf);
// jf.setSize(290, 400); jf.setSize(290, 400);
// jf.setVisible(true); jf.setVisible(true);
} }
private void initAllNames() { private void initAllNames() {
@ -84,45 +85,56 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
layoutPane = new JPanel(new BorderLayout()); layoutPane = new JPanel(new BorderLayout());
basicPane = new JPanel(); basicPane = new JPanel();
seniorPane = new JPanel(); seniorPane = new JPanel();
basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"),290,24,basicPane()); basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 290, 24, basicPane());
seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"),290,24,seniorPane()); seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 290, 24, seniorPane());
layoutPane.add(basicPane,BorderLayout.NORTH); layoutPane.add(basicPane, BorderLayout.NORTH);
layoutPane.add(seniorPane,BorderLayout.CENTER); layoutPane.add(seniorPane, BorderLayout.CENTER);
return layoutPane; return layoutPane;
} }
private JPanel basicPane(){ private JPanel basicPane() {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
UILabel direction = new UILabel(Inter.getLocText("FR-Designer_ExpandD_Expand_Direction"), SwingConstants.LEFT);
// JPanel directionPane = new JPanel(new BorderLayout());
// directionPane.add(direction, BorderLayout.NORTH);
UILabel left = new UILabel(Inter.getLocText("FR-Designer_LeftParent"), SwingConstants.LEFT);
JPanel leftPane = new JPanel(new BorderLayout());
leftPane.add(left, BorderLayout.NORTH);
UILabel up = new UILabel(Inter.getLocText("FR-Designer_ExpandD_Up_Father_Cell"), SwingConstants.LEFT);
JPanel upPane = new JPanel(new BorderLayout());
upPane.add(up, BorderLayout.NORTH);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null,null}, new Component[]{null, null},
new Component[]{new UILabel(" "+Inter.getLocText("FR-Designer_ExpandD_Expand_Direction")+" ", SwingConstants.LEFT), expandDirectionButton}, new Component[]{direction, expandDirectionButton},
new Component[]{new UILabel(" "+Inter.getLocText("FR-Designer_LeftParent"), SwingConstants.LEFT), leftFatherPane}, new Component[]{leftPane, leftFatherPane},
new Component[]{new UILabel(" "+Inter.getLocText("FR-Designer_ExpandD_Up_Father_Cell"), SwingConstants.LEFT), rightFatherPane}, new Component[]{upPane, rightFatherPane},
}; };
double[] rowSize = {p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1}, {1, 3}, {1, 3}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, BASIC_HORIZONTAL_GAP, LayoutConstants.VGAP_LARGE);
} }
private JPanel seniorPane() { private JPanel seniorPane() {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
UILabel expendSort = new UILabel(Inter.getLocText("FR-Designer_ExpendSort"), SwingConstants.LEFT);
JPanel expendSortPane = new JPanel(new BorderLayout());
expendSortPane.add(expendSort, BorderLayout.NORTH);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null,null}, new Component[]{null, null},
new Component[]{horizontalExpandableCheckBox, null}, new Component[]{horizontalExpandableCheckBox, null},
new Component[]{verticalExpandableCheckBox, null}, new Component[]{verticalExpandableCheckBox, null},
new Component[]{new UILabel(" "+Inter.getLocText("FR-Designer_ExpendSort"), SwingConstants.RIGHT), sortAfterExpand}, new Component[]{expendSortPane, sortAfterExpand},
}; };
double[] rowSize = {p, p, p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 3}, {1, 3}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 3}, {1, 3}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, SENIOR_HORIZONTAL_GAP, LayoutConstants.VGAP_LARGE);
} }
@Override @Override
protected void populateBean() { protected void populateBean() {
this.leftFatherPane.setElementCasePane(elementCasePane); this.leftFatherPane.setElementCasePane(elementCasePane);
@ -231,7 +243,6 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
} }
/** /**
*
* @return * @return
*/ */
public String title4PopupWindow() { public String title4PopupWindow() {

30
designer/src/com/fr/design/mainframe/cell/settingpane/CellStylePane.java

@ -1,11 +1,5 @@
package com.fr.design.mainframe.cell.settingpane; package com.fr.design.mainframe.cell.settingpane;
import java.awt.*;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.mainframe.cell.settingpane.style.StylePane; import com.fr.design.mainframe.cell.settingpane.style.StylePane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
@ -14,6 +8,11 @@ import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.elementcase.TemplateElementCase;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
/** /**
* @author zhou * @author zhou
* @since 2012-5-11下午3:59:39 * @since 2012-5-11下午3:59:39
@ -38,18 +37,19 @@ public class CellStylePane extends AbstractCellAttrPane {
adjustValues();// 里面的Tab切换后要及时调整滚动条,因为一些界面可能不需要滚动条 adjustValues();// 里面的Tab切换后要及时调整滚动条,因为一些界面可能不需要滚动条
} }
}); });
// content.setBorder(UIConstants.CELL_ATTR_NORMALBORDER);
return content; return content;
} }
public static void main(String[] args){ public static void main(String[] args) {
// JFrame jf = new JFrame("test"); JFrame jf = new JFrame("test");
// jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// JPanel content = (JPanel) jf.getContentPane(); JPanel content = (JPanel) jf.getContentPane();
// content.setLayout(new BorderLayout()); content.setLayout(new BorderLayout());
// content.add(new CellStylePane().createContentPane(), BorderLayout.CENTER); content.add(new CellStylePane().createContentPane(), BorderLayout.CENTER);
// GUICoreUtils.centerWindow(jf); GUICoreUtils.centerWindow(jf);
// jf.setSize(290, 400); jf.setSize(290, 400);
// jf.setVisible(true); jf.setVisible(true);
} }
@Override @Override

2
designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java

@ -50,7 +50,7 @@ public class CustomStylePane extends MultiTabPane<Style> {
content.setLayout(new BorderLayout()); content.setLayout(new BorderLayout());
content.add(new CustomStylePane(), BorderLayout.CENTER); content.add(new CustomStylePane(), BorderLayout.CENTER);
GUICoreUtils.centerWindow(jf); GUICoreUtils.centerWindow(jf);
jf.setSize(290, 400); jf.setSize(250, 400);
jf.setVisible(true); jf.setVisible(true);
} }

2
designer/src/com/fr/design/mainframe/cell/settingpane/style/PredefinedStylePane.java

@ -5,6 +5,7 @@ import com.fr.base.NameStyle;
import com.fr.base.ScreenResolution; import com.fr.base.ScreenResolution;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerBean; import com.fr.design.mainframe.DesignerBean;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
@ -64,6 +65,7 @@ public class PredefinedStylePane extends FurtherBasicBeanPane<NameStyle> impleme
styleList.setCellRenderer(render); styleList.setCellRenderer(render);
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(styleList, BorderLayout.CENTER); this.add(styleList, BorderLayout.CENTER);
this.setBorder(UIConstants.CELL_ATTR_NORMALBORDER);
styleList.addMouseListener(new MouseAdapter() { styleList.addMouseListener(new MouseAdapter() {
@Override @Override

8
designer/src/com/fr/design/present/PresentPane.java

@ -5,6 +5,7 @@ import com.fr.base.present.FormulaPresent;
import com.fr.base.present.Present; import com.fr.base.present.Present;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.fun.PresentKindProvider; import com.fr.design.fun.PresentKindProvider;
import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.icombobox.DictionaryComboBox; import com.fr.design.gui.icombobox.DictionaryComboBox;
@ -68,21 +69,26 @@ public class PresentPane extends UIComboBoxPane<Present> {
keys.add("NOPRESENT"); keys.add("NOPRESENT");
displays.add(none.title4PopupWindow()); displays.add(none.title4PopupWindow());
paneList.add(dictPresentPane = new DictPresentPane()); dictPresentPane = new DictPresentPane();
dictPresentPane.setBorder(UIConstants.CELL_ATTR_NORMALBORDER);
paneList.add(dictPresentPane);
keys.add(DictPresent.class.getName()); keys.add(DictPresent.class.getName());
displays.add(dictPresentPane.title4PopupWindow()); displays.add(dictPresentPane.title4PopupWindow());
FurtherBasicBeanPane<BarcodePresent> bar = new BarCodePane(); FurtherBasicBeanPane<BarcodePresent> bar = new BarCodePane();
bar.setBorder(UIConstants.CELL_ATTR_NORMALBORDER);
paneList.add(bar); paneList.add(bar);
keys.add(BarcodePresent.class.getName()); keys.add(BarcodePresent.class.getName());
displays.add(bar.title4PopupWindow()); displays.add(bar.title4PopupWindow());
FurtherBasicBeanPane<FormulaPresent> formula = new FormulaPresentPane(); FurtherBasicBeanPane<FormulaPresent> formula = new FormulaPresentPane();
formula.setBorder(UIConstants.CELL_ATTR_NORMALBORDER);
paneList.add(formula); paneList.add(formula);
keys.add(FormulaPresent.class.getName()); keys.add(FormulaPresent.class.getName());
displays.add(formula.title4PopupWindow()); displays.add(formula.title4PopupWindow());
FurtherBasicBeanPane<CurrencyLinePresent> currency = new CurrencyLinePane(); FurtherBasicBeanPane<CurrencyLinePresent> currency = new CurrencyLinePane();
currency.setBorder(UIConstants.CELL_ATTR_NORMALBORDER);
paneList.add(currency); paneList.add(currency);
keys.add(CurrencyLinePresent.class.getName()); keys.add(CurrencyLinePresent.class.getName());
displays.add(currency.title4PopupWindow()); displays.add(currency.title4PopupWindow());

16
designer/src/com/fr/design/widget/CellWidgetCardPane.java

@ -52,9 +52,16 @@ public class CellWidgetCardPane extends BasicPane {
public CellWidgetCardPane(ElementCasePane pane) { public CellWidgetCardPane(ElementCasePane pane) {
this.pane = pane; this.pane = pane;
// this.initComponents(pane);
} }
public BasicWidgetPropertySettingPane initBasicWidgetPropertyPane() {
return new BasicWidgetPropertySettingPane();
}
private void initComponents(ElementCasePane pane) { private void initComponents(ElementCasePane pane) {
this.removeAll(); this.removeAll();
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
//k //k
@ -70,7 +77,7 @@ public class CellWidgetCardPane extends BasicPane {
//k //k
center.add(attriTabPane, Inter.getLocText("FR-Designer_Attribute")); center.add(attriTabPane, Inter.getLocText("FR-Designer_Attribute"));
center.add(eventTabPane, Inter.getLocText("FR-Designer_Form_Editing_Listeners")); center.add(eventTabPane, Inter.getLocText("FR-Designer_Form_Editing_Listeners"));
final String [] tabTitles = new String[]{Inter.getLocText("FR-Designer_Attribute"), Inter.getLocText("FR-Designer_Form_Editing_Listeners")}; final String[] tabTitles = new String[]{Inter.getLocText("FR-Designer_Attribute"), Inter.getLocText("FR-Designer_Form_Editing_Listeners")};
tabsHeaderIconPane = new UIHeadGroup(tabTitles) { tabsHeaderIconPane = new UIHeadGroup(tabTitles) {
@Override @Override
@ -93,8 +100,9 @@ public class CellWidgetCardPane extends BasicPane {
widgetPropertyPane = new BasicWidgetPropertySettingPane(); widgetPropertyPane = new BasicWidgetPropertySettingPane();
UIExpandablePane uiExpandablePane = new UIExpandablePane("基本", 280, 20, widgetPropertyPane); UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 280, 24, widgetPropertyPane);
attriTabPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
attriTabPane.add(uiExpandablePane, BorderLayout.NORTH); attriTabPane.add(uiExpandablePane, BorderLayout.NORTH);
attriCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); attriCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
@ -103,7 +111,7 @@ public class CellWidgetCardPane extends BasicPane {
this.setPreferredSize(new Dimension(600, 450)); this.setPreferredSize(new Dimension(600, 450));
} }
private void initPaneList(){ private void initPaneList() {
paneList = new ArrayList<JPanel>(); paneList = new ArrayList<JPanel>();
paneList.add(attriTabPane); paneList.add(attriTabPane);
paneList.add(eventPane); paneList.add(eventPane);
@ -214,7 +222,7 @@ public class CellWidgetCardPane extends BasicPane {
center.remove(this.treeTabPane); center.remove(this.treeTabPane);
} }
private void reInitHeaderPane(JPanel jPanel){ private void reInitHeaderPane(JPanel jPanel) {
paneList.add(jPanel); paneList.add(jPanel);
// tabsHeaderIconPane = new // tabsHeaderIconPane = new
} }

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

@ -9,9 +9,11 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.CellWidgetPropertyPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.CellWidgetPropertyPane;
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;
import com.fr.form.ui.*; import com.fr.form.ui.*;
@ -49,14 +51,25 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
protected void initComponents(ElementCasePane pane) { protected void initComponents(ElementCasePane pane) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
northPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
this.add(northPane, BorderLayout.NORTH);
northPane.add(new UILabel(Inter.getLocText("FR-Designer_Type") + ":"));
editorTypeComboBox = new EditorTypeComboBox(pane != null); editorTypeComboBox = new EditorTypeComboBox(pane != null);
editorTypeComboBox.setPreferredSize(new Dimension(150, 30)); editorTypeComboBox.setPreferredSize(new Dimension(155, 30));
editorTypeComboBox.setMaximumRowCount(16); editorTypeComboBox.setMaximumRowCount(16);
northPane.add(editorTypeComboBox);
UILabel emptyLabel = new UILabel();
emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, p, f};
double[] rowSize = {p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText(new String[]{"FR-Designer_Selection", "FR-Designer_Widget"})), emptyLabel, editorTypeComboBox},
};
northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
northPane.setBorder(BorderFactory.createEmptyBorder(12, 10, 10, 15));
this.add(northPane, BorderLayout.NORTH);
editorTypeComboBox.addItemListener(this); editorTypeComboBox.addItemListener(this);
cellEditorCardPane = new CellWidgetCardPane(pane); cellEditorCardPane = new CellWidgetCardPane(pane);
@ -64,12 +77,11 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
this.addAttributeChangeListener(listener); this.addAttributeChangeListener(listener);
} }
protected JPanel createContentPane(){ protected JPanel createContentPane() {
return new JPanel(); return new JPanel();
} }
AttributeChangeListener listener = new AttributeChangeListener() { AttributeChangeListener listener = new AttributeChangeListener() {
@Override @Override
public void attributeChange() { public void attributeChange() {
@ -267,7 +279,8 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
&& ComparatorUtils.equals(((Item) o).name, name); && ComparatorUtils.equals(((Item) o).name, name);
} }
} }
public String getIconPath(){
public String getIconPath() {
return ""; return "";
} }

36
designer/src/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java

@ -1,9 +1,12 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
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.Inter; import com.fr.general.Inter;
@ -19,24 +22,25 @@ public class BasicWidgetPropertySettingPane extends BasicPane {
private Widget widget; private Widget widget;
public BasicWidgetPropertySettingPane() { public BasicWidgetPropertySettingPane() {
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(new BorderLayout());
JPanel pane1 = FRGUIPaneFactory.createBorderLayout_S_Pane(); enableCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Visible"), true);
pane1.setBorder(BorderFactory.createEmptyBorder(0, -2, 0, 0)); visibleCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Widget-Visible"), true);
this.add(pane1);
JPanel pane2 = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
enableCheckBox = new UICheckBox(Inter.getLocText("Enabled"), true);
pane2.add(enableCheckBox);
visibleCheckBox = new UICheckBox(Inter.getLocText("Widget-Visible"), true);
pane2.add(visibleCheckBox);
pane1.add(pane2, BorderLayout.NORTH);
JPanel pane3 = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
widgetNameComboBox = new ParameterTreeComboBox(); widgetNameComboBox = new ParameterTreeComboBox();
widgetNameComboBox.refreshTree(); widgetNameComboBox.refreshTree();
pane3.add(new UILabel(Inter.getLocText("Form-Widget_Name") + ":")); double f = TableLayout.FILL;
pane3.add(widgetNameComboBox); double p = TableLayout.PREFERRED;
pane1.add(pane3, BorderLayout.CENTER); Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Form-Widget_Name") + " "), widgetNameComboBox},
new Component[]{enableCheckBox, null},
new Component[]{visibleCheckBox, null},
};
double[] rowSize = {p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE);
pane.setBorder(BorderFactory.createEmptyBorder(10,0,10,0));
this.add(pane, BorderLayout.CENTER);
} }

38
designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java

@ -1,20 +1,10 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.*;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
@ -22,6 +12,13 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.FieldEditor; import com.fr.form.ui.FieldEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> { public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> {
private static final int ALLOW_BLANK_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("FR-Designer_Allow_Null") + 30; private static final int ALLOW_BLANK_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("FR-Designer_Allow_Null") + 30;
private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30; private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30;
@ -39,7 +36,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
initErrorMsgPane(); initErrorMsgPane();
JPanel contentPane = this.setFirstContentPane(); JPanel contentPane = this.setFirstContentPane();
if (contentPane != null) { if (contentPane != null) {
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane); UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 24, contentPane);
this.add(uiExpandablePane, BorderLayout.NORTH); this.add(uiExpandablePane, BorderLayout.NORTH);
} }
this.addValidatePane(); this.addValidatePane();
@ -101,7 +98,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void addValidatePane() { protected void addValidatePane() {
validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final UILabel uiLabel = new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"); final UILabel uiLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Error", "FR-Designer_Tooltips"}));
errorMsgTextField = new UITextField(10); errorMsgTextField = new UITextField(10);
allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null")); allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null"));
allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5)); allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));
@ -113,10 +110,10 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
boolean isSelected = allowBlankCheckBox.isSelected(); boolean isSelected = allowBlankCheckBox.isSelected();
uiLabel.setVisible(!isSelected); uiLabel.setVisible(!isSelected);
errorMsgTextField.setVisible(!isSelected); errorMsgTextField.setVisible(!isSelected);
if(isSelected){ if (isSelected) {
uiLabel.setPreferredSize(new Dimension(0, 0)); uiLabel.setPreferredSize(new Dimension(0, 0));
errorMsgTextField.setPreferredSize(new Dimension(0, 0)); errorMsgTextField.setPreferredSize(new Dimension(0, 0));
}else{ } else {
uiLabel.setPreferredSize(new Dimension(66, 20)); uiLabel.setPreferredSize(new Dimension(66, 20));
errorMsgTextField.setPreferredSize(new Dimension(150, 20)); errorMsgTextField.setPreferredSize(new Dimension(150, 20));
} }
@ -127,12 +124,12 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{allowBlankCheckBox, null }, new Component[]{allowBlankCheckBox, null},
new Component[]{uiLabel, errorMsgTextField}, new Component[]{uiLabel, errorMsgTextField},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p,f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 1); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 1);
validatePane.add(panel, BorderLayout.NORTH); validatePane.add(panel, BorderLayout.NORTH);
@ -142,7 +139,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
} }
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Validate"), 280, 20, validatePane); UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Validate"), 280, 24, validatePane);
this.add(uiExpandablePane, BorderLayout.CENTER); this.add(uiExpandablePane, BorderLayout.CENTER);
// JPanel firstPane = GUICoreUtils.createFlowPane(new JComponent[]{allowBlankCheckBox}, FlowLayout.LEFT, 5); // JPanel firstPane = GUICoreUtils.createFlowPane(new JComponent[]{allowBlankCheckBox}, FlowLayout.LEFT, 5);
@ -155,10 +152,9 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
// validatePane.add(secondPane); // validatePane.add(secondPane);
} }
public JPanel setValidatePane(){ public JPanel setValidatePane() {
return null; return null;
} }
} }

35
designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java

@ -1,43 +1,68 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import java.awt.*;
import java.awt.event.KeyListener; import java.awt.event.KeyListener;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.*; import javax.swing.*;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.WaterMark; import com.fr.form.ui.WaterMark;
import com.fr.general.Inter; import com.fr.general.Inter;
public class WaterMarkDictPane extends JPanel{ public class WaterMarkDictPane extends JPanel {
private UITextField waterMarkTextField; private UITextField waterMarkTextField;
public WaterMarkDictPane() { public WaterMarkDictPane() {
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
this.add(new UILabel(Inter.getLocText("WaterMark") + ":")); // this.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
// this.add(new UILabel(Inter.getLocText("WaterMark") + ":"));
waterMarkTextField = new UITextField(13); waterMarkTextField = new UITextField(13);
this.add(waterMarkTextField);
UILabel emptyLabel = new UILabel();
emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 33, 0, 0));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), emptyLabel, waterMarkTextField},
};
double[] rowSize = {p};
double[] columnSize = {p, p, f};
int[][] rowCount = {{1, 1}};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
// JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 5, 0));
this.add(panel, BorderLayout.CENTER);
} }
public void populate(WaterMark waterMark) { public void populate(WaterMark waterMark) {
this.waterMarkTextField.setText(waterMark.getWaterMark()); this.waterMarkTextField.setText(waterMark.getWaterMark());
} }
public void addInputKeyListener(KeyListener kl) { public void addInputKeyListener(KeyListener kl) {
this.waterMarkTextField.addKeyListener(kl); this.waterMarkTextField.addKeyListener(kl);
} }
public void removeInputKeyListener(KeyListener kl) { public void removeInputKeyListener(KeyListener kl) {
this.waterMarkTextField.removeKeyListener(kl); this.waterMarkTextField.removeKeyListener(kl);
} }
public void update(WaterMark waterMark) { public void update(WaterMark waterMark) {
waterMark.setWaterMark(this.waterMarkTextField.getText()); waterMark.setWaterMark(this.waterMarkTextField.getText());
} }
public void setWaterMark(String waterMark) { public void setWaterMark(String waterMark) {
this.waterMarkTextField.setText(waterMark); this.waterMarkTextField.setText(waterMark);
} }
public String getWaterMark() { public String getWaterMark() {
return this.waterMarkTextField.getText(); return this.waterMarkTextField.getText();
} }

94
designer/src/com/fr/poly/PolyBlockProperTable.java

@ -1,17 +1,66 @@
package com.fr.poly; package com.fr.poly;
import java.util.ArrayList; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import javax.swing.table.TableModel; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itable.AbstractPropertyTable; import com.fr.design.mainframe.widget.BasicPropertyPane;
import com.fr.design.gui.itable.PropertyGroup; import com.fr.design.widget.WidgetBoundsPaneFactory;
import com.fr.general.Inter;
import com.fr.poly.group.PolyBoundsGroup; import com.fr.poly.group.PolyBoundsGroup;
import com.fr.poly.group.PolyNameGroup;
import com.fr.report.poly.TemplateBlock; import com.fr.report.poly.TemplateBlock;
public class PolyBlockProperTable extends AbstractPropertyTable { import javax.swing.*;
import java.awt.*;
public class PolyBlockProperTable extends JPanel {
private PolyDesigner designer; private PolyDesigner designer;
private UISpinner x;
private UISpinner y;
private UISpinner width;
private UISpinner height;
private BasicPropertyPane blockPropertyPane;
private boolean isPopulating = false;
private static final int MAX_SPINNER_VALUE = 10000;
public PolyBlockProperTable() {
initPropertyPane();
initListener(this);
}
private void initPropertyPane() {
this.setLayout(new BorderLayout());
blockPropertyPane = new BasicPropertyPane();
UIExpandablePane basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 280, 24, blockPropertyPane);
this.add(basicPane, BorderLayout.NORTH);
x = new UISpinner(0, MAX_SPINNER_VALUE, 1);
y = new UISpinner(0, MAX_SPINNER_VALUE, 1);
width = new UISpinner(0, MAX_SPINNER_VALUE, 1);
height = new UISpinner(0, MAX_SPINNER_VALUE, 1);
UIExpandablePane boundsPane = WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height);
this.add(boundsPane, BorderLayout.CENTER);
}
private void initListener(Container parentComponent) {
for (int i = 0; i < parentComponent.getComponentCount(); i++) {
Component tmpComp = parentComponent.getComponent(i);
if (tmpComp instanceof Container) {
initListener((Container) tmpComp);
}
if (tmpComp instanceof UIObserver) {
((UIObserver) tmpComp).registerChangeListener(new UIObserverListener() {
@Override
public void doChange() {
update();
}
});
}
}
}
/** /**
* 初始化属性表 * 初始化属性表
@ -20,16 +69,16 @@ public class PolyBlockProperTable extends AbstractPropertyTable {
* *
*/ */
public void initPropertyGroups(Object source) { public void initPropertyGroups(Object source) {
groups = new ArrayList<PropertyGroup>();
if (source instanceof TemplateBlock) { if (source instanceof TemplateBlock) {
TemplateBlock block = (TemplateBlock) source; TemplateBlock block = (TemplateBlock) source;
PolyNameGroup namegroup = new PolyNameGroup(block); blockPropertyPane.getWidgetNameField().setText(block.getBlockName());
groups.add(new PropertyGroup(namegroup)); final PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget());
PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget());
groups.add(new PropertyGroup(boundsgroup)); x.setValue((int)boundsgroup.getValue(0, 1));
y.setValue((int)boundsgroup.getValue(1, 1));
width.setValue((int)boundsgroup.getValue(2, 1));
height.setValue((int)boundsgroup.getValue(3, 1));
} }
TableModel model = new BeanTableModel();
setModel(model);
this.repaint(); this.repaint();
} }
@ -42,8 +91,23 @@ public class PolyBlockProperTable extends AbstractPropertyTable {
} }
public void populate(PolyDesigner designer) { public void populate(PolyDesigner designer) {
isPopulating = true;
this.designer = designer; this.designer = designer;
initPropertyGroups(this.designer.getEditingTarget()); initPropertyGroups(this.designer.getEditingTarget());
isPopulating = false;
} }
public void update() {
TemplateBlock block = this.designer.getEditingTarget();
if (isPopulating || block == null) {
return;
}
block.setBlockName(blockPropertyPane.getWidgetNameField().getText());
PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget());
boundsgroup.setValue(x.getValue(), 0, 1);
boundsgroup.setValue(y.getValue(), 1, 1);
boundsgroup.setValue(width.getValue(), 2, 1);
boundsgroup.setValue(height.getValue(), 3, 1);
firePropertyEdit();
}
} }

2
designer/src/com/fr/poly/creator/ECBlockEditor.java

@ -143,6 +143,7 @@ public class ECBlockEditor extends BlockEditor<ECBlockPane, PolyECBlock> {
} }
QuickEditorRegion.getInstance().populate(editComponent.getCurrentEditor()); QuickEditorRegion.getInstance().populate(editComponent.getCurrentEditor());
CellElementPropertyPane.getInstance().populate(editComponent); CellElementPropertyPane.getInstance().populate(editComponent);
CellWidgetPropertyPane.getInstance().populate(editComponent);
Selection Selection = ((JWorkBook) (HistoryTemplateListPane.getInstance().getCurrentEditingTemplate())).getEditingElementCasePane().getSelection(); Selection Selection = ((JWorkBook) (HistoryTemplateListPane.getInstance().getCurrentEditingTemplate())).getEditingElementCasePane().getSelection();
if (Selection instanceof FloatSelection) { if (Selection instanceof FloatSelection) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT);
@ -155,6 +156,7 @@ public class ECBlockEditor extends BlockEditor<ECBlockPane, PolyECBlock> {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance()); EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance()); EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance());
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(CellWidgetPropertyPane.getInstance());
} }
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance()); EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());

2
designer/src/com/fr/quickeditor/floatquick/FloatImageQuickEditor.java

@ -42,7 +42,7 @@ public class FloatImageQuickEditor extends FloatQuickEditor {
JPanel pane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel pane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 74, 10, 10)); this.setBorder(BorderFactory.createEmptyBorder(10, 78, 10, 17));
this.add(pane, BorderLayout.CENTER); this.add(pane, BorderLayout.CENTER);

3
designer/src/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java

@ -37,6 +37,7 @@ public class FloatStringQuickEditor extends FloatQuickEditor {
JPanel pane = new JPanel(new BorderLayout(5, 0)); JPanel pane = new JPanel(new BorderLayout(5, 0));
pane.add(stringTextField, BorderLayout.CENTER); pane.add(stringTextField, BorderLayout.CENTER);
pane.add(formulaButton, BorderLayout.EAST); pane.add(formulaButton, BorderLayout.EAST);
pane.setBorder(BorderFactory.createEmptyBorder(0,0,0,7));
formulaButton.setVisible(false); formulaButton.setVisible(false);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
@ -72,7 +73,7 @@ public class FloatStringQuickEditor extends FloatQuickEditor {
Formula formula = (Formula) value; Formula formula = (Formula) value;
str = formula.getContent(); str = formula.getContent();
stringTextField.setLineWrap(false); stringTextField.setLineWrap(false);
this.setBorder(BorderFactory.createEmptyBorder(10, 74, 10, 10)); this.setBorder(BorderFactory.createEmptyBorder(10, 78, 10, 10));
reserveInResult = formula.isReserveInResult(); reserveInResult = formula.isReserveInResult();
reserveOnWriteOrAnaly = formula.isReserveOnWriteOrAnaly(); reserveOnWriteOrAnaly = formula.isReserveOnWriteOrAnaly();
} else { } else {

194
designer_base/src/com/fr/design/constants/UIConstants.java

@ -8,6 +8,7 @@ import com.fr.general.Inter;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*; import java.awt.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
@ -18,6 +19,8 @@ public interface UIConstants {
public static final Icon BLACK_ICON = BaseUtils.readIcon("/com/fr/base/images/cell/blank.gif"); public static final Icon BLACK_ICON = BaseUtils.readIcon("/com/fr/base/images/cell/blank.gif");
public static final Border CELL_ATTR_EMPTYBORDER = BorderFactory.createEmptyBorder(0 ,10, 0, 0);
public static final Border CELL_ATTR_NORMALBORDER = BorderFactory.createEmptyBorder(0 ,10, 0, 15);
public static final int SIZE = 17; public static final int SIZE = 17;
@ -114,6 +117,156 @@ public interface UIConstants {
public static final BufferedImage DRAG_DOT_VERTICAL = BaseUtils.readImage("com/fr/design/images/control/dotv.png"); public static final BufferedImage DRAG_DOT_VERTICAL = BaseUtils.readImage("com/fr/design/images/control/dotv.png");
public static final BufferedImage POP_BUTTON_DOWN = BaseUtils.readImage("com/fr/design/images/buttonicon/popdownarrow.png"); public static final BufferedImage POP_BUTTON_DOWN = BaseUtils.readImage("com/fr/design/images/buttonicon/popdownarrow.png");
public static final BufferedImage POP_BUTTON_UP = BaseUtils.readImage("com/fr/design/images/buttonicon/popuparrow.png"); public static final BufferedImage POP_BUTTON_UP = BaseUtils.readImage("com/fr/design/images/buttonicon/popuparrow.png");
public static final BufferedImage DRAG_DOWN_SELECTED_SMALL = BaseUtils.readImage("com/fr/design/images/buttonicon/downSelected.png");
public static final BufferedImage DRAG_LEFT_NORMAL_SMALL = BaseUtils.readImage("com/fr/design/images/buttonicon/leftNormal.png");
public static final int MODEL_NORMAL = 0;
public static final int MODEL_PRESS = 1;
public static final Icon ARROW_DOWN_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/arrowdown.png");
public static final Icon ARROW_UP_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/arrowup.png");
public static final Icon YES_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/yes.png");
public static final Icon CHOOSEN_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/select_item.png");
public static final Icon PRE_WIDGET_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/prewidget.png");
public static final Icon EDIT_NORMAL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/editn.png");
public static final Icon EDIT_PRESSED_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/editp.png");
public static final Icon HIDE_NORMAL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/hiden.png");
public static final Icon HIDE_PRESSED_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/hidep.png");
public static final Icon VIEW_NORMAL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/viewn.png");
public static final Icon VIEW_PRESSED_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/viewp.png");
public static final Icon RUN_BIG_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/run24.png");
public static final Icon RUN_SMALL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/runs.png");
public static final Icon PAGE_BIG_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/pageb24.png");
public static final Icon WRITE_BIG_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/writeb24.png");
public static final Icon ANA_BIG_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/anab24.png");
public static final Icon PAGE_SMALL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/pages.png");
public static final Icon WRITE_SMALL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/writes.png");
public static final Icon ANA_SMALL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/anas.png");
public static final Icon REFRESH_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/refresh.png");
public static final Icon FONT_ICON = BaseUtils.readIcon("/com/fr/design/images/gui/color/foreground.png");
public static final Icon HISTORY_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/history.png");
public static final Icon DELETE_ICON = BaseUtils.readIcon("com/fr/design/images/m_file/close.png");
public static final Icon EDIT_ICON = BaseUtils.readIcon("com/fr/design/images/m_file/edit.png");
public static final Icon SEARCH_ICON = BaseUtils.readIcon("/com/fr/design/images/data/search.png");
public static final Icon CLEAR_ICON = BaseUtils.readIcon("/com/fr/design/images/data/source/delete.png");
public static final Icon LIST_EDIT_ICON = BaseUtils.readIcon("/com/fr/desi/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.constants;
import com.fr.base.BaseUtils;
import com.fr.general.Inter;
import com.fr.stable.Constants;
import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*;
import java.awt.image.BufferedImage;
/**
* This class defines the constants used in the designer.
*/
public interface UIConstants {
public static final Icon BLACK_ICON = BaseUtils.readIcon("/com/fr/base/images/cell/blank.gif");
public static final Border CELL_ATTR_EMPTYBORDER = BorderFactory.createEmptyBorder(0 ,10, 0, 0);
public static final Border CELL_ATTR_NORMALBORDER = BorderFactory.createEmptyBorder(0 ,10, 0, 15);
public static final int SIZE = 17;
public static final int GAP_NORMAL = 10; // 10px
/**
* Cell default cursor.
*/
public static final Cursor CELL_DEFAULT_CURSOR = Toolkit.getDefaultToolkit().createCustomCursor(
BaseUtils.readImage("/com/fr/base/images/cell/cursor/cell_default.png"),
new Point(16, 16), "CellDefaultCursor");
public static final Cursor DRAW_CURSOR = Toolkit.getDefaultToolkit().createCustomCursor(
BaseUtils.readImage("/com/fr/base/images/cell/cursor/cursor_draw.png"),
new Point(16, 16), "DrawCursor");
public static final Cursor FORMAT_BRUSH_CURSOR = Toolkit.getDefaultToolkit().createCustomCursor(
BaseUtils.readImage("/com/fr/base/images/cell/cursor/brush_cursor0.png"),
new Point(16, 16), "formatBrushCursor");
/**
* Border style array.
*/
public final static int[] BORDER_LINE_STYLE_ARRAY = new int[]{
Constants.LINE_THIN, //Thin border.
Constants.LINE_MEDIUM, //Medium border
Constants.LINE_DASH, //dash border
Constants.LINE_HAIR, //hair-line border
Constants.LINE_HAIR2, //hair-line border
Constants.LINE_THICK, //Thick border
Constants.LINE_DOUBLE, //double-line border
Constants.LINE_DOT, //dot border
Constants.LINE_MEDIUM_DASH, //Medium dashed border
Constants.LINE_DASH_DOT, //dash-dot border
Constants.LINE_MEDIUM_DASH_DOT, //medium dash-dot border
Constants.LINE_DASH_DOT_DOT, //dash-dot-dot border
Constants.LINE_MEDIUM_DASH_DOT_DOT, //medium dash-dot-dot border
Constants.LINE_SLANTED_DASH_DOT, //slanted dash-dot border
};
public static final Color LINE_COLOR = new Color(153, 153, 153);
public static final Color FONT_COLOR = new Color(51, 51, 51);
public static final Color LIGHT_BLUE = new Color(182, 217, 253);
public static final Color SKY_BLUE = new Color(164, 192, 220);
public static final Color OCEAN_BLUE = new Color(141, 179, 217);
public static final Color DARK_BLUE = new Color(0, 88, 144);
public static final Color NORMAL_BACKGROUND = new Color(212, 212, 216);
public static final Color TREE_BACKGROUND = new Color(240, 240, 243);
public static final Color TOOL_PANE_BACKGROUND = new Color(232, 232, 223);
public static final Color SELECT_TAB = new Color(245, 245, 247);
public static final Color TOOLBARUI_BACKGROUND = new Color(255, 255, 255);
public static final Color SHADOW_GREY = new Color(217, 218, 221);
public static final Color SHADOW_CENTER = new Color(200, 200, 200);
public static final Color SHADOW_PURPLE = new Color(255, 0, 255);
public static final Color FLESH_BLUE = new Color(65, 155, 249);
public static final Color HOVER_BLUE = new Color(0xd2d2d2);
public static final Color DOTTED_LINE_COLOR = new Color(35, 108, 184);
public static final Color AUTHORITY_COLOR = new Color(88, 125, 153);
public static final Color AUTHORITY_BLUE = new Color(0xe2e2e2);
public static final Color AUTHORITY_DARK_BLUE = new Color(136, 164, 186);
public static final Color AUTHORITY_PRESS_BLUE = new Color(131, 159, 181);
public static final Color AUTHORITY_LINE_COLOR = new Color(0, 124, 229);
public static final Color AUTHORITY_SHEET_DARK = new Color(86, 120, 143);
public static final Color AUTHORITY_SHEET_LIGHT = new Color(156, 204, 238);
public static final Color AUTHORITY_SHEET_UNSELECTED = new Color(146, 192, 225);
public static final Color ATTRIBUTE_PRESS = new Color(0xD8F2FD);
public static final Color ATTRIBUTE_NORMAL = new Color(0xDADADD);
public static final Color ATTRIBUTE_HOVER = new Color(0xC9C9CD);
public static final Color CHECKBOX_HOVER_SELECTED = new Color(0x3394f0);
public static final Color TEXT_FILED_BORDER_SELECTED = new Color(0x3384f0);
public static final Color SHEET_NORMAL = new Color(0xc8c8ca);
public static final Color SELECTED_BACKGROUND = new Color(0xdeedfe);
public static final Color SELECTED_BORDER_LINE_COLOR = new Color(0x3384f0);
public static final Color DEFAULT_BG_RULER = new Color(0xffffff);
public static final Color RULER_LINE_COLOR = new Color(0xababab);
public static final Color RULER_SCALE_COLOR = new Color(0x4e504f);
public static final Color PROPERTY_PANE_BACKGROUND = new Color(0xdadadd);
public static final Color SPLIT_LINE = new Color(201, 198, 184);
public static final BufferedImage DRAG_BAR = BaseUtils.readImage("com/fr/design/images/control/bar.png");
public static final BufferedImage DRAG_BAR_RIGHT = BaseUtils.readImage("com/fr/design/images/control/barm.png");
public static final BufferedImage DRAG_BAR_LEFT = BaseUtils.readImage("com/fr/design/images/control/barl.png");
public static final BufferedImage DRAG_UP_NORMAL = BaseUtils.readImage("com/fr/design/images/control/upnor.png");
public static final BufferedImage DRAG_UP_PRESS = BaseUtils.readImage("com/fr/design/images/control/uppre.png");
public static final BufferedImage DRAG_DOWN_NORMAL = BaseUtils.readImage("com/fr/design/images/control/downnor.png");
public static final BufferedImage DRAG_DOWN_PRESS = BaseUtils.readImage("com/fr/design/images/control/downpre.png");
public static final BufferedImage DRAG_RIGHT_NORMAL = BaseUtils.readImage("com/fr/design/images/control/rightnor.png");
public static final BufferedImage DRAG_RIGHT_PRESS = BaseUtils.readImage("com/fr/design/images/control/rightpre.png");
public static final BufferedImage DRAG_LEFT_NORMAL = BaseUtils.readImage("com/fr/design/images/control/leftnor.png");
public static final BufferedImage DRAG_LEFT_PRESS = BaseUtils.readImage("com/fr/design/images/control/leftpre.png");
public static final BufferedImage DRAG_DOT = BaseUtils.readImage("com/fr/design/images/control/dot.png");
public static final BufferedImage DRAG_DOT_VERTICAL = BaseUtils.readImage("com/fr/design/images/control/dotv.png");
public static final BufferedImage POP_BUTTON_DOWN = BaseUtils.readImage("com/fr/design/images/buttonicon/popdownarrow.png");
public static final BufferedImage POP_BUTTON_UP = BaseUtils.readImage("com/fr/design/images/buttonicon/popuparrow.png");
public static final BufferedImage DRAG_DOWN_SELECTED_SMALL = BaseUtils.readImage("com/fr/design/images/buttonicon/downSelected.png");
public static final BufferedImage DRAG_LEFT_NORMAL_SMALL = BaseUtils.readImage("com/fr/design/images/buttonicon/leftNormal.png");
public static final int MODEL_NORMAL = 0; public static final int MODEL_NORMAL = 0;
public static final int MODEL_PRESS = 1; public static final int MODEL_PRESS = 1;
public static final Icon ARROW_DOWN_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/arrowdown.png"); public static final Icon ARROW_DOWN_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/arrowdown.png");
@ -147,6 +300,47 @@ public interface UIConstants {
public static final Color PRESSED_DARK_GRAY = new Color(127, 127, 127); public static final Color PRESSED_DARK_GRAY = new Color(127, 127, 127);
public static final Color GRDIENT_DARK_GRAY = new Color(45, 45, 45); public static final Color GRDIENT_DARK_GRAY = new Color(45, 45, 45);
public static final Color BARNOMAL = new Color(232, 232, 233); public static final Color BARNOMAL = new Color(232, 232, 233);
public static final Color COMPONENT_BACKGROUND_COLOR = new Color(237,237,238);
public static final int ARC = 0;
public static final int BUTTON_GROUP_ARC = 6;
public static final int LARGEARC = 6;
public static final Stroke BS = new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 2f, new float[]{3, 1}, 0);
public static final Icon PREVIEW_DOWN = BaseUtils.readIcon("com/fr/design/images/buttonicon/prevew_down_icon.png");
public static final Icon CLOSE_OF_AUTHORITY = BaseUtils.readIcon("/com/fr/design/images/m_report/close.png");
public static final Icon CLOSE_OVER_AUTHORITY = BaseUtils.readIcon("/com/fr/design/images/m_report/close_over.png");
public static final Icon CLOSE_PRESS_AUTHORITY = BaseUtils.readIcon("/com/fr/design/images/m_report/close_press.png");
public static final int CLOSE_AUTHORITY_HEIGHT_AND_WIDTH = 24;
/**
* 正在加载的界面
*/
public static final Object PENDING = new Object() {
@Override
public String toString() {
return Inter.getLocText("Loading") + "...";
}
};
/**
* 数据库连接失败的界面
*/
public static final Object CONNECTION_FAILED = new Object() {
public String toString() {
return Inter.getLocText(new String[]{"Database", "Datasource-Connection_failed"}) + "!";
}
};
/**
* 自动补全的默认快捷键一般来说是 alt + /.
*/
public static final String DEFAULT_AUTO_COMPLETE = "alt + SLASH";gn/images/control/edit.png");
public static final Icon LIST_EDIT_WHITE_ICON = BaseUtils.readIcon("/com/fr/design/images/control/edit_white.png");
public static final Color PRESSED_DARK_GRAY = new Color(127, 127, 127);
public static final Color GRDIENT_DARK_GRAY = new Color(45, 45, 45);
public static final Color BARNOMAL = new Color(232, 232, 233);
public static final Color COMPONENT_BACKGROUND_COLOR = new Color(237,237,238);
public static final int ARC = 0; public static final int ARC = 0;
public static final int BUTTON_GROUP_ARC = 6; public static final int BUTTON_GROUP_ARC = 6;
public static final int LARGEARC = 6; public static final int LARGEARC = 6;

31
designer_base/src/com/fr/design/foldablepane/HeaderPane.java

@ -11,6 +11,9 @@ import java.awt.image.BufferedImage;
*/ */
public class HeaderPane extends JPanel { public class HeaderPane extends JPanel {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final int TITLE_X = 9;
private static final int LEFT_X = 221;
private static final int LEFT_Y = 6;
private int headWidth = 280; private int headWidth = 280;
private int headHeight = 25; private int headHeight = 25;
private Color bgColor; private Color bgColor;
@ -52,19 +55,19 @@ public class HeaderPane extends JPanel {
private BufferedImage createPanelImage() { private BufferedImage createPanelImage() {
BufferedImage panelImage = new BufferedImage(getWidth(), headHeight, BufferedImage.TYPE_INT_ARGB); BufferedImage panelImage = new BufferedImage(getWidth(), headHeight, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = panelImage.createGraphics(); Graphics2D g2d = panelImage.createGraphics();
g2d.setColor(UIConstants.COMPONENT_BACKGROUND_COLOR);
g2d.fillRect(0, 0, headWidth, headHeight); g2d.fillRect(0, 0, headWidth, headHeight);
g2d.drawImage(UIConstants.DRAG_BAR, 0, 0, headWidth, headHeight, null); // g2d.drawImage(UIConstants.DRAG_BAR, 0, 0, headWidth, headHeight, null);
g2d.setFont(new Font("SimSun", 0, fontSize)); g2d.setFont(new Font("SimSun", 0, fontSize));
g2d.setPaint(bgColor); g2d.setPaint(bgColor);
// g2d.drawString(this.title, fontSize/2, headHeight-fontSize/3); // g2d.drawString(this.title, fontSize/2, headHeight-fontSize/3);
g2d.drawString(this.title, 0, headHeight - fontSize / 2 - 1); g2d.drawString(this.title, TITLE_X, headHeight - fontSize / 2 - 1);
if (this.isShow) { if (this.isShow) {
image = UIConstants.DRAG_DOWN_PRESS; image = UIConstants.DRAG_DOWN_SELECTED_SMALL;
g2d.drawImage(image, title.length() * fontSize, headHeight / 2 - 1, null); g2d.drawImage(image, LEFT_X, LEFT_Y, null);
} else { } else {
image = UIConstants.DRAG_RIGHT_PRESS; image = UIConstants.DRAG_LEFT_NORMAL_SMALL;
g2d.drawImage(image, title.length() * fontSize, headHeight / 3, null); g2d.drawImage(image, LEFT_X, LEFT_Y , null);
} }
@ -95,13 +98,13 @@ public class HeaderPane extends JPanel {
} }
public static void main(String[] args) { public static void main(String[] args) {
// JFrame mainFrame = new JFrame("UI Demo - Gloomyfish"); JFrame mainFrame = new JFrame("UI Demo - Gloomyfish");
// mainFrame.getContentPane().setLayout(new BorderLayout()); mainFrame.getContentPane().setLayout(new BorderLayout());
// mainFrame.getContentPane().add(new HeaderPane(Color.black, "基本", 280, 24), BorderLayout.CENTER); mainFrame.getContentPane().add(new HeaderPane(Color.black, "基本", 280, 24), BorderLayout.CENTER);
// mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// mainFrame.pack(); mainFrame.pack();
// mainFrame.setSize(280, 400); mainFrame.setSize(250, 400);
// mainFrame.setVisible(true); mainFrame.setVisible(true);
} }
} }

3
designer_base/src/com/fr/design/foldablepane/UIExpandablePane.java

@ -1,5 +1,7 @@
package com.fr.design.foldablepane; package com.fr.design.foldablepane;
import com.fr.design.constants.UIConstants;
import java.awt.*; import java.awt.*;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
@ -35,6 +37,7 @@ public class UIExpandablePane extends JPanel {
headerPanel = new HeaderPane(color, title,headWidth,headHeight); headerPanel = new HeaderPane(color, title,headWidth,headHeight);
headerPanel.addMouseListener(new PanelAction()); headerPanel.addMouseListener(new PanelAction());
contentPanel.setBorder(UIConstants.CELL_ATTR_NORMALBORDER);
this.add(headerPanel, BorderLayout.NORTH); this.add(headerPanel, BorderLayout.NORTH);
this.add(contentPanel, BorderLayout.CENTER); this.add(contentPanel, BorderLayout.CENTER);
setOpaque(false); setOpaque(false);

20
designer_base/src/com/fr/design/formula/TinyFormulaPane.java

@ -76,23 +76,15 @@ public class TinyFormulaPane extends BasicBeanPane<String> implements UIObserver
protected void initLayout() { protected void initLayout() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {f };
double[] rowSize = { p };
Component[] components1 = new Component[]{
formulaTextFieldButton
} ;
JPanel pane = new JPanel(new BorderLayout(0,0)); JPanel pane = new JPanel(new BorderLayout(0,0));
pane.add(formulaTextField,BorderLayout.CENTER); JPanel pane1 = new JPanel(new BorderLayout(0,0));
pane.add(GUICoreUtils.createFlowPane(components1,FlowLayout.LEFT, LayoutConstants.HGAP_LARGE),BorderLayout.EAST); pane1.add(formulaTextField, BorderLayout.NORTH);
pane1.setBorder(BorderFactory.createEmptyBorder(0,0,0,5));
Component[][] components2 = new Component[][]{ pane.add(pane1,BorderLayout.CENTER);
new Component[]{pane} pane.add(formulaTextFieldButton,BorderLayout.EAST);
};
JPanel panel= TableLayoutHelper.createTableLayoutPane(components2,rowSize,columnSize) ;
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER) ; this.add(pane,BorderLayout.NORTH) ;
} }
/** /**

265
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,10 +53,9 @@ 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() {
return regComboBox; return regComboBox;
} }
@ -71,21 +68,25 @@ public class RegPane extends BasicPane {
this.initComponents(); this.initComponents();
} }
private void initComponents(){ private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
JPanel contentPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
this.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
this.add(contentPane, BorderLayout.NORTH);
contentPane.add(new UILabel(Inter.getLocText("FR-Designer_Input_Rule")));
regComboBox = new UIComboBox(regType); regComboBox = new UIComboBox(regType);
regComboBox.setPreferredSize(new Dimension(140, 20));
regComboBox.setRenderer(listCellRender); regComboBox.setRenderer(listCellRender);
UILabel uiLabel = new UILabel();
uiLabel.setPreferredSize(new Dimension(20, 20));
contentPane.add(uiLabel);
contentPane.add(regComboBox);
regErrorMsgPane = new RegErrorMsgPane(); double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Input_Rule") + " "), regComboBox},
};
double[] rowSize = {p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE);
panel.setBorder(BorderFactory.createEmptyBorder(8, 0, 0, 0));
this.add(panel, BorderLayout.NORTH);
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);
@ -93,35 +94,26 @@ public class RegPane extends BasicPane {
cardPane.add((regLengthPane = new RegLengthPane()), "Length"); cardPane.add((regLengthPane = new RegLengthPane()), "Length");
cardPane.add((regPhonePane = new RegPhonePane()), "Phone"); cardPane.add((regPhonePane = new RegPhonePane()), "Phone");
cardPane.add((customRegRexPane = new CustomRegRexPane()), "Custom"); cardPane.add((customRegRexPane = new CustomRegRexPane()), "Custom");
cardPane.setBorder(BorderFactory.createEmptyBorder(8, 12, 0, 0));
this.add(cardPane, BorderLayout.CENTER); this.add(cardPane, BorderLayout.CENTER);
this.add(regErrorMsgPane, BorderLayout.SOUTH); 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();
if(regExp instanceof PhoneReg) { if (regExp instanceof PhoneReg) {
cardPane.setPreferredSize(new Dimension(220, 30));
Object selectItem = regPhonePane.dataTypeComboBox.getSelectedItem(); Object selectItem = regPhonePane.dataTypeComboBox.getSelectedItem();
String regString = selectItem == null ? StringUtils.EMPTY : selectItem.toString(); String regString = selectItem == null ? StringUtils.EMPTY : selectItem.toString();
firePhoneRegAction(regString); firePhoneRegAction(regString);
detailedCardLayout.show(cardPane, "Phone"); detailedCardLayout.show(cardPane, "Phone");
} else { } else {
if (regExp instanceof LengthReg){ if (regExp instanceof LengthReg) {
cardPane.setPreferredSize(new Dimension(220, 60));
detailedCardLayout.show(cardPane, "Length"); detailedCardLayout.show(cardPane, "Length");
} else if (regExp instanceof CustomReg){ } else if (regExp instanceof CustomReg) {
cardPane.setPreferredSize(new Dimension(220, 30));
detailedCardLayout.show(cardPane, "Custom"); detailedCardLayout.show(cardPane, "Custom");
} else { } else {
cardPane.setPreferredSize(new Dimension(0,0 ));
detailedCardLayout.show(cardPane, "Default"); detailedCardLayout.show(cardPane, "Default");
} }
fireRegChangeAction(); fireRegChangeAction();
} }
if(regExp instanceof NoneReg){
regErrorMsgPane.setVisible(false);
return;
}
regErrorMsgPane.setVisible(true);
} }
}); });
} }
@ -154,21 +146,19 @@ 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) {
return regPhonePane.update(); return regPhonePane.update();
} else if(regExp instanceof NoneReg || regExp instanceof MailReg || regExp instanceof IDCardReg } else if (regExp instanceof NoneReg || regExp instanceof MailReg || regExp instanceof IDCardReg
|| regExp instanceof PostCardReg || regExp instanceof PhoneReg || regExp instanceof MobileReg) { || regExp instanceof PostCardReg || regExp instanceof PhoneReg || regExp instanceof MobileReg) {
return regExp; return regExp;
} } else if (regExp instanceof CustomReg) {
else if (regExp instanceof CustomReg){
if (customRegRexPane.isEmpty()) { if (customRegRexPane.isEmpty()) {
return new NoneReg(); return new NoneReg();
} }
@ -187,7 +177,7 @@ public class RegPane extends BasicPane {
private static class DefaultRegPane extends DisplayPane { private static class DefaultRegPane extends DisplayPane {
public RegExp regRex; public RegExp regRex;
public DefaultRegPane(){ public DefaultRegPane() {
} }
@ -213,10 +203,7 @@ public class RegPane extends BasicPane {
* 添加电话规则监听器 * 添加电话规则监听器
* *
* @param listener 监听器 * @param listener 监听器
*
*
* @date 2014-12-3-下午7:30:55 * @date 2014-12-3-下午7:30:55
*
*/ */
public void addPhoneRegListener(PhoneRegListener listener) { public void addPhoneRegListener(PhoneRegListener listener) {
this.listenerList.add(PhoneRegListener.class, listener); this.listenerList.add(PhoneRegListener.class, listener);
@ -226,10 +213,7 @@ public class RegPane extends BasicPane {
* 移除电话规则监听器 * 移除电话规则监听器
* *
* @param listener 监听器 * @param listener 监听器
*
*
* @date 2014-12-3-下午7:30:55 * @date 2014-12-3-下午7:30:55
*
*/ */
public void removePhoneRegListener(PhoneRegListener listener) { public void removePhoneRegListener(PhoneRegListener listener) {
this.listenerList.remove(PhoneRegListener.class, listener); this.listenerList.remove(PhoneRegListener.class, listener);
@ -239,10 +223,7 @@ public class RegPane extends BasicPane {
* 添加正则监听器 * 添加正则监听器
* *
* @param listener 监听器 * @param listener 监听器
*
*
* @date 2014-12-3-下午7:29:48 * @date 2014-12-3-下午7:29:48
*
*/ */
public void addRegChangeListener(RegChangeListener listener) { public void addRegChangeListener(RegChangeListener listener) {
this.listenerList.add(RegChangeListener.class, listener); this.listenerList.add(RegChangeListener.class, listener);
@ -252,10 +233,7 @@ public class RegPane extends BasicPane {
* 移除正则监听器 * 移除正则监听器
* *
* @param listener 监听器 * @param listener 监听器
*
*
* @date 2014-12-3-下午7:29:48 * @date 2014-12-3-下午7:29:48
*
*/ */
public void removeRegChangeListener(RegChangeListener listener) { public void removeRegChangeListener(RegChangeListener listener) {
this.listenerList.remove(RegChangeListener.class, listener); this.listenerList.remove(RegChangeListener.class, listener);
@ -263,41 +241,45 @@ public class RegPane extends BasicPane {
public class PhoneRegEvent extends EventObject { public class PhoneRegEvent extends EventObject {
private String phoneRegString; private String phoneRegString;
public PhoneRegEvent(Object source, String phoneRegString) { public PhoneRegEvent(Object source, String phoneRegString) {
super(source); super(source);
this.setPhoneRegString(phoneRegString); this.setPhoneRegString(phoneRegString);
} }
public void setPhoneRegString(String phoneRegString) { public void setPhoneRegString(String phoneRegString) {
this.phoneRegString = phoneRegString; this.phoneRegString = phoneRegString;
} }
public String getPhoneRegString() { public String getPhoneRegString() {
return phoneRegString; return phoneRegString;
} }
} }
public class RegChangeEvent extends EventObject { public class RegChangeEvent extends EventObject {
private String regString; private String regString;
public RegChangeEvent(Object source, String regString) { public RegChangeEvent(Object source, String regString) {
super(source); super(source);
this.setRegString(regString); this.setRegString(regString);
} }
public void setRegString(String regString) { public void setRegString(String regString) {
this.regString = regString; this.regString = regString;
} }
public String getRegString() { public String getRegString() {
return regString; return regString;
} }
} }
public interface PhoneRegListener extends EventListener{ public interface PhoneRegListener extends EventListener {
/** /**
* 电话规则变化监听 * 电话规则变化监听
* *
* @param e 变化事件 * @param e 变化事件
*
*
* @date 2014-12-3-下午7:29:01 * @date 2014-12-3-下午7:29:01
*
*/ */
void phoneRegChangeAction(PhoneRegEvent e); void phoneRegChangeAction(PhoneRegEvent e);
@ -308,28 +290,29 @@ public class RegPane extends BasicPane {
/** /**
* 正则表达规则变化监听 * 正则表达规则变化监听
* *
*
* @date 2014-12-3-下午7:29:01 * @date 2014-12-3-下午7:29:01
*
*/ */
void regChangeAction(); void regChangeAction();
} }
protected void firePhoneRegAction(String phoneReg) { protected void firePhoneRegAction(String phoneReg) {
Object[] listeners = listenerList.getListenerList(); Object[] listeners = listenerList.getListenerList();
for (int i = listeners.length-2; i>=0; i-=2) { for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i]==PhoneRegListener.class) { if (listeners[i] == PhoneRegListener.class) {
((PhoneRegListener)listeners[i+1]).phoneRegChangeAction(new PhoneRegEvent(this , phoneReg)); ((PhoneRegListener) listeners[i + 1]).phoneRegChangeAction(new PhoneRegEvent(this, phoneReg));
} }
} }
} }
protected void fireRegChangeAction() { protected void fireRegChangeAction() {
Object[] listeners = listenerList.getListenerList(); Object[] listeners = listenerList.getListenerList();
for (int i = listeners.length-2; i>=0; i-=2) { for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i]==RegChangeListener.class) { if (listeners[i] == RegChangeListener.class) {
((RegChangeListener)listeners[i+1]).regChangeAction(); ((RegChangeListener) listeners[i + 1]).regChangeAction();
} }
} }
} }
private class RegPhonePane extends DisplayPane { private class RegPhonePane extends DisplayPane {
private static final String EMB_REG1 = "025-85679591"; private static final String EMB_REG1 = "025-85679591";
private static final String EMB_REG2 = "02585679591"; private static final String EMB_REG2 = "02585679591";
@ -339,19 +322,19 @@ public class RegPane extends BasicPane {
private UIComboBox dataTypeComboBox; private UIComboBox dataTypeComboBox;
private final String[] dataType = {EMB_REG1, EMB_REG2, EMB_REG3, Inter.getLocText("FR-Designer_Custom")}; private final String[] dataType = {EMB_REG1, EMB_REG2, EMB_REG3, Inter.getLocText("FR-Designer_Custom")};
DefaultComboBoxModel DefaultComboBoxModel= new DefaultComboBoxModel(dataType); DefaultComboBoxModel DefaultComboBoxModel = new DefaultComboBoxModel(dataType);
public RegPhonePane() { public RegPhonePane() {
this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5));
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
this.add(new UILabel(Inter.getLocText("FR-Designer_Data_Type") + ":")); this.add(new UILabel(Inter.getLocText("FR-Designer_Data_Type") + ":"));
dataTypeComboBox = new UIComboBox(DefaultComboBoxModel); dataTypeComboBox = new UIComboBox(DefaultComboBoxModel);
JTextField editFiled = (JTextField)(dataTypeComboBox.getEditor().getEditorComponent()); JTextField editFiled = (JTextField) (dataTypeComboBox.getEditor().getEditorComponent());
editFiled.setDocument(new LimitedDocument(LIMIT_LENGTH, REG_PATTERN)); editFiled.setDocument(new LimitedDocument(LIMIT_LENGTH, REG_PATTERN));
dataTypeComboBox.addItemListener(new ItemListener() { dataTypeComboBox.addItemListener(new ItemListener() {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
if(e.getStateChange() == ItemEvent.SELECTED) { if (e.getStateChange() == ItemEvent.SELECTED) {
if(ComparatorUtils.equals(e.getItem(), dataType[3])) { if (ComparatorUtils.equals(e.getItem(), dataType[3])) {
dataTypeComboBox.setSelectedItem(null); dataTypeComboBox.setSelectedItem(null);
dataTypeComboBox.setEditable(true); dataTypeComboBox.setEditable(true);
firePhoneRegAction(EMB_REG1); firePhoneRegAction(EMB_REG1);
@ -366,6 +349,7 @@ public class RegPane extends BasicPane {
firePhoneRegAction(dataTypeComboBox.getSelectedItem().toString()); firePhoneRegAction(dataTypeComboBox.getSelectedItem().toString());
this.add(dataTypeComboBox); this.add(dataTypeComboBox);
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "PHONE"; return "PHONE";
@ -373,17 +357,17 @@ public class RegPane extends BasicPane {
@Override @Override
public void populate(RegExp regRex) { public void populate(RegExp regRex) {
if(!(regRex instanceof PhoneReg)) { if (!(regRex instanceof PhoneReg)) {
return ; return;
} }
String regstr = ((PhoneReg)regRex).getRegString(); String regstr = ((PhoneReg) regRex).getRegString();
if (checkEmbedded(regstr)){ if (checkEmbedded(regstr)) {
DefaultComboBoxModel.addElement(regstr); DefaultComboBoxModel.addElement(regstr);
} }
dataTypeComboBox.setSelectedItem(((PhoneReg)regRex).getRegString()); dataTypeComboBox.setSelectedItem(((PhoneReg) regRex).getRegString());
} }
private boolean checkEmbedded(String regstr){ private boolean checkEmbedded(String regstr) {
return !ComparatorUtils.equals(EMB_REG1, regstr) && return !ComparatorUtils.equals(EMB_REG1, regstr) &&
!ComparatorUtils.equals(EMB_REG2, regstr) && !ComparatorUtils.equals(EMB_REG2, regstr) &&
!ComparatorUtils.equals(EMB_REG3, regstr); !ComparatorUtils.equals(EMB_REG3, regstr);
@ -392,7 +376,7 @@ public class RegPane extends BasicPane {
@Override @Override
public RegExp update() { public RegExp update() {
PhoneReg regRex = new PhoneReg(); PhoneReg regRex = new PhoneReg();
regRex.setRegString((String)(dataTypeComboBox.getSelectedItem())); regRex.setRegString((String) (dataTypeComboBox.getSelectedItem()));
return regRex; return regRex;
} }
} }
@ -401,31 +385,22 @@ public class RegPane extends BasicPane {
private UISpinner minLenSpinner; private UISpinner minLenSpinner;
private UISpinner maxLenSpinner; private UISpinner maxLenSpinner;
public RegLengthPane(){ public RegLengthPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5));
this.setPreferredSize(new Dimension(210, 56));
// this.add(new UILabel(Inter.getLocText("FR-Designer_Reg_Min_Length") + ":"));
minLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0); minLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
// this.add(minLenSpinner);
// this.add(new UILabel(Inter.getLocText("FR-Designer_Reg_Max_Length") + ":"));
maxLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0); maxLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
// this.add(maxLenSpinner);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Min_Length") + ":"), minLenSpinner }, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Min_Length")), minLenSpinner},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Max_Length") + ":"), maxLenSpinner}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Max_Length")), maxLenSpinner},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p,f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5);
this.add(panel);
this.add(panel, BorderLayout.CENTER);
} }
@Override @Override
@ -435,20 +410,20 @@ public class RegPane extends BasicPane {
@Override @Override
public void populate(RegExp regRex) { public void populate(RegExp regRex) {
if (!(regRex instanceof LengthReg)){ if (!(regRex instanceof LengthReg)) {
return; return;
} }
int minLength = ((LengthReg)regRex).getMinLen(); int minLength = ((LengthReg) regRex).getMinLen();
int maxLength = ((LengthReg)regRex).getMaxLen(); int maxLength = ((LengthReg) regRex).getMaxLen();
minLenSpinner.setValue(minLength); minLenSpinner.setValue(minLength);
maxLenSpinner.setValue(maxLength); maxLenSpinner.setValue(maxLength);
} }
@Override @Override
public RegExp update() { public RegExp update() {
int startLength = ((Number)minLenSpinner.getValue()).intValue(); int startLength = ((Number) minLenSpinner.getValue()).intValue();
int endLength = ((Number)maxLenSpinner.getValue()).intValue(); int endLength = ((Number) maxLenSpinner.getValue()).intValue();
LengthReg regRex = new LengthReg(); LengthReg regRex = new LengthReg();
regRex.setMinLen(startLength); regRex.setMinLen(startLength);
regRex.setMaxLen(endLength); regRex.setMaxLen(endLength);
@ -457,15 +432,23 @@ public class RegPane extends BasicPane {
} }
} }
private static class CustomRegRexPane extends DisplayPane{ private static class CustomRegRexPane extends DisplayPane {
private UITextField regTextField; private UITextField regTextField;
public CustomRegRexPane(){ public CustomRegRexPane() {
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5)); regTextField = new UITextField(12);
this.add(new UILabel(Inter.getLocText("FR-Designer_Reg_Expressions") + ":"));
regTextField = new UITextField(10); double f = TableLayout.FILL;
this.add(regTextField); double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Expressions")), regTextField},
};
double[] rowSize = {p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 2, 1);
this.add(panel);
} }
@Override @Override
@ -475,7 +458,7 @@ public class RegPane extends BasicPane {
@Override @Override
public void populate(RegExp regRex) { public void populate(RegExp regRex) {
if (!(regRex instanceof CustomReg)){ if (!(regRex instanceof CustomReg)) {
return; return;
} }
regTextField.setText(regRex.toRegText()); regTextField.setText(regRex.toRegText());
@ -491,78 +474,26 @@ public class RegPane extends BasicPane {
} }
} }
private static class RegErrorMsgPane extends DisplayPane{ ListCellRenderer listCellRender = new UIComboBoxRenderer() {
private UITextField regErrorMsgField;
public RegErrorMsgPane(){
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
initRegErrorMsgField();
// this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5));
this.add(new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip") + ":"));
regErrorMsgField = new UITextField(10);
this.add(regErrorMsgField);
}
private void initRegErrorMsgField(){
regErrorMsgField = new UITextField(13);
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(){
@Override @Override
public Component getListCellRendererComponent(JList list, Object value, public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) { int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof NoneReg){ if (value instanceof NoneReg) {
this.setText(Inter.getLocText("FR-Designer_None")); this.setText(Inter.getLocText("FR-Designer_None"));
} else if (value instanceof LengthReg){ } else if (value instanceof LengthReg) {
this.setText(Inter.getLocText("FR-Designer_Length")); this.setText(Inter.getLocText("FR-Designer_Length"));
} else if (value instanceof MailReg){ } else if (value instanceof MailReg) {
this.setText(Inter.getLocText("FR-Designer_Email")); this.setText(Inter.getLocText("FR-Designer_Email"));
} else if (value instanceof PhoneReg){ } else if (value instanceof PhoneReg) {
this.setText(Inter.getLocText("FR-Designer_Phone")); this.setText(Inter.getLocText("FR-Designer_Phone"));
} else if (value instanceof MobileReg) { } else if (value instanceof MobileReg) {
this.setText(Inter.getLocText("FR-Designer_MobilePhone")); this.setText(Inter.getLocText("FR-Designer_MobilePhone"));
} else if (value instanceof IDCardReg){ } else if (value instanceof IDCardReg) {
this.setText(Inter.getLocText("FR-Designer_IDCard")); this.setText(Inter.getLocText("FR-Designer_IDCard"));
} else if (value instanceof PostCardReg){ } else if (value instanceof PostCardReg) {
this.setText(Inter.getLocText("FR-Designer_PostCode")); this.setText(Inter.getLocText("FR-Designer_PostCode"));
} else if (value instanceof CustomReg){ } else if (value instanceof CustomReg) {
this.setText(Inter.getLocText("FR-Designer_Custom")); this.setText(Inter.getLocText("FR-Designer_Custom"));
} }
return this; return this;

3
designer_base/src/com/fr/design/gui/frpane/UIComboBoxPane.java

@ -2,6 +2,7 @@ package com.fr.design.gui.frpane;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import javax.swing.*; import javax.swing.*;
@ -52,7 +53,6 @@ public abstract class UIComboBoxPane<T> extends BasicBeanPane<T> {
addItemChangeEvent(); addItemChangeEvent();
initLayout(); initLayout();
jcb.setSelectedIndex(0); jcb.setSelectedIndex(0);
} }
@ -98,6 +98,7 @@ public abstract class UIComboBoxPane<T> extends BasicBeanPane<T> {
JPanel northPane = new JPanel(new BorderLayout()); JPanel northPane = new JPanel(new BorderLayout());
northPane.add(jcb, BorderLayout.CENTER); northPane.add(jcb, BorderLayout.CENTER);
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
northPane.setBorder(UIConstants.CELL_ATTR_NORMALBORDER);
this.add(cardPane, BorderLayout.CENTER); this.add(cardPane, BorderLayout.CENTER);
} }

7
designer_base/src/com/fr/design/gui/style/FormatPane.java

@ -67,6 +67,7 @@ public class FormatPane extends AbstractBasicStylePane {
*/ */
public FormatPane() { public FormatPane() {
this.initComponents(TYPES); this.initComponents(TYPES);
this.setBorder(UIConstants.CELL_ATTR_NORMALBORDER);
} }
protected void initComponents(Integer[] types) { protected void initComponents(Integer[] types) {
@ -97,13 +98,17 @@ public class FormatPane extends AbstractBasicStylePane {
textField.setEditable(true); textField.setEditable(true);
txtCenterPane.add(textField, BorderLayout.NORTH); txtCenterPane.add(textField, BorderLayout.NORTH);
frFontPane = new FRFontPane(); frFontPane = new FRFontPane();
UILabel font = new UILabel(Inter.getLocText("FR-Designer_FRFont"), SwingConstants.LEFT);
JPanel fontPane = new JPanel(new BorderLayout());
fontPane.add(font, BorderLayout.NORTH);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{new UILabel(Inter.getLocText("FR-Base_Format") + " ", SwingConstants.LEFT), typeComboBox}, new Component[]{new UILabel(Inter.getLocText("FR-Base_Format") + " ", SwingConstants.LEFT), typeComboBox},
new Component[]{null, centerPane}, new Component[]{null, centerPane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_FRFont"), SwingConstants.LEFT), frFontPane}, new Component[]{fontPane, frFontPane},
new Component[]{null, null} new Component[]{null, null}
}; };
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p};

BIN
designer_base/src/com/fr/design/images/buttonicon/downSelected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

BIN
designer_base/src/com/fr/design/images/buttonicon/leftNormal.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

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

@ -2116,3 +2116,5 @@ FR-Designer_Widget_Error_Tip=error tip
FR-Designer_Widget_Return_Leaf=return leaf FR-Designer_Widget_Return_Leaf=return leaf
FR-Designer_Widget_Return_Path=return path FR-Designer_Widget_Return_Path=return path
FR-Designer_Widget_Display_Position=Display Position FR-Designer_Widget_Display_Position=Display Position
FR-Designer_Widget_Name=Widget Name
FR-Designer_Coords_And_Size=Coords & Size

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

@ -2112,3 +2112,5 @@ FR-Designer_Widget_Error_Tip=error tip
FR-Designer_Widget_Return_Leaf=return leaf FR-Designer_Widget_Return_Leaf=return leaf
FR-Designer_Widget_Return_Path=return path FR-Designer_Widget_Return_Path=return path
FR-Designer_Widget_Display_Position=Display Position FR-Designer_Widget_Display_Position=Display Position
FR-Designer_Widget_Name=Widget Name
FR-Designer_Coords_And_Size=Coords & Size

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

@ -2115,3 +2115,5 @@ FR-Designer_Widget_Error_Tip=
FR-Designer_Widget_Return_Leaf= FR-Designer_Widget_Return_Leaf=
FR-Designer_Widget_Return_Path= FR-Designer_Widget_Return_Path=
FR-Designer_Widget_Display_Position= FR-Designer_Widget_Display_Position=
FR-Designer_Widget_Name=
FR-Designer_Coords_And_Size=

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

@ -2115,3 +2115,5 @@ FR-Designer_Widget_Error_Tip=
FR-Designer_Widget_Return_Leaf= FR-Designer_Widget_Return_Leaf=
FR-Designer_Widget_Return_Path= FR-Designer_Widget_Return_Path=
FR-Designer_Widget_Display_Position= FR-Designer_Widget_Display_Position=
FR-Designer_Widget_Name=
FR-Designer_Coords_And_Size=

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

@ -2123,3 +2123,5 @@ FR-Designer_Widget_Error_Tip=\u9519\u8BEF\u63D0\u793A
FR-Designer_Widget_Return_Leaf=\u7ED3\u679C\u8FD4\u56DE\u53F6\u5B50\u8282\u70B9 FR-Designer_Widget_Return_Leaf=\u7ED3\u679C\u8FD4\u56DE\u53F6\u5B50\u8282\u70B9
FR-Designer_Widget_Return_Path=\u7ED3\u679C\u8FD4\u56DE\u5B8C\u6574\u5C42\u6B21\u8DEF\u5F84 FR-Designer_Widget_Return_Path=\u7ED3\u679C\u8FD4\u56DE\u5B8C\u6574\u5C42\u6B21\u8DEF\u5F84
FR-Designer_Widget_Display_Position=\u663E\u793A\u4F4D\u7F6E FR-Designer_Widget_Display_Position=\u663E\u793A\u4F4D\u7F6E
FR-Designer_Widget_Name=\u63A7\u4EF6\u540D\u79F0
FR-Designer_Coords_And_Size=\u5750\u6807\u00B7\u5C3A\u5BF8

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

@ -2115,3 +2115,5 @@ FR-Designer_Widget_Error_Tip=
FR-Designer_Widget_Return_Leaf= FR-Designer_Widget_Return_Leaf=
FR-Designer_Widget_Return_Path= FR-Designer_Widget_Return_Path=
FR-Designer_Widget_Display_Position= FR-Designer_Widget_Display_Position=
FR-Designer_Widget_Name=
FR-Designer_Coords_And_Size=

50
designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java

@ -0,0 +1,50 @@
package com.fr.design.mainframe.widget;
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.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Created by plough on 2017/8/7.
*/
public class BasicPropertyPane extends BasicPane {
protected UITextField widgetName;
public BasicPropertyPane(){
initContentPane();
}
protected void initContentPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
widgetName = new UITextField();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Name")), widgetName},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15));
this.add(panel, BorderLayout.NORTH);
}
public UITextField getWidgetNameField() {
return widgetName;
}
@Override
public String title4PopupWindow() {
return "basicProperty";
}
}

52
designer_base/src/com/fr/design/widget/WidgetBoundsPaneFactory.java

@ -0,0 +1,52 @@
package com.fr.design.widget;
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.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Created by plough on 2017/8/7.
*/
public class WidgetBoundsPaneFactory {
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), width, height},
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER)},
};
double[] rowSize = {p, p};
double[] columnSize = {p, f, f};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15));
return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 280, 24, panel);
}
public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height) {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Position")), x, y},
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer_X_Coordinate"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Y_Coordinate"), SwingConstants.CENTER)},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), width, height},
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER)},
};
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f, f};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15));
return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 230, 24, panel);
}
}

41
designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicPropertyPane.java

@ -1,49 +1,12 @@
package com.fr.design.mainframe.widget.ui; package com.fr.design.mainframe.widget.ui;
import com.fr.design.dialog.BasicPane; import com.fr.design.mainframe.widget.BasicPropertyPane;
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.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/** /**
* Created by ibm on 2017/8/4. * Created by ibm on 2017/8/4.
*/ */
public class FormBasicPropertyPane extends BasicPane { public class FormBasicPropertyPane extends BasicPropertyPane {
private UITextField widgetName;
public FormBasicPropertyPane(){
initContentPane();
}
protected void initContentPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
widgetName = new UITextField();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Form-Widget_Name") + ":"), widgetName},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
this.add(panel, BorderLayout.NORTH);
}
@Override
public String title4PopupWindow() {
return "basicProperty";
}
public void populate(Widget widget) { public void populate(Widget widget) {
widgetName.setText(widget.getWidgetName()); widgetName.setText(widget.getWidgetName());

27
designer_form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java

@ -3,15 +3,10 @@ package com.fr.design.widget.ui.designer.component;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout; import com.fr.design.widget.WidgetBoundsPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*; import java.awt.*;
/** /**
@ -26,32 +21,14 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane {
super(source); super(source);
XLayoutContainer xLayoutContainer = getParent(source); XLayoutContainer xLayoutContainer = getParent(source);
this.parent = (XWAbsoluteLayout) xLayoutContainer; this.parent = (XWAbsoluteLayout) xLayoutContainer;
} }
public void initBoundPane() { public void initBoundPane() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
x = new UISpinner(0, 1200, 1); x = new UISpinner(0, 1200, 1);
y = new UISpinner(0, 1200, 1); y = new UISpinner(0, 1200, 1);
width = new UISpinner(0, 1200, 1); width = new UISpinner(0, 1200, 1);
height = new UISpinner(0, 1200, 1); height = new UISpinner(0, 1200, 1);
this.add(WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height));
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Position")), x, y},
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer_X_Coordinate"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Y_Coordinate"), SwingConstants.CENTER)},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), width, height},
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER)},
};
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f, f};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("Form-Component_Bounds"), 280, 20, panel);
this.add(uiExpandablePane);
} }

24
designer_form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

@ -2,15 +2,10 @@ package com.fr.design.widget.ui.designer.component;
import com.fr.design.designer.creator.*; import com.fr.design.designer.creator.*;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.widget.WidgetBoundsPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*; import java.awt.*;
/** /**
@ -36,25 +31,10 @@ public class WidgetBoundPane extends BasicPane {
return container; return container;
} }
public void initBoundPane() { public void initBoundPane() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
width = new UISpinner(0, 1200, 1); width = new UISpinner(0, 1200, 1);
height = new UISpinner(0, 1200, 1); height = new UISpinner(0, 1200, 1);
Component[][] components = new Component[][]{ this.add(WidgetBoundsPaneFactory.createBoundsPane(width, height));
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), width, height},
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER)},
};
double[] rowSize = {p, p};
double[] columnSize = {p, f, f};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
UIExpandablePane uiExpandablePane = new UIExpandablePane("尺寸", 280, 20, panel);
this.add(uiExpandablePane);
} }

Loading…
Cancel
Save