Browse Source

REPORT-2897 9.0设计器修改

视觉优化
master
MoMeak 7 years ago
parent
commit
d6b49cea15
  1. 115
      designer/src/com/fr/design/expand/ExpandFatherPane.java
  2. 2
      designer/src/com/fr/design/mainframe/CellElementPropertyPane.java
  3. 5
      designer/src/com/fr/design/mainframe/ReportFloatPane.java
  4. 13
      designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java
  5. 431
      designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java
  6. 204
      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. 18
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  11. 28
      designer/src/com/fr/design/widget/WidgetPane.java
  12. 36
      designer/src/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java
  13. 42
      designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java
  14. 24
      designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java
  15. 2
      designer/src/com/fr/quickeditor/floatquick/FloatImageQuickEditor.java
  16. 3
      designer/src/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java
  17. 6
      designer_base/src/com/fr/design/constants/UIConstants.java
  18. 31
      designer_base/src/com/fr/design/foldablepane/HeaderPane.java
  19. 3
      designer_base/src/com/fr/design/foldablepane/UIExpandablePane.java
  20. 20
      designer_base/src/com/fr/design/formula/TinyFormulaPane.java
  21. 1019
      designer_base/src/com/fr/design/gui/frpane/RegPane.java
  22. 3
      designer_base/src/com/fr/design/gui/frpane/UIComboBoxPane.java
  23. 7
      designer_base/src/com/fr/design/gui/style/FormatPane.java
  24. BIN
      designer_base/src/com/fr/design/images/buttonicon/downSelected.png
  25. BIN
      designer_base/src/com/fr/design/images/buttonicon/leftNormal.png

115
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,43 +86,61 @@ public abstract class ExpandFatherPane extends JPanel implements GlobalNameObser
} }
} }
}); });
imageButton.addActionListener(new ActionListener() { imageButton.addActionListener(imageActionListener);
comboBox.setSelectedIndex(1);
}
@Override ItemListener comboBoxItemListener = new ItemListener() {
public void actionPerformed(ActionEvent e) { @Override
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);
}
}
};
if (ePane == null || isAlreadyAddListener) { ActionListener imageActionListener = new ActionListener() {
return; @Override
} public void actionPerformed(ActionEvent e) {
oldSelection = (CellSelection) ePane.getSelection(); if (ePane == null || isAlreadyAddListener) {
ePane.getGrid().setNotShowingTableSelectPane(false); return;
ePane.setEditable(false);
ePane.repaint(10);
gridSelectionChangeListener = new SelectionListener() {
@Override
public void selectionChanged(SelectionEvent e) {
Selection selection = ePane.getSelection();
if (selection instanceof CellSelection) {
CellSelection cellselection = (CellSelection) selection;
ColumnRow cr = ColumnRow.valueOf(cellselection.getColumn(), cellselection.getRow());
ePane.setOldSelecton(oldSelection);
customParentColumnRowPane.setColumnRow(cr);
}
ePane.removeSelectionChangeListener(gridSelectionChangeListener);
isAlreadyAddListener = false;
ePane.getGrid().setNotShowingTableSelectPane(true);
ePane.setEditable(true);
ePane.repaint();
}
};
ePane.addSelectionChangeListener(gridSelectionChangeListener);
isAlreadyAddListener = true;
} }
}); oldSelection = (CellSelection) ePane.getSelection();
comboBox.setSelectedIndex(1); ePane.getGrid().setNotShowingTableSelectPane(false);
} ePane.setEditable(false);
ePane.repaint(10);
gridSelectionChangeListener = new SelectionListener() {
@Override
public void selectionChanged(SelectionEvent e) {
Selection selection = ePane.getSelection();
if (selection instanceof CellSelection) {
CellSelection cellselection = (CellSelection) selection;
ColumnRow cr = ColumnRow.valueOf(cellselection.getColumn(), cellselection.getRow());
ePane.setOldSelecton(oldSelection);
customParentColumnRowPane.setColumnRow(cr);
}
ePane.removeSelectionChangeListener(gridSelectionChangeListener);
isAlreadyAddListener = false;
ePane.getGrid().setNotShowingTableSelectPane(true);
ePane.setEditable(true);
ePane.repaint();
}
};
ePane.addSelectionChangeListener(gridSelectionChangeListener);
isAlreadyAddListener = true;
}
};
/** /**
* @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);

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

@ -43,17 +43,16 @@ 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));
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; double[] columnSize = {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(" " + Inter.getLocText("FR-Designer_Add_FloatElement") + " "), 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, 15));
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);

431
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,216 +27,227 @@ import java.awt.*;
* 单元格扩展属性面板是属性表面板的一个种类 * 单元格扩展属性面板是属性表面板的一个种类
*/ */
public class CellExpandAttrPane extends AbstractCellAttrPane { public class CellExpandAttrPane extends AbstractCellAttrPane {
private UIButtonGroup<Byte> expandDirectionButton; private static final int SENIOR_HORIZONTAL_GAP = 12;
private ExpandLeftFatherPane leftFatherPane; private static final int BASIC_HORIZONTAL_GAP = 20;
private ExpandUpFatherPane rightFatherPane; private UIButtonGroup<Byte> expandDirectionButton;
private UICheckBox horizontalExpandableCheckBox; private ExpandLeftFatherPane leftFatherPane;
private UICheckBox verticalExpandableCheckBox; private ExpandUpFatherPane rightFatherPane;
private SortExpandAttrPane sortAfterExpand; private UICheckBox horizontalExpandableCheckBox;
private JPanel layoutPane; private UICheckBox verticalExpandableCheckBox;
private JPanel basicPane; private SortExpandAttrPane sortAfterExpand;
private JPanel seniorPane; private JPanel layoutPane;
private JPanel basicPane;
/** private JPanel seniorPane;
*
* @return /**
*/ * @return
public JPanel createContentPane() { */
String[] nameArray = {Inter.getLocText("ExpandD-Not_Expand"), Inter.getLocText("Utils-Top_to_Bottom"), Inter.getLocText("Utils-Left_to_Right")}; public JPanel createContentPane() {
Icon[] iconArray = { String[] nameArray = {Inter.getLocText("ExpandD-Not_Expand"), Inter.getLocText("Utils-Top_to_Bottom"), Inter.getLocText("Utils-Left_to_Right")};
BaseUtils.readIcon("/com/fr/design/images/expand/none16x16.png"), Icon[] iconArray = {
BaseUtils.readIcon("/com/fr/design/images/expand/vertical.png"), BaseUtils.readIcon("/com/fr/design/images/expand/none16x16.png"),
BaseUtils.readIcon("/com/fr/design/images/expand/landspace.png") BaseUtils.readIcon("/com/fr/design/images/expand/vertical.png"),
}; BaseUtils.readIcon("/com/fr/design/images/expand/landspace.png")
Byte[] valueArray = {Constants.NONE, Constants.TOP_TO_BOTTOM, Constants.LEFT_TO_RIGHT}; };
expandDirectionButton = new UIButtonGroup<Byte>(iconArray, valueArray); Byte[] valueArray = {Constants.NONE, Constants.TOP_TO_BOTTOM, Constants.LEFT_TO_RIGHT};
expandDirectionButton.setAllToolTips(nameArray); expandDirectionButton = new UIButtonGroup<Byte>(iconArray, valueArray);
leftFatherPane = new ExpandLeftFatherPane(); expandDirectionButton.setAllToolTips(nameArray);
rightFatherPane = new ExpandUpFatherPane(); leftFatherPane = new ExpandLeftFatherPane();
horizontalExpandableCheckBox = new UICheckBox(Inter.getLocText("ExpandD-Horizontal_Extendable")); rightFatherPane = new ExpandUpFatherPane();
verticalExpandableCheckBox = new UICheckBox(Inter.getLocText("ExpandD-Vertical_Extendable")); horizontalExpandableCheckBox = new UICheckBox(Inter.getLocText("ExpandD-Horizontal_Extendable"));
sortAfterExpand = new SortExpandAttrPane(); verticalExpandableCheckBox = new UICheckBox(Inter.getLocText("ExpandD-Vertical_Extendable"));
initAllNames(); sortAfterExpand = new SortExpandAttrPane();
return layoutPane(); initAllNames();
} return layoutPane();
}
public static void main(String[] args){
// JFrame jf = new JFrame("test"); public static void main(String[] args) {
// jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JFrame jf = new JFrame("test");
// JPanel content = (JPanel) jf.getContentPane(); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// content.setLayout(new BorderLayout()); JPanel content = (JPanel) jf.getContentPane();
// content.add(new CellExpandAttrPane().layoutPane(), BorderLayout.CENTER); content.setLayout(new BorderLayout());
// GUICoreUtils.centerWindow(jf); content.add(new CellExpandAttrPane().layoutPane(), BorderLayout.CENTER);
// jf.setSize(290, 400); GUICoreUtils.centerWindow(jf);
// jf.setVisible(true); jf.setSize(290, 400);
} jf.setVisible(true);
}
private void initAllNames() {
expandDirectionButton.setGlobalName(Inter.getLocText("FR-Designer_ExpandD_Expand_Direction")); private void initAllNames() {
leftFatherPane.setGlobalName(Inter.getLocText("FR-Designer_LeftParent")); expandDirectionButton.setGlobalName(Inter.getLocText("FR-Designer_ExpandD_Expand_Direction"));
rightFatherPane.setGlobalName(Inter.getLocText("FR-Designer_ExpandD_Up_Father_Cell")); leftFatherPane.setGlobalName(Inter.getLocText("FR-Designer_LeftParent"));
horizontalExpandableCheckBox.setGlobalName(Inter.getLocText("FR-Designer_ExpandD_Expandable")); rightFatherPane.setGlobalName(Inter.getLocText("FR-Designer_ExpandD_Up_Father_Cell"));
verticalExpandableCheckBox.setGlobalName(Inter.getLocText("FR-Designer_ExpandD_Expandable")); horizontalExpandableCheckBox.setGlobalName(Inter.getLocText("FR-Designer_ExpandD_Expandable"));
} verticalExpandableCheckBox.setGlobalName(Inter.getLocText("FR-Designer_ExpandD_Expandable"));
}
private JPanel layoutPane() {
layoutPane = new JPanel(new BorderLayout()); private JPanel layoutPane() {
basicPane = new JPanel(); layoutPane = new JPanel(new BorderLayout());
seniorPane = new JPanel(); basicPane = new JPanel();
basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"),290,24,basicPane()); seniorPane = new JPanel();
seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"),290,24,seniorPane()); basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 290, 24, basicPane());
layoutPane.add(basicPane,BorderLayout.NORTH); seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 290, 24, seniorPane());
layoutPane.add(seniorPane,BorderLayout.CENTER); layoutPane.add(basicPane, BorderLayout.NORTH);
return layoutPane; layoutPane.add(seniorPane, BorderLayout.CENTER);
} return layoutPane;
}
private JPanel basicPane(){
double f = TableLayout.FILL; private JPanel basicPane() {
double p = TableLayout.PREFERRED; double f = TableLayout.FILL;
Component[][] components = new Component[][]{ double p = TableLayout.PREFERRED;
new Component[]{null,null}, UILabel direction = new UILabel(Inter.getLocText("FR-Designer_ExpandD_Expand_Direction"), SwingConstants.LEFT);
new Component[]{new UILabel(" "+Inter.getLocText("FR-Designer_ExpandD_Expand_Direction")+" ", SwingConstants.LEFT), expandDirectionButton}, // JPanel directionPane = new JPanel(new BorderLayout());
new Component[]{new UILabel(" "+Inter.getLocText("FR-Designer_LeftParent"), SwingConstants.LEFT), leftFatherPane}, // directionPane.add(direction, BorderLayout.NORTH);
new Component[]{new UILabel(" "+Inter.getLocText("FR-Designer_ExpandD_Up_Father_Cell"), SwingConstants.LEFT), rightFatherPane}, UILabel left = new UILabel(Inter.getLocText("FR-Designer_LeftParent"), SwingConstants.LEFT);
}; JPanel leftPane = new JPanel(new BorderLayout());
double[] rowSize = {p, p, p, p, p, p}; leftPane.add(left, BorderLayout.NORTH);
double[] columnSize = {p, f}; UILabel up = new UILabel(Inter.getLocText("FR-Designer_ExpandD_Up_Father_Cell"), SwingConstants.LEFT);
int[][] rowCount = {{1, 1},{1, 1}, {1, 3}, {1, 3}}; JPanel upPane = new JPanel(new BorderLayout());
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); upPane.add(up, BorderLayout.NORTH);
} Component[][] components = new Component[][]{
new Component[]{null, null},
private JPanel seniorPane() { new Component[]{direction, expandDirectionButton},
double f = TableLayout.FILL; new Component[]{leftPane, leftFatherPane},
double p = TableLayout.PREFERRED; new Component[]{upPane, rightFatherPane},
Component[][] components = new Component[][]{ };
new Component[]{null,null}, double[] rowSize = {p, p, p, p, p};
new Component[]{horizontalExpandableCheckBox, null}, double[] columnSize = {p, f};
new Component[]{verticalExpandableCheckBox, null}, int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
new Component[]{new UILabel(" "+Inter.getLocText("FR-Designer_ExpendSort"), SwingConstants.RIGHT), sortAfterExpand}, return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, BASIC_HORIZONTAL_GAP, LayoutConstants.VGAP_LARGE);
}; }
double[] rowSize = {p, p, p, p, p, p, p, p};
double[] columnSize = {p, f}; private JPanel seniorPane() {
int[][] rowCount = {{1, 1}, {1, 1}, {1, 3}, {1, 3}}; double f = TableLayout.FILL;
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); 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[][]{
@Override new Component[]{null, null},
protected void populateBean() { new Component[]{horizontalExpandableCheckBox, null},
this.leftFatherPane.setElementCasePane(elementCasePane); new Component[]{verticalExpandableCheckBox, null},
this.rightFatherPane.setElementCasePane(elementCasePane); new Component[]{expendSortPane, sortAfterExpand},
CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr(); };
if (cellExpandAttr == null) { double[] rowSize = {p, p, p, p, p, p, p, p};
cellExpandAttr = new CellExpandAttr(); double[] columnSize = {p, f};
cellElement.setCellExpandAttr(cellExpandAttr); int[][] rowCount = {{1, 1}, {1, 1}, {1, 3}, {1, 3}};
} return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, SENIOR_HORIZONTAL_GAP, LayoutConstants.VGAP_LARGE);
expandDirectionButton.setSelectedItem(cellExpandAttr.getDirection()); }
this.leftFatherPane.populate(cellExpandAttr);
this.rightFatherPane.populate(cellExpandAttr);
switch (cellExpandAttr.getExtendable()) { @Override
case CellExpandAttr.Both_EXTENDABLE: protected void populateBean() {
horizontalExpandableCheckBox.setSelected(true); this.leftFatherPane.setElementCasePane(elementCasePane);
verticalExpandableCheckBox.setSelected(true); this.rightFatherPane.setElementCasePane(elementCasePane);
break; CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
case CellExpandAttr.Vertical_EXTENDABLE: if (cellExpandAttr == null) {
horizontalExpandableCheckBox.setSelected(false); cellExpandAttr = new CellExpandAttr();
verticalExpandableCheckBox.setSelected(true); cellElement.setCellExpandAttr(cellExpandAttr);
break; }
case CellExpandAttr.Horizontal_EXTENDABLE: expandDirectionButton.setSelectedItem(cellExpandAttr.getDirection());
horizontalExpandableCheckBox.setSelected(true); this.leftFatherPane.populate(cellExpandAttr);
verticalExpandableCheckBox.setSelected(false); this.rightFatherPane.populate(cellExpandAttr);
break; switch (cellExpandAttr.getExtendable()) {
default: { case CellExpandAttr.Both_EXTENDABLE:
horizontalExpandableCheckBox.setSelected(false); horizontalExpandableCheckBox.setSelected(true);
verticalExpandableCheckBox.setSelected(false); verticalExpandableCheckBox.setSelected(true);
} break;
} case CellExpandAttr.Vertical_EXTENDABLE:
horizontalExpandableCheckBox.setSelected(false);
sortAfterExpand.populate(cellExpandAttr); verticalExpandableCheckBox.setSelected(true);
} break;
case CellExpandAttr.Horizontal_EXTENDABLE:
horizontalExpandableCheckBox.setSelected(true);
@Override verticalExpandableCheckBox.setSelected(false);
public String getIconPath() { break;
default: {
horizontalExpandableCheckBox.setSelected(false);
verticalExpandableCheckBox.setSelected(false);
}
}
sortAfterExpand.populate(cellExpandAttr);
}
@Override
public String getIconPath() {
// return "com/fr/design/images/expand/cellAttr.gif"; // return "com/fr/design/images/expand/cellAttr.gif";
return Inter.getLocText("FR-Designer_Expand"); return Inter.getLocText("FR-Designer_Expand");
} }
@Override @Override
public void updateBean(TemplateCellElement cellElement) { public void updateBean(TemplateCellElement cellElement) {
CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr(); CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
if (cellExpandAttr == null) { if (cellExpandAttr == null) {
cellExpandAttr = new CellExpandAttr(); cellExpandAttr = new CellExpandAttr();
cellElement.setCellExpandAttr(cellExpandAttr); cellElement.setCellExpandAttr(cellExpandAttr);
} }
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_ExpandD_Expand_Direction"))) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_ExpandD_Expand_Direction"))) {
cellExpandAttr.setDirection(expandDirectionButton.getSelectedItem()); cellExpandAttr.setDirection(expandDirectionButton.getSelectedItem());
} }
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_LeftParent"))) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_LeftParent"))) {
this.leftFatherPane.update(cellExpandAttr); this.leftFatherPane.update(cellExpandAttr);
} }
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_ExpandD_Up_Father_Cell"))) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_ExpandD_Up_Father_Cell"))) {
this.rightFatherPane.update(cellExpandAttr); this.rightFatherPane.update(cellExpandAttr);
} }
// extendable // extendable
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_ExpandD-Expandable"))) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_ExpandD-Expandable"))) {
if (horizontalExpandableCheckBox.isSelected()) { if (horizontalExpandableCheckBox.isSelected()) {
if (verticalExpandableCheckBox.isSelected()) { if (verticalExpandableCheckBox.isSelected()) {
cellExpandAttr.setExtendable(CellExpandAttr.Both_EXTENDABLE); cellExpandAttr.setExtendable(CellExpandAttr.Both_EXTENDABLE);
} else { } else {
cellExpandAttr.setExtendable(CellExpandAttr.Horizontal_EXTENDABLE); cellExpandAttr.setExtendable(CellExpandAttr.Horizontal_EXTENDABLE);
} }
} else { } else {
if (verticalExpandableCheckBox.isSelected()) { if (verticalExpandableCheckBox.isSelected()) {
cellExpandAttr.setExtendable(CellExpandAttr.Vertical_EXTENDABLE); cellExpandAttr.setExtendable(CellExpandAttr.Vertical_EXTENDABLE);
} else { } else {
cellExpandAttr.setExtendable(CellExpandAttr.None_EXTENDABLE); cellExpandAttr.setExtendable(CellExpandAttr.None_EXTENDABLE);
} }
} }
} }
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("ExpandD-Sort_After_Expand"))) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("ExpandD-Sort_After_Expand"))) {
sortAfterExpand.update(cellExpandAttr); sortAfterExpand.update(cellExpandAttr);
} }
} }
/** /**
* *
*/ */
public void updateBeans() { public void updateBeans() {
TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); TemplateElementCase elementCase = elementCasePane.getEditingElementCase();
int cellRectangleCount = cs.getCellRectangleCount(); int cellRectangleCount = cs.getCellRectangleCount();
for (int rect = 0; rect < cellRectangleCount; rect++) { for (int rect = 0; rect < cellRectangleCount; rect++) {
Rectangle cellRectangle = cs.getCellRectangle(rect); Rectangle cellRectangle = cs.getCellRectangle(rect);
// 需要先行后列地增加新元素。 // 需要先行后列地增加新元素。
for (int j = 0; j < cellRectangle.height; j++) { for (int j = 0; j < cellRectangle.height; j++) {
for (int i = 0; i < cellRectangle.width; i++) { for (int i = 0; i < cellRectangle.width; i++) {
int column = i + cellRectangle.x; int column = i + cellRectangle.x;
int row = j + cellRectangle.y; int row = j + cellRectangle.y;
TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row);
if (cellElement == null) { if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(column, row); cellElement = new DefaultTemplateCellElement(column, row);
elementCase.addCellElement(cellElement); elementCase.addCellElement(cellElement);
} }
updateBean(cellElement); updateBean(cellElement);
} }
} }
} }
} }
/** /**
* * @return
* @return */
*/ public String title4PopupWindow() {
public String title4PopupWindow() { return Inter.getLocText("ExpandD-Expand_Attribute");
return Inter.getLocText("ExpandD-Expand_Attribute"); }
}
} }

204
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,117 +8,123 @@ 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
*/ */
public class CellStylePane extends AbstractCellAttrPane { public class CellStylePane extends AbstractCellAttrPane {
private StylePane stylePane; private StylePane stylePane;
@Override @Override
public JPanel createContentPane() { public JPanel createContentPane() {
JPanel content = new JPanel(new BorderLayout()); JPanel content = new JPanel(new BorderLayout());
stylePane = new StylePane(); stylePane = new StylePane();
content.add(stylePane, BorderLayout.CENTER); content.add(stylePane, BorderLayout.CENTER);
stylePane.addPredefinedChangeListener(new ChangeListener() { stylePane.addPredefinedChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
attributeChanged(); attributeChanged();
} }
}); });
stylePane.addCustomTabChangeListener(new ChangeListener() { stylePane.addCustomTabChangeListener(new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
adjustValues();// 里面的Tab切换后要及时调整滚动条,因为一些界面可能不需要滚动条 adjustValues();// 里面的Tab切换后要及时调整滚动条,因为一些界面可能不需要滚动条
} }
}); });
return content; // content.setBorder(UIConstants.CELL_ATTR_NORMALBORDER);
} 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
public String getIconPath() { public String getIconPath() {
// return "com/fr/design/images/m_format/cell.png"; // return "com/fr/design/images/m_format/cell.png";
return Inter.getLocText("FR-Designer_Style"); return Inter.getLocText("FR-Designer_Style");
} }
@Override @Override
public void updateBean(TemplateCellElement cellElement) { public void updateBean(TemplateCellElement cellElement) {
cellElement.setStyle(stylePane.updateBean()); cellElement.setStyle(stylePane.updateBean());
} }
@Override @Override
public void updateBeans() { public void updateBeans() {
if (stylePane.getSelectedIndex() == 1) { if (stylePane.getSelectedIndex() == 1) {
Style s = stylePane.updateBean(); Style s = stylePane.updateBean();
TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); TemplateElementCase elementCase = elementCasePane.getEditingElementCase();
int cellRectangleCount = cs.getCellRectangleCount(); int cellRectangleCount = cs.getCellRectangleCount();
for (int rect = 0; rect < cellRectangleCount; rect++) { for (int rect = 0; rect < cellRectangleCount; rect++) {
Rectangle cellRectangle = cs.getCellRectangle(rect); Rectangle cellRectangle = cs.getCellRectangle(rect);
for (int j = 0; j < cellRectangle.height; j++) { for (int j = 0; j < cellRectangle.height; j++) {
for (int i = 0; i < cellRectangle.width; i++) { for (int i = 0; i < cellRectangle.width; i++) {
int column = i + cellRectangle.x; int column = i + cellRectangle.x;
int row = j + cellRectangle.y; int row = j + cellRectangle.y;
TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row);
if (cellElement == null) { if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(column, row); cellElement = new DefaultTemplateCellElement(column, row);
elementCase.addCellElement(cellElement); elementCase.addCellElement(cellElement);
} }
cellElement.setStyle(s); cellElement.setStyle(s);
} }
} }
} }
} else { } else {
TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); TemplateElementCase elementCase = elementCasePane.getEditingElementCase();
int cellRectangleCount = cs.getCellRectangleCount(); int cellRectangleCount = cs.getCellRectangleCount();
for (int rect = 0; rect < cellRectangleCount; rect++) { for (int rect = 0; rect < cellRectangleCount; rect++) {
Rectangle cellRectangle = cs.getCellRectangle(rect); Rectangle cellRectangle = cs.getCellRectangle(rect);
for (int j = 0; j < cellRectangle.height; j++) { for (int j = 0; j < cellRectangle.height; j++) {
for (int i = 0; i < cellRectangle.width; i++) { for (int i = 0; i < cellRectangle.width; i++) {
int column = i + cellRectangle.x; int column = i + cellRectangle.x;
int row = j + cellRectangle.y; int row = j + cellRectangle.y;
TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row);
if (cellElement == null) { if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(column, row); cellElement = new DefaultTemplateCellElement(column, row);
elementCase.addCellElement(cellElement); elementCase.addCellElement(cellElement);
} }
Style style = cellElement.getStyle(); Style style = cellElement.getStyle();
if (style == null) { if (style == null) {
style = style.DEFAULT_STYLE; style = style.DEFAULT_STYLE;
} }
style = stylePane.updateStyle(style); style = stylePane.updateStyle(style);
cellElement.setStyle(style); cellElement.setStyle(style);
} }
} }
} }
stylePane.updateBorder();// border必须特别处理 stylePane.updateBorder();// border必须特别处理
} }
} }
@Override @Override
protected void populateBean() { protected void populateBean() {
stylePane.populateBean(cellElement.getStyle()); stylePane.populateBean(cellElement.getStyle());
stylePane.dealWithBorder(elementCasePane); stylePane.dealWithBorder(elementCasePane);
} }
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText(Inter.getLocText("FR-Designer_Style")); return Inter.getLocText(Inter.getLocText("FR-Designer_Style"));
} }
public void setSelectedByIds(int level, String... id) { public void setSelectedByIds(int level, String... id) {
stylePane.setSelctedByName(id[level]); stylePane.setSelctedByName(id[level]);
} }
} }

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

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

@ -52,13 +52,20 @@ 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
tabbedPane = new CardLayout(); tabbedPane = new CardLayout();
center = new JPanel(tabbedPane); center = new JPanel(tabbedPane);
this.add(center, BorderLayout.CENTER); this.add(center, BorderLayout.CENTER);
@ -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
} }

28
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,22 @@ 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);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText(new String[]{"FR-Designer_Selection", "FR-Designer_Widget"})), editorTypeComboBox},
};
northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
northPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15));
this.add(northPane, BorderLayout.NORTH);
editorTypeComboBox.addItemListener(this); editorTypeComboBox.addItemListener(this);
cellEditorCardPane = new CellWidgetCardPane(pane); cellEditorCardPane = new CellWidgetCardPane(pane);
@ -64,12 +74,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 +276,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);
} }

42
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,8 +98,8 @@ 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));
allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT)); allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT));
@ -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,13 +124,13 @@ 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);
JPanel contentPane = this.setValidatePane(); JPanel contentPane = this.setValidatePane();
@ -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;
} }
} }

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

@ -1,13 +1,17 @@
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;
@ -16,11 +20,23 @@ 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);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark") + " "), waterMarkTextField },
};
double[] rowSize = {p, p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1}};
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) {

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 {

6
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;
@ -113,6 +116,8 @@ 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_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");
@ -146,6 +151,7 @@ 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 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) ;
} }
/** /**

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

File diff suppressed because it is too large Load Diff

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

Loading…
Cancel
Save