Browse Source

merge

master
hzzz 7 years ago
parent
commit
3ad5fa6131
  1. 142
      designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java
  2. 69
      designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java
  3. 2
      designer/src/com/fr/design/mainframe/AuthoritySheetEditedPane.java
  4. 8
      designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java
  5. 146
      designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java
  6. 141
      designer/src/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java
  7. 16
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  8. 5
      designer/src/com/fr/design/mainframe/JWorkBook.java
  9. 56
      designer/src/com/fr/design/mainframe/SheetAuthorityEditPane.java
  10. 5
      designer/src/com/fr/design/mainframe/SheetNameTabPane.java
  11. 4
      designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java
  12. 2
      designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java
  13. 88
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  14. 6
      designer/src/com/fr/design/widget/WidgetDefinePaneFactory.java
  15. 43
      designer/src/com/fr/design/widget/WidgetEventPane.java
  16. 43
      designer/src/com/fr/design/widget/WidgetPane.java
  17. 6
      designer/src/com/fr/design/widget/ui/ButtonDefinePane.java
  18. 10
      designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java
  19. 4
      designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java
  20. 2
      designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java
  21. 36
      designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java
  22. 14
      designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java
  23. 139
      designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java
  24. 32
      designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java
  25. 23
      designer/src/com/fr/design/widget/ui/MultiFileEditorPane.java
  26. 4
      designer/src/com/fr/design/widget/ui/NoneWidgetDefinePane.java
  27. 44
      designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java
  28. 4
      designer/src/com/fr/design/widget/ui/RadioDefinePane.java
  29. 11
      designer/src/com/fr/design/widget/ui/RadioGroupDefinePane.java
  30. 22
      designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java
  31. 4
      designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java
  32. 4
      designer/src/com/fr/design/widget/ui/UserEditorDefinePane.java
  33. 6
      designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java
  34. 4
      designer/src/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java
  35. 12
      designer/src/com/fr/design/widget/ui/btn/DefineAppendColumnRowPane.java
  36. 30
      designer/src/com/fr/design/widget/ui/btn/TreeNodeToogleButtonDefinePane.java
  37. 8
      designer/src/com/fr/poly/PolyDesigner.java
  38. 3
      designer/src/com/fr/poly/creator/ChartBlockEditor.java
  39. 6
      designer/src/com/fr/poly/creator/ECBlockPane.java
  40. 5
      designer_base/src/com/fr/design/constants/UIConstants.java
  41. 32
      designer_base/src/com/fr/design/foldablepane/HeaderPane.java
  42. 62
      designer_base/src/com/fr/design/gui/controlpane/ObjectUIControlPane.java
  43. 30
      designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java
  44. 2
      designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java
  45. 39
      designer_base/src/com/fr/design/gui/controlpane/UINameableListCellRenderer.java
  46. 1
      designer_base/src/com/fr/design/gui/ibutton/UIButton.java
  47. 7
      designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java
  48. 4
      designer_base/src/com/fr/design/gui/style/AlignmentPane.java
  49. 4
      designer_base/src/com/fr/design/gui/style/BorderPane.java
  50. BIN
      designer_base/src/com/fr/design/images/buttonicon/popdownarrow.png
  51. BIN
      designer_base/src/com/fr/design/images/buttonicon/popuparrow.png
  52. BIN
      designer_base/src/com/fr/design/images/data/source/hoverDown.png
  53. BIN
      designer_base/src/com/fr/design/images/data/source/hoverDown20.png
  54. BIN
      designer_base/src/com/fr/design/images/data/source/hoverDown@2x.png
  55. BIN
      designer_base/src/com/fr/design/images/data/source/hoverUp20.png
  56. BIN
      designer_base/src/com/fr/design/images/data/source/normalDown.png
  57. BIN
      designer_base/src/com/fr/design/images/data/source/normalDown20.png
  58. BIN
      designer_base/src/com/fr/design/images/data/source/normalDown@2x.png
  59. BIN
      designer_base/src/com/fr/design/images/data/source/normalUp20.png
  60. BIN
      designer_base/src/com/fr/design/images/data/source/scaleDown.png
  61. BIN
      designer_base/src/com/fr/design/images/data/source/scaleUp.png
  62. 18
      designer_base/src/com/fr/design/locale/designer.properties
  63. 14
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  64. 10
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  65. 12
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  66. 11
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  67. 10
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  68. 86
      designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java
  69. 50
      designer_base/src/com/fr/design/mainframe/AuthorityPropertyPane.java
  70. 112
      designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java
  71. 188
      designer_base/src/com/fr/design/mainframe/JFormSliderPane.java
  72. 226
      designer_base/src/com/fr/design/mainframe/JSliderPane.java
  73. 5
      designer_base/src/com/fr/design/mainframe/JTemplate.java
  74. 63
      designer_base/src/com/fr/design/mainframe/NoSupportAuthorityEdit.java
  75. 186
      designer_base/src/com/fr/design/roleAuthority/RolesAlreadyEditedPane.java
  76. 132
      designer_base/src/com/fr/design/widget/EventCreator.java
  77. 453
      designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java
  78. 82
      designer_form/src/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java
  79. 14
      designer_form/src/com/fr/design/mainframe/FormDesigner.java
  80. 17
      designer_form/src/com/fr/design/mainframe/JForm.java
  81. 21
      designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java

142
designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java

File diff suppressed because one or more lines are too long

69
designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java

@ -31,6 +31,7 @@ import java.util.List;
public class AuthorityEditToolBarPane extends AuthorityPropertyPane { public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
private static final int TITLE_HEIGHT = 19; private static final int TITLE_HEIGHT = 19;
private static final int RIGHT_GAP = 10;
private AuthorityEditPane authorityEditPane = null; private AuthorityEditPane authorityEditPane = null;
private AuthorityToolBarPane authorityToolBarPane; private AuthorityToolBarPane authorityToolBarPane;
private String[] selectedPathArray; private String[] selectedPathArray;
@ -51,7 +52,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.add(authorityTitle, BorderLayout.CENTER); northPane.add(authorityTitle, BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR));
this.add(northPane, BorderLayout.NORTH); // this.add(northPane, BorderLayout.NORTH);
authorityEditPane = new AuthorityEditPane(buttonlists); authorityEditPane = new AuthorityEditPane(buttonlists);
this.add(authorityEditPane, BorderLayout.CENTER); this.add(authorityEditPane, BorderLayout.CENTER);
} }
@ -81,13 +82,15 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
private class AuthorityEditPane extends JPanel { private class AuthorityEditPane extends JPanel {
private static final int TOP_GAP = 11; private static final int TOP_GAP = 11;
private static final int LEFT_GAP = 8; private static final int LEFT_GAP = 4;
private static final int ALIGNMENT_GAP = -3; private static final int LEFT_CHECKPANE = 3;
private JPanel typePane;
private JPanel namePane;
private UILabel type = null; private UILabel type = null;
private UILabel name = null; private UILabel name = null;
private JPanel checkPane = null; private JPanel checkPane = null;
private List<ToolBarButton> buttonlists; private List<ToolBarButton> buttonlists;
private UICheckBox buttonVisible = new UICheckBox(Inter.getLocText("FR-Designer_Visible")); private UICheckBox buttonVisible = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Visible"));
private ItemListener itemListener = new ItemListener() { private ItemListener itemListener = new ItemListener() {
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
String selectedRole = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); String selectedRole = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();
@ -143,43 +146,36 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
public AuthorityEditPane(List<ToolBarButton> buttonlists) { public AuthorityEditPane(List<ToolBarButton> buttonlists) {
setLayout(new BorderLayout()); setLayout(new BorderLayout());
type = new UILabel(); type = new UILabel();
typePane = new JPanel(new BorderLayout());
typePane.add(type, BorderLayout.CENTER);
type.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0));
typePane.setBorder(BorderFactory.createLineBorder(Color.lightGray));
name = new UILabel(); name = new UILabel();
namePane = new JPanel(new BorderLayout());
namePane.add(name, BorderLayout.CENTER);
name.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0));
namePane.setBorder(BorderFactory.createLineBorder(Color.lightGray));
checkPane = new JPanel(); checkPane = new JPanel();
checkPane.setLayout(new BorderLayout()); checkPane.setLayout(new BorderLayout());
this.add(layoutText(), BorderLayout.WEST); this.add(centerPane(), BorderLayout.NORTH);
this.add(layoutPane(), BorderLayout.CENTER); this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, RIGHT_GAP));
this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, 0));
this.buttonlists = buttonlists; this.buttonlists = buttonlists;
buttonVisible.addItemListener(itemListener); buttonVisible.addItemListener(itemListener);
} }
private JPanel layoutText() { private JPanel centerPane() {
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Type") + ":", SwingConstants.RIGHT)},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WF_Name") + ":", SwingConstants.RIGHT)},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Permissions") + ":", SwingConstants
.RIGHT)},
};
double[] rowSize = {p, p, p};
double[] columnSize = {p};
int[][] rowCount = {{1}, {1}, {1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
}
private JPanel layoutPane() {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{type}, new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), typePane},
new Component[]{name}, new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), namePane},
new Component[]{checkPane}, new Component[]{checkPane, null},
}; };
double[] rowSize = {p, p, p};
double[] columnSize = {f}; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM);
int[][] rowCount = {{1}, {1}, {1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
} }
/** /**
@ -237,15 +233,14 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
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_Form_Button"), SwingConstants.LEFT), new Component[]{buttonVisible},
buttonVisible},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p};
double[] columnSize = {p, p, f}; double[] columnSize = {p};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}}; int[][] rowCount = {{1}};
JPanel check = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); JPanel check = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_SMALL);
checkPane.add(check, BorderLayout.CENTER); checkPane.add(check, BorderLayout.CENTER);
checkPane.setBorder(BorderFactory.createEmptyBorder(ALIGNMENT_GAP, 0, 0, 0)); checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
} }
} }
} }

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

@ -41,7 +41,7 @@ public class AuthoritySheetEditedPane extends AuthorityPropertyPane {
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.add(authorityTitle, BorderLayout.CENTER); northPane.add(authorityTitle, BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR));
this.add(northPane, BorderLayout.NORTH); // this.add(northPane, BorderLayout.NORTH);
authorityEditPane = new SheetAuthorityEditPane(editingWorkBook, selectedIndex); authorityEditPane = new SheetAuthorityEditPane(editingWorkBook, selectedIndex);
this.add(authorityEditPane, BorderLayout.CENTER); this.add(authorityEditPane, BorderLayout.CENTER);

8
designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java

@ -76,7 +76,9 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
} }
} }
authorityEditToolBarPane.populate(); authorityEditToolBarPane.populate();
EastRegionContainerPane.getInstance().replaceUpPane(authorityEditToolBarPane); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityEditToolBarPane);
} }
}; };
@ -114,8 +116,8 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
populateToolBarPane(); populateToolBarPane();
authorityEditToolBarPane = new AuthorityEditToolBarPane(toolBarPane.getToolBarButtons()); authorityEditToolBarPane = new AuthorityEditToolBarPane(toolBarPane.getToolBarButtons());
authorityEditToolBarPane.setAuthorityToolBarPane(AuthorityToolBarPane.this); authorityEditToolBarPane.setAuthorityToolBarPane(AuthorityToolBarPane.this);
EastRegionContainerPane.getInstance().replaceUpPane(authorityEditToolBarPane); EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityEditToolBarPane);
EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
} }
} }
}; };

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

@ -0,0 +1,146 @@
package com.fr.design.mainframe;
import com.fr.base.FRContext;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.CellWriteAttrPane;
import com.fr.design.widget.WidgetPane;
import com.fr.form.ui.NoneWidget;
import com.fr.form.ui.Widget;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.privilege.finegrain.WidgetPrivilegeControl;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
import java.awt.*;
/**
* Created by ibm on 2017/7/20.
*/
public class CellWidgetPropertyPane extends BasicPane {
private static CellWidgetPropertyPane singleton;
private TemplateCellElement cellElement;
private WidgetPane cellEditorDefPane;
public static CellWidgetPropertyPane getInstance(){
if (singleton == null) {
singleton = new CellWidgetPropertyPane();
}
return singleton;
}
public CellWidgetPropertyPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
// this.addAttributeChangeListener(listener);
// cellEditorDefPane = new WidgetPane(elementCasePane);
}
public void clear (){
singleton = null;
}
public WidgetPane getCellEditorDefPane() {
return cellEditorDefPane;
}
public void setCellEditorDefPane(WidgetPane cellEditorDefPane) {
this.cellEditorDefPane = cellEditorDefPane;
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("FR-Designer-Widget_Settings");
}
public void populate(TemplateCellElement cellElement) {
if (cellElement == null) {// 利用默认的CellElement.
cellElement = new DefaultTemplateCellElement(0, 0, null);
}
Widget cellWidget = cellElement.getWidget();
if(cellWidget == null){
return;
}
// 这里进行克隆的原因是为了保留原始的Widget以便和新的Widget做比较来判断是否发生了改变
if (cellWidget != null) {
try {
cellWidget = (Widget) cellWidget.clone();
} catch (CloneNotSupportedException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
cellEditorDefPane.populate(cellWidget);
}
public void populate(ElementCasePane ePane) {
cellEditorDefPane = new WidgetPane(ePane);
this.add(cellEditorDefPane, BorderLayout.CENTER);
CellSelection cs = (CellSelection) ePane.getSelection();
final TemplateElementCase tplEC = ePane.getEditingElementCase();
TemplateCellElement editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
tplEC.addCellElement(editCellElement);
}
this.cellElement = editCellElement;
this.populate(editCellElement);
}
public void update() {
if (cellElement == null) {// 利用默认的CellElement.
return;
}
Widget cellWidget = this.cellEditorDefPane.update();
// p:最后把这个cellEditorDef设置到CellGUIAttr.
if (cellWidget instanceof NoneWidget) {
cellElement.setWidget(null);
} else {
if (cellElement.getWidget() != null) {
cellWidget = upDateWidgetAuthority(cellElement, cellWidget);
}
cellElement.setWidget(cellWidget);
}
}
private Widget upDateWidgetAuthority(TemplateCellElement cellElement, Widget newWidget) {
try {
Widget oldWidget = (Widget) cellElement.getWidget().clone();
if (newWidget.getClass() == oldWidget.getClass()) {
newWidget.setWidgetPrivilegeControl((WidgetPrivilegeControl) oldWidget.getWidgetPrivilegeControl().clone());
}
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
return newWidget;
}
@Override
/**
*检测是否有效
*/
public void checkValid() throws Exception {
this.cellEditorDefPane.checkValid();
}
}

141
designer/src/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java

@ -5,6 +5,7 @@ import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
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.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
@ -30,6 +31,8 @@ import com.fr.stable.ColumnRow;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import java.awt.*; import java.awt.*;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
@ -50,20 +53,26 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
private static final int NEW_VALUE = 4; private static final int NEW_VALUE = 4;
//新值下面的编辑器的宽度 //新值下面的编辑器的宽度
private static final int NEW_PANE_WIDTH = 120; private static final int NEW_PANE_WIDTH = 120;
private static final Dimension VALUEPANE_NEW_DIMENSION = new Dimension(154,20);
private static final Dimension VALUEPANE_OLD_DIMENSION = new Dimension(0,0);
private UICheckBox floatElementVisibleCheckBoxes = new UICheckBox(Inter.getLocText("FR-Designer_Visible"));
private UICheckBox cellElementVisibleCheckBoxes = new UICheckBox(Inter.getLocText("FR-Designer_Visible")); private UICheckBox floatElementVisibleCheckBoxes = new UICheckBox(Inter.getLocText("FR-Designer_Float_Visible"));
private UICheckBox widgetVisible = new UICheckBox(Inter.getLocText("FR-Designer_Visible")); private UICheckBox cellElementVisibleCheckBoxes = new UICheckBox(Inter.getLocText("FR-Designer_Cell_Visible"));
private UICheckBox widgetAvailable = new UICheckBox(Inter.getLocText("FR-Designer_Enabled")); private UICheckBox widgetVisible = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Visible"));
private UICheckBox widgetAvailable = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Enabled"));
private UICheckBox gridColumnRowVisible = new UICheckBox(Inter.getLocText("FR-Designer_Hide")); private UICheckBox gridColumnRowVisible = new UICheckBox(Inter.getLocText("FR-Designer_Hide"));
private UICheckBox newValue = new UICheckBox(Inter.getLocText("FR-Designer_New_Value")); private UICheckBox newValue = new UICheckBox(Inter.getLocText("FR-Designer_New_Value"));
private UIButtonGroup oldNewValueButton = new UIButtonGroup(new String[]{Inter.getLocText("FR-Designer_CellWrite_InsertRow_COPY"),Inter.getLocText("FR-Designer_New_Value")});
private JPanel newValuePane;
private ValueEditorPane valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane(NEW_PANE_WIDTH); private ValueEditorPane valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane(NEW_PANE_WIDTH);
private UICheckBox[] hyperlinkCheckBoxes = null; private UICheckBox[] hyperlinkCheckBoxes = null;
private ElementCasePane elementCasePane = null; private ElementCasePane elementCasePane = null;
private int selectionType = CellSelection.NORMAL; private int selectionType = CellSelection.NORMAL;
private CellSelection cellSelection; private CellSelection cellSelection;
private FloatSelection floatSelection; private FloatSelection floatSelection;
private CardLayout newValueCard;
private boolean isAllHasWidget; private boolean isAllHasWidget;
private boolean isAllHasHyperlink; private boolean isAllHasHyperlink;
private String[] selectedPathArray; private String[] selectedPathArray;
@ -148,6 +157,22 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
} }
} }
}; };
private ChangeListener buttonChangeListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (oldNewValueButton.getSelectedIndex() == 1){
newValuePane.setPreferredSize(VALUEPANE_NEW_DIMENSION);
newValueCard.show(newValuePane,"new");
newValue.setSelected(true);
valueEditor.setEnabled(true);
}else {
newValue.setSelected(false);
// valueEditor.setEnabled(false);
newValuePane.setPreferredSize(VALUEPANE_OLD_DIMENSION);
newValueCard.show(newValuePane,"old");
}
}
};
public ElementCasePaneAuthorityEditPane(ElementCasePane elementCasePane) { public ElementCasePaneAuthorityEditPane(ElementCasePane elementCasePane) {
super(elementCasePane); super(elementCasePane);
@ -354,6 +379,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
} }
widgetAvailable.setEnabled(cellElementVisibleCheckBoxes.isSelected()); widgetAvailable.setEnabled(cellElementVisibleCheckBoxes.isSelected());
widgetVisible.setEnabled(cellElementVisibleCheckBoxes.isSelected()); widgetVisible.setEnabled(cellElementVisibleCheckBoxes.isSelected());
oldNewValueButton.setSelectedIndex(0);
} }
private void initListener() { private void initListener() {
@ -364,6 +390,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
gridColumnRowVisible.addItemListener(columnRowAuthorityListener); gridColumnRowVisible.addItemListener(columnRowAuthorityListener);
newValue.addItemListener(newValuelistener); newValue.addItemListener(newValuelistener);
valueEditor.registerChangeListener(observerListener); valueEditor.registerChangeListener(observerListener);
oldNewValueButton.addChangeListener(buttonChangeListener);
} }
private void removeListener() { private void removeListener() {
@ -374,6 +401,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
gridColumnRowVisible.removeItemListener(columnRowAuthorityListener); gridColumnRowVisible.removeItemListener(columnRowAuthorityListener);
newValue.removeItemListener(newValuelistener); newValue.removeItemListener(newValuelistener);
valueEditor.registerChangeListener(null); valueEditor.registerChangeListener(null);
oldNewValueButton.removeChangeListener(buttonChangeListener);
} }
private void addHyperlinkListener() { private void addHyperlinkListener() {
@ -506,7 +534,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
} else if (selectionType == FLOAT_SELECTION) { } else if (selectionType == FLOAT_SELECTION) {
populateFloatSelectionCheckPane(checkPane); populateFloatSelectionCheckPane(checkPane);
} }
checkPane.setBorder(BorderFactory.createEmptyBorder(ALIGNMENT_GAP, 0, 0, 0)); checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
return checkPane; return checkPane;
} }
@ -538,17 +566,17 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
} }
//单元格带控件 //单元格带控件
if (cellElement.getCellWidgetAttr() != null) { if (cellElement.getCellWidgetAttr() != null) {
checkPane.add(populateWidgetCheckPane(), BorderLayout.WEST); checkPane.add(populateWidgetCheckPane(), BorderLayout.CENTER);
} else { } else {
checkPane.add(populatCellCheckPane(), BorderLayout.WEST); checkPane.add(populatCellCheckPane(), BorderLayout.CENTER);
} }
} else { } else {
//批量选中单元格 //批量选中单元格
mutilRect(cellSelection); mutilRect(cellSelection);
if (!isAllHasWidget && !isAllHasHyperlink) { if (!isAllHasWidget && !isAllHasHyperlink) {
checkPane.add(populateMutilCellCheckPane(), BorderLayout.WEST); checkPane.add(populateMutilCellCheckPane(), BorderLayout.CENTER);
} else if (isAllHasWidget) { } else if (isAllHasWidget) {
checkPane.add(populateMutilWidgetCheckPane(), BorderLayout.WEST); checkPane.add(populateMutilWidgetCheckPane(), BorderLayout.CENTER);
} }
} }
} }
@ -609,28 +637,46 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
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("M_Insert-Float"), SwingConstants.LEFT), floatElementVisibleCheckBoxes} new Component[]{floatElementVisibleCheckBoxes}
}; };
double[] rowSize = {p}; double[] rowSize = {p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}}; int[][] rowCount = {{1, 1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_SMALL);
} }
// private JPanel populateWidgetCheckPane() {
// double f = TableLayout.FILL;
// double p = TableLayout.PREFERRED;
// Component[][] components = new Component[][]{
// new Component[]{new UILabel(Inter.getLocText("FR-Designer_Cell"), SwingConstants.LEFT), cellElementVisibleCheckBoxes},
// new Component[]{null, newValue},
// new Component[]{null, valueEditor},
// new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget"), SwingConstants.LEFT), widgetVisible},
// new Component[]{null, widgetAvailable}
// };
// double[] rowSize = {p, p, p, p, p};
// double[] columnSize = {p, f};
// int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
// return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
// }
private JPanel populateWidgetCheckPane() { private JPanel populateWidgetCheckPane() {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
UILabel cv = new UILabel(Inter.getLocText("FR-Designer_Cell_Value") + " ");
cv.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Cell"), SwingConstants.LEFT), cellElementVisibleCheckBoxes}, new Component[]{cellElementVisibleCheckBoxes, null},
new Component[]{null, newValue}, new Component[]{cv,valueGroup()},
new Component[]{null, valueEditor}, new Component[]{null, newValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget"), SwingConstants.LEFT), widgetVisible}, new Component[]{widgetVisible,null},
new Component[]{null, widgetAvailable} new Component[]{widgetAvailable,null}
}; };
double[] rowSize = {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, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {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, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_SMALL);
} }
private JPanel populateMutilWidgetCheckPane() { private JPanel populateMutilWidgetCheckPane() {
@ -659,18 +705,34 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
} }
// private JPanel populatCellCheckPane() {
// double f = TableLayout.FILL;
// double p = TableLayout.PREFERRED;
// Component[][] components = new Component[][]{
// new Component[]{cellElementVisibleCheckBoxes},
// new Component[]{newValue},
// new Component[]{valueEditor}
// };
// double[] rowSize = {p, p, p};
// double[] columnSize = {f};
// int[][] rowCount = {{1}, {1}, {1}};
// return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
// }
private JPanel populatCellCheckPane() { private JPanel populatCellCheckPane() {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
UILabel cv = new UILabel(Inter.getLocText("FR-Designer_Cell_Value") + " ");
cv.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{cellElementVisibleCheckBoxes}, new Component[]{cellElementVisibleCheckBoxes,null},
new Component[]{newValue}, new Component[]{cv,valueGroup()},
new Component[]{valueEditor} new Component[]{null,newValuePane}
}; };
double[] rowSize = {p, p, p}; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_SMALL);
double[] columnSize = {f};
int[][] rowCount = {{1}, {1}, {1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
} }
public TemplateCellElement getFirstCell() { public TemplateCellElement getFirstCell() {
@ -719,12 +781,30 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
if (!firstCell.isDoneAuthority(selected)) { if (!firstCell.isDoneAuthority(selected)) {
newValue.setSelected(firstCell.isDoneNewValueAuthority(selected)); newValue.setSelected(firstCell.isDoneNewValueAuthority(selected));
if (newValue.isSelected()) { if (newValue.isSelected()) {
oldNewValueButton.setSelectedIndex(1);
if (newValuePane != null){
newValuePane.setPreferredSize(VALUEPANE_NEW_DIMENSION);
newValueCard.show(newValuePane,"new");
newValuePane.setVisible(true);
}
valueEditor.setEnabled(true); valueEditor.setEnabled(true);
valueEditor.populate(firstCell.getCellPrivilegeControl().getNewValueMap().get(selected)); valueEditor.populate(firstCell.getCellPrivilegeControl().getNewValueMap().get(selected));
} else { } else {
if (newValuePane != null){
oldNewValueButton.setSelectedIndex(0);
newValuePane.setPreferredSize(VALUEPANE_OLD_DIMENSION);
newValueCard.show(newValuePane,"old");
newValuePane.setVisible(false);
}
valueEditor.setEnabled(false); valueEditor.setEnabled(false);
} }
} else { } else {
oldNewValueButton.setSelectedIndex(0);
if (newValuePane != null){
newValuePane.setPreferredSize(new Dimension(0,0));
newValueCard.show(newValuePane,"old");
newValuePane.setVisible(false);
}
newValue.setSelected(false); newValue.setSelected(false);
valueEditor.setEnabled(false); valueEditor.setEnabled(false);
} }
@ -756,6 +836,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
widgetAvailable.setEnabled(true); widgetAvailable.setEnabled(true);
newValue.setSelected(false); newValue.setSelected(false);
valueEditor.setEnabled(false); valueEditor.setEnabled(false);
oldNewValueButton.setSelectedIndex(0);
} }
private void checkColumnRowCheckBoxes(String selected) { private void checkColumnRowCheckBoxes(String selected) {
@ -826,4 +907,14 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
int[][] rowCount = {{1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
} }
private JPanel valueGroup(){
newValueCard = new CardLayout();
newValuePane = new JPanel(newValueCard);
newValuePane.add(valueEditor, "new");
newValuePane.add(new JPanel(), "old");
newValuePane.setPreferredSize(VALUEPANE_OLD_DIMENSION);
oldNewValueButton.setPreferredSize(VALUEPANE_NEW_DIMENSION);
return oldNewValueButton;
}
} }

16
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -6,7 +6,6 @@ import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.present.ConditionAttributesGroupPane; import com.fr.design.present.ConditionAttributesGroupPane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection; import com.fr.grid.selection.Selection;
import com.fr.page.ReportSettingsProvider; import com.fr.page.ReportSettingsProvider;
@ -22,25 +21,13 @@ import com.fr.design.actions.edit.merge.UnmergeCellAction;
import com.fr.design.actions.utils.DeprecatedActionManager; import com.fr.design.actions.utils.DeprecatedActionManager;
import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener; import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.fun.MenuHandler;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.mainframe.cell.QuickEditorRegion; import com.fr.design.mainframe.cell.QuickEditorRegion;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.SeparatorDef;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.core.SheetUtils;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.worksheet.WorkSheet; import com.fr.report.worksheet.WorkSheet;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.selection.SelectionEvent; import com.fr.design.selection.SelectionEvent;
import com.fr.design.selection.SelectionListener; import com.fr.design.selection.SelectionListener;
import com.fr.general.Inter;
import com.fr.grid.selection.FloatSelection;
import com.fr.page.ReportSettingsProvider;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import javax.swing.*; import javax.swing.*;
@ -69,7 +56,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
return; return;
} }
CellWidgetPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this); CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
QuickEditorRegion.getInstance().populate(getCurrentEditor()); QuickEditorRegion.getInstance().populate(getCurrentEditor());
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
@ -94,6 +81,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance()); EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance()); EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance());
EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane); EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(CellWidgetPropertyPane.getInstance());
} }
EastRegionContainerPane.getInstance().replaceHyperlinkPane(hyperlinkGroupPane); EastRegionContainerPane.getInstance().replaceHyperlinkPane(hyperlinkGroupPane);
EastRegionContainerPane.getInstance().removeParameterPane(); EastRegionContainerPane.getInstance().removeParameterPane();

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

@ -879,8 +879,9 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
} }
} }
if (BaseUtils.isAuthorityEditing()) { if (BaseUtils.isAuthorityEditing()) {
EastRegionContainerPane.getInstance().replaceUpPane(allowAuthorityUpPane()); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(allowAuthorityUpPane());
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
} }
centerPane.needToShowCoverAndHidPane(); centerPane.needToShowCoverAndHidPane();

56
designer/src/com/fr/design/mainframe/SheetAuthorityEditPane.java

@ -28,12 +28,14 @@ import java.awt.event.ItemListener;
*/ */
public class SheetAuthorityEditPane extends AuthorityEditPane { public class SheetAuthorityEditPane extends AuthorityEditPane {
private static final int TOP_GAP = 11; private static final int TOP_GAP = 11;
private static final int LEFT_GAP = 8; private static final int LEFT_GAP = 4;
private static final int ALIGNMENT_GAP = -3; private static final int ALIGNMENT_GAP = -3;
private UICheckBox sheetVisible = new UICheckBox(Inter.getLocText("Widget-Visible")); private UICheckBox sheetVisible = new UICheckBox("sheet" + Inter.getLocText("Widget-Visible"));
private WorkBook workBook = null; private WorkBook workBook = null;
private int selectedIndex = -1; private int selectedIndex = -1;
private JPanel typePane;
private JPanel namePane;
private ItemListener itemListener = new ItemListener() { private ItemListener itemListener = new ItemListener() {
@Override @Override
@ -66,47 +68,43 @@ public class SheetAuthorityEditPane extends AuthorityEditPane {
super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate());
setLayout(new BorderLayout()); setLayout(new BorderLayout());
type = new UILabel(); type = new UILabel();
typePane = new JPanel(new BorderLayout());
typePane.add(type, BorderLayout.CENTER);
type.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0));
typePane.setBorder(BorderFactory.createLineBorder(Color.lightGray));
name = new UILabel(); name = new UILabel();
namePane = new JPanel(new BorderLayout());
namePane.add(name, BorderLayout.CENTER);
name.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0));
namePane.setBorder(BorderFactory.createLineBorder(Color.lightGray));
checkPane = new JPanel(); checkPane = new JPanel();
checkPane.setLayout(new BorderLayout()); checkPane.setLayout(new BorderLayout());
this.add(layoutText(), BorderLayout.WEST); // this.add(layoutText(), BorderLayout.WEST);
this.add(layoutPane(), BorderLayout.CENTER); // this.add(layoutPane(), BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, 0)); this.add(centerPane(), BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, RIGHT_GAP));
this.workBook = editingWorkBook; this.workBook = editingWorkBook;
sheetVisible.addItemListener(itemListener); sheetVisible.addItemListener(itemListener);
this.selectedIndex = selectedIndex; this.selectedIndex = selectedIndex;
} }
private JPanel centerPane() {
private JPanel layoutText() {
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Type") + ":", SwingConstants.RIGHT)},
new Component[]{new UILabel(Inter.getLocText("WF-Name") + ":", SwingConstants.RIGHT)},
new Component[]{new UILabel(Inter.getLocText("DashBoard-Potence") + ":", SwingConstants.RIGHT)},
};
double[] rowSize = {p, p, p};
double[] columnSize = {p};
int[][] rowCount = {{1}, {1}, {1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
}
private JPanel layoutPane() {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{type}, new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), typePane},
new Component[]{name}, new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), namePane},
new Component[]{checkPane}, new Component[]{checkPane, null},
}; };
double[] rowSize = {p, p, p};
double[] columnSize = {f}; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM);
int[][] rowCount = {{1}, {1}, {1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
} }
/** /**
* 更新权限编辑面板的具体内容类型名称权限面板 * 更新权限编辑面板的具体内容类型名称权限面板
*/ */
@ -121,7 +119,7 @@ public class SheetAuthorityEditPane extends AuthorityEditPane {
return; return;
} }
checkPane.add(populateCheckPane(), BorderLayout.CENTER); checkPane.add(populateCheckPane(), BorderLayout.CENTER);
checkPane.setBorder(BorderFactory.createEmptyBorder(ALIGNMENT_GAP, 0, 0, 0)); checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
checkVisibleCheckBoxes(); checkVisibleCheckBoxes();
} }

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

@ -215,8 +215,9 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
private void doWithAuthority() { private void doWithAuthority() {
AuthoritySheetEditedPane sheetEditedPane = new AuthoritySheetEditedPane(reportComposite.getEditingWorkBook(), selectedIndex); AuthoritySheetEditedPane sheetEditedPane = new AuthoritySheetEditedPane(reportComposite.getEditingWorkBook(), selectedIndex);
sheetEditedPane.populate(); sheetEditedPane.populate();
EastRegionContainerPane.getInstance().replaceUpPane(sheetEditedPane); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(sheetEditedPane);
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
} }

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

@ -84,8 +84,8 @@ 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,20,basicPane()); basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"),290,24,basicPane());
seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"),290,20,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;

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

@ -36,7 +36,7 @@ import java.awt.event.ItemListener;
public class CellOtherSetPane extends AbstractCellAttrPane { public class CellOtherSetPane extends AbstractCellAttrPane {
private static final int HEAD_WDITH = 290; private static final int HEAD_WDITH = 290;
private static final int HEAD_HEIGTH = 20; private static final int HEAD_HEIGTH = 24;
// normal // normal
private UIButtonGroup autoshrik; private UIButtonGroup autoshrik;

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

@ -2,8 +2,9 @@ package com.fr.design.widget;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.present.dict.DictionaryPane;
@ -15,6 +16,7 @@ import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.util.ArrayList;
/* /*
* carl :单独弄出来 * carl :单独弄出来
@ -23,7 +25,10 @@ public class CellWidgetCardPane extends BasicPane {
//当前的编辑器属性定义面板 //当前的编辑器属性定义面板
private DataModify<? extends Widget> currentEditorDefinePane; private DataModify<? extends Widget> currentEditorDefinePane;
//属性配置切换面板 //属性配置切换面板
private JTabbedPane tabbedPane; private ArrayList<JPanel> paneList;
private JPanel center;
private UIHeadGroup tabsHeaderIconPane;
private CardLayout tabbedPane;
private BasicWidgetPropertySettingPane widgetPropertyPane; private BasicWidgetPropertySettingPane widgetPropertyPane;
//通用属性容器 //通用属性容器
@ -43,54 +48,87 @@ public class CellWidgetCardPane extends BasicPane {
private JPanel eventTabPane; private JPanel eventTabPane;
private WidgetEventPane eventPane; private WidgetEventPane eventPane;
private ElementCasePane pane;
public CellWidgetCardPane(ElementCasePane pane) { public CellWidgetCardPane(ElementCasePane pane) {
this.initComponents(pane); this.pane = pane;
// this.initComponents(pane);
}
public BasicWidgetPropertySettingPane initBasicWidgetPropertyPane(){
return new BasicWidgetPropertySettingPane();
} }
private void initComponents(ElementCasePane pane) { private void initComponents(ElementCasePane pane) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
tabbedPane = new UITabbedPane(); //k
this.add(tabbedPane, BorderLayout.CENTER); tabbedPane = new CardLayout();
center = new JPanel(tabbedPane);
this.add(center, BorderLayout.CENTER);
attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
eventTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); eventTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
initPaneList();
eventPane = new WidgetEventPane(pane); eventPane = new WidgetEventPane(pane);
eventTabPane.add(eventPane, BorderLayout.CENTER); eventTabPane.add(eventPane, BorderLayout.CENTER);
tabbedPane.add(Inter.getLocText("FR-Designer_Attribute"), attriTabPane); //k
tabbedPane.add(Inter.getLocText("FR-Designer_Form_Editing_Listeners"), eventTabPane); center.add(attriTabPane, Inter.getLocText("FR-Designer_Attribute"));
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")};
tabsHeaderIconPane = new UIHeadGroup(tabTitles) {
@Override
public void tabChanged(int index) {
tabbedPane.show(center, tabTitles[index]);
}
};
tabsHeaderIconPane.setNeedLeftRightOutLine(false);
this.add(tabsHeaderIconPane, BorderLayout.NORTH);
//数据字典
dictTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); dictTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
dictCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); dictCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
dictTabPane.add(dictCardPane, BorderLayout.CENTER); dictTabPane.add(dictCardPane, BorderLayout.CENTER);
dictCardLayout = new CardLayout(); dictCardLayout = new CardLayout();
dictCardPane.setLayout(dictCardLayout); dictCardPane.setLayout(dictCardLayout);
//构建树
treeTabPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); treeTabPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
widgetPropertyPane = new BasicWidgetPropertySettingPane(); widgetPropertyPane = new BasicWidgetPropertySettingPane();
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 0, 8)); UIExpandablePane uiExpandablePane = new UIExpandablePane("基本", 280, 20, widgetPropertyPane);
JPanel basic = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Form_Basic_Properties"));
northPane.add(basic); attriTabPane.add(uiExpandablePane, BorderLayout.NORTH);
basic.add(widgetPropertyPane);
attriTabPane.add(northPane, BorderLayout.NORTH);
attriCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); attriCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
attriTabPane.add(attriCardPane, BorderLayout.CENTER); attriTabPane.add(attriCardPane, BorderLayout.CENTER);
attriCardLayout = (CardLayout) attriCardPane.getLayout(); attriCardLayout = (CardLayout) attriCardPane.getLayout();
this.setPreferredSize(new Dimension(600, 450)); this.setPreferredSize(new Dimension(600, 450));
} }
private void initPaneList(){
paneList = new ArrayList<JPanel>();
paneList.add(attriTabPane);
paneList.add(eventPane);
}
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "Widget"; return "Widget";
} }
public void populate(Widget cellWidget) { public void populate(Widget cellWidget) {
initComponents(pane);
// super.populate(cellWidget);
currentEditorDefinePane = null; currentEditorDefinePane = null;
if (cellWidget instanceof NoneWidget) { if (cellWidget instanceof NoneWidget) {
this.tabbedPane.setEnabled(false); // this.tabbedPane.setEnabled(false);
} else { } else {
this.tabbedPane.setEnabled(true); // this.tabbedPane.setEnabled(true);
} }
WidgetDefinePaneFactory.RN rn = WidgetDefinePaneFactory.createWidgetDefinePane(cellWidget, new Operator() { WidgetDefinePaneFactory.RN rn = WidgetDefinePaneFactory.createWidgetDefinePane(cellWidget, new Operator() {
@ -117,7 +155,7 @@ public class CellWidgetCardPane extends BasicPane {
currentEditorDefinePane = definePane; currentEditorDefinePane = definePane;
eventPane.populate(cellWidget); eventPane.populate(cellWidget);
widgetPropertyPane.populate(cellWidget); widgetPropertyPane.populate(cellWidget);
tabbedPane.setSelectedIndex(0); tabsHeaderIconPane.setSelectedIndex(0);
} }
private void showDictPane(DataCreatorUI ui, String cardName) { private void showDictPane(DataCreatorUI ui, String cardName) {
@ -142,6 +180,7 @@ public class CellWidgetCardPane extends BasicPane {
return null; return null;
} }
widgetPropertyPane.update(widget); widgetPropertyPane.update(widget);
// super.update(widget);
Listener[] listener = eventPane == null ? new Listener[0] : eventPane.updateListeners(); Listener[] listener = eventPane == null ? new Listener[0] : eventPane.updateListeners();
widget.clearListeners(); widget.clearListeners();
@ -164,21 +203,26 @@ public class CellWidgetCardPane extends BasicPane {
private void addDictAttriPane() { private void addDictAttriPane() {
tabbedPane.add(this.dictTabPane, 1); center.add(this.dictTabPane, Inter.getLocText("FR-Designer_DS_Dictionary"));
tabbedPane.setTitleAt(1, Inter.getLocText("FR-Designer_DS_Dictionary")); reInitHeaderPane(this.dictTabPane);
} }
private void addTreeAttriPane() { private void addTreeAttriPane() {
tabbedPane.add(this.treeTabPane, 1); center.add(this.dictTabPane, Inter.getLocText("FR-Designer_Create_Tree"));
tabbedPane.setTitleAt(1, Inter.getLocText("FR-Designer_Create_Tree")); reInitHeaderPane(this.treeTabPane);
} }
private void removeDictAttriPane() { private void removeDictAttriPane() {
tabbedPane.remove(this.dictTabPane); center.remove(this.dictTabPane);
} }
private void removeTreeAttriPane() { private void removeTreeAttriPane() {
tabbedPane.remove(this.treeTabPane); center.remove(this.treeTabPane);
}
private void reInitHeaderPane(JPanel jPanel){
paneList.add(jPanel);
// tabsHeaderIconPane = new
} }
} }

6
designer/src/com/fr/design/widget/WidgetDefinePaneFactory.java

@ -4,8 +4,6 @@ import com.fr.base.FRContext;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.core.WidgetConstants; import com.fr.design.gui.core.WidgetConstants;
import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.present.dict.DictionaryPane;
import com.fr.design.widget.ui.*; import com.fr.design.widget.ui.*;
import com.fr.form.ui.*; import com.fr.form.ui.*;
import com.fr.report.web.button.form.TreeNodeToggleButton; import com.fr.report.web.button.form.TreeNodeToggleButton;
@ -77,10 +75,10 @@ public class WidgetDefinePaneFactory {
} }
public static class RN { public static class RN {
private DataModify<? extends Widget> definePane; private DataModify<Widget> definePane;
private String cardName; private String cardName;
public RN(DataModify<? extends Widget> definePane, String cardName) { public RN(DataModify<Widget> definePane, String cardName) {
this.definePane = definePane; this.definePane = definePane;
this.cardName = cardName; this.cardName = cardName;
} }

43
designer/src/com/fr/design/widget/WidgetEventPane.java

@ -4,10 +4,13 @@ package com.fr.design.widget;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.controlpane.ObjectUIControlPane;
import com.fr.design.mainframe.CellWidgetPropertyPane;
import com.fr.design.present.CellWriteAttrPane;
import com.fr.design.write.submit.DBManipulationPane; import com.fr.design.write.submit.DBManipulationPane;
import com.fr.design.write.submit.SmartInsertDBManipulationInWidgetEventPane; import com.fr.design.write.submit.SmartInsertDBManipulationInWidgetEventPane;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ObjectJControlPane;
import com.fr.design.gui.frpane.ListenerUpdatePane; import com.fr.design.gui.frpane.ListenerUpdatePane;
import com.fr.design.javascript.JavaScriptActionPane; import com.fr.design.javascript.JavaScriptActionPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
@ -15,40 +18,52 @@ import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.form.event.Listener; import com.fr.form.event.Listener;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.grid.GridUtils;
import com.fr.grid.selection.CellSelection;
import com.fr.privilege.finegrain.WidgetPrivilegeControl;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.stable.ReportConstants;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
public class WidgetEventPane extends ObjectJControlPane { public class WidgetEventPane extends ObjectUIControlPane {
public WidgetEventPane() {
this(null);
}
public WidgetEventPane(ElementCasePane pane) { public WidgetEventPane(ElementCasePane pane) {
super(pane); super(pane);
this.setNameListEditable(false); this.setNameListEditable(false);
} }
@Override
public String getAddItemText() {
return Inter.getLocText("FR-Designer_Add_Event");
}
/** /**
* 生成添加按钮的NameableCreator * 生成添加按钮的NameableCreator
* @return 按钮的NameableCreator * @return 按钮的NameableCreator
*/ */
public NameableCreator[] createNameableCreators() { public NameableCreator[] createNameableCreators() {
return new NameableCreator[]{ return new NameableCreator[]{
EventCreator.STATECHANGE new EventCreator(Widget.EVENT_STATECHANGE, WidgetEventListenerUpdatePane.class)
}; };
} }
@Override @Override
public void saveSettings() {
CellWidgetPropertyPane.getInstance().update();
}
@Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Inter.getLocText("Event"); return Inter.getLocText("Event");
} }
public static class WidgetEventListenerUpdatePane extends ListenerUpdatePane { public static class WidgetEventListenerUpdatePane extends ListenerUpdatePane {
private ElementCasePane epane; private ElementCasePane epane;
public WidgetEventListenerUpdatePane() {
this(null);
}
public WidgetEventListenerUpdatePane(ElementCasePane epane){ public WidgetEventListenerUpdatePane(ElementCasePane epane){
this.epane = epane; this.epane = epane;
super.initComponents(); super.initComponents();
@ -104,7 +119,7 @@ public class WidgetEventPane extends ObjectJControlPane {
return; return;
} }
this.refreshNameableCreator(EventCreator.createEventCreator(widget.supportedEvents())); this.refreshNameableCreator(EventCreator.createEventCreator(widget.supportedEvents(), WidgetEventListenerUpdatePane.class));
List<NameObject> list = new ArrayList<NameObject>(); List<NameObject> list = new ArrayList<NameObject>();
Listener listener; Listener listener;

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

@ -1,14 +1,17 @@
package com.fr.design.widget; package com.fr.design.widget;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.WidgetDesignHandler; import com.fr.design.fun.WidgetDesignHandler;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.icombobox.UIComboBox; 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.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.*;
@ -25,11 +28,11 @@ import java.util.Vector;
/** /**
* CellEditorDef Pane. * CellEditorDef Pane.
*/ */
public class WidgetPane extends BasicPane implements ItemListener { public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener {
private EditorTypeComboBox editorTypeComboBox; private EditorTypeComboBox editorTypeComboBox;
private CellWidgetCardPane cellEditorCardPane; private CellWidgetCardPane cellEditorCardPane;
private boolean shouldFireSelectedEvent; private boolean shouldFireSelectedEvent = true;
protected JPanel northPane; protected JPanel northPane;
public WidgetPane() { public WidgetPane() {
@ -45,7 +48,7 @@ public class WidgetPane extends BasicPane implements ItemListener {
protected void initComponents(ElementCasePane pane) { protected void initComponents(ElementCasePane pane) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
northPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); northPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
@ -58,8 +61,23 @@ public class WidgetPane extends BasicPane implements ItemListener {
cellEditorCardPane = new CellWidgetCardPane(pane); cellEditorCardPane = new CellWidgetCardPane(pane);
this.add(cellEditorCardPane, BorderLayout.CENTER); this.add(cellEditorCardPane, BorderLayout.CENTER);
this.addAttributeChangeListener(listener);
} }
protected JPanel createContentPane(){
return new JPanel();
}
AttributeChangeListener listener = new AttributeChangeListener() {
@Override
public void attributeChange() {
CellWidgetPropertyPane.getInstance().update();
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
};
/** /**
* 状态改变 * 状态改变
* *
@ -84,13 +102,13 @@ public class WidgetPane extends BasicPane implements ItemListener {
} }
@Override @Override
protected String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText("FR-Designer_Widget"); return Inter.getLocText("FR-Designer_Widget");
} }
public void populate(Widget widget) { public void populate(Widget widget) {
if (widget == null) { if (widget == null) {
widget = new TextEditor(); return;
} }
if (widget instanceof NameWidget) { if (widget instanceof NameWidget) {
@ -106,11 +124,16 @@ public class WidgetPane extends BasicPane implements ItemListener {
if (ArrayUtils.contains(ButtonConstants.CLASSES4BUTTON, clazz)) { if (ArrayUtils.contains(ButtonConstants.CLASSES4BUTTON, clazz)) {
clazz = Button.class; clazz = Button.class;
} }
cellEditorCardPane.populate(widget);
shouldFireSelectedEvent = false; shouldFireSelectedEvent = false;
editorTypeComboBox.setSelectedItemByWidgetClass(clazz); editorTypeComboBox.setSelectedItemByWidgetClass(clazz);
shouldFireSelectedEvent = true; shouldFireSelectedEvent = true;
cellEditorCardPane.populate(widget); removeAttributeChangeListener();
initAllListeners();
this.addAttributeChangeListener(listener);
} }
public Widget update() { public Widget update() {
@ -118,7 +141,7 @@ public class WidgetPane extends BasicPane implements ItemListener {
} }
protected void populateWidgetConfig(Widget widget) { protected void populateWidgetConfig(Widget widget) {
cellEditorCardPane.populate(widget); this.populate(widget);
} }
@ -244,4 +267,8 @@ public class WidgetPane extends BasicPane implements ItemListener {
&& ComparatorUtils.equals(((Item) o).name, name); && ComparatorUtils.equals(((Item) o).name, name);
} }
} }
public String getIconPath(){
return "";
}
} }

6
designer/src/com/fr/design/widget/ui/ButtonDefinePane.java

@ -1,14 +1,10 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.widget.ui.btn.ButtonDetailPaneFactory;
import com.fr.form.ui.Button; import com.fr.form.ui.Button;
import com.fr.form.ui.FreeButton; import com.fr.form.ui.FreeButton;
import com.fr.design.widget.DataModify;
import com.fr.design.widget.btn.ButtonDetailPane; import com.fr.design.widget.btn.ButtonDetailPane;
import com.fr.design.widget.ui.btn.ButtonDetailPaneFactory;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;

10
designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java

@ -1,17 +1,14 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.*; import javax.swing.*;
import com.fr.design.beans.BasicBeanPane;
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.present.dict.DictionaryPane;
import com.fr.form.ui.CheckBox; import com.fr.form.ui.CheckBox;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.design.widget.DataModify;
public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> { public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private UITextField text; private UITextField text;
@ -25,12 +22,11 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8));
JPanel textPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel textPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
textPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); textPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced")); UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, textPane);
advancedPane.add(textPane);
textPane.add(new UILabel(Inter.getLocText("Text") + ":")); textPane.add(new UILabel(Inter.getLocText("Text") + ":"));
text = new UITextField(8); text = new UITextField(8);
textPane.add(text); textPane.add(text);
this.add(advancedPane); this.add(uiExpandablePane);
} }
@Override @Override

4
designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java

@ -41,8 +41,6 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); attrPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
advancedPane.add(attrPane);
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
checkBoxDictPane = new CheckBoxDictPane(); checkBoxDictPane = new CheckBoxDictPane();
@ -61,7 +59,7 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
centerPane.add(buttonGroupDictPane); centerPane.add(buttonGroupDictPane);
attrPane.add(centerPane, BorderLayout.CENTER); attrPane.add(centerPane, BorderLayout.CENTER);
return advancedPane; return attrPane;
} }
@Override @Override

2
designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java

@ -1 +1 @@
package com.fr.design.widget.ui; import com.fr.base.GraphHelper; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : Shockway * Date: 13-9-18 * Time: 下午2:17 */ public abstract class CustomWritableRepeatEditorPane<T extends CustomWriteAbleRepeatEditor> extends WritableRepeatEditorPane<T> { private UICheckBox customDataCheckBox; private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30; private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30; public CustomWritableRepeatEditorPane() { this.initComponents(); } @Override protected JPanel setThirdContentPane() { JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); this.customDataCheckBox.setPreferredSize( new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT)); getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); JPanel otherContentPane = this.setForthContentPane(); if (otherContentPane != null) { contentPane.add(otherContentPane,BorderLayout.CENTER); } return contentPane; } protected abstract JPanel setForthContentPane(); protected void populateSubWritableRepeatEditorBean(T e) { this.customDataCheckBox.setSelected(e.isCustomData()); populateSubCustomWritableRepeatEditorBean(e); } protected abstract void populateSubCustomWritableRepeatEditorBean(T e); protected T updateSubWritableRepeatEditorBean() { T e = updateSubCustomWritableRepeatEditorBean(); e.setCustomData(this.customDataCheckBox.isSelected()); return e; } protected abstract T updateSubCustomWritableRepeatEditorBean(); } package com.fr.design.widget.ui; import com.fr.base.GraphHelper; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : Shockway * Date: 13-9-18 * Time: 下午2:17 */ public abstract class CustomWritableRepeatEditorPane<T extends CustomWriteAbleRepeatEditor> extends WritableRepeatEditorPane<T> { private UICheckBox customDataCheckBox; private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30; private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30; public CustomWritableRepeatEditorPane() { this.initComponents(); } @Override protected JPanel setThirdContentPane() { JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); this.customDataCheckBox.setPreferredSize( new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT)); JPanel otherContentPane = this.setForthContentPane(); if (otherContentPane != null) { getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); } getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); JPanel otherContentPane = this.setForthContentPane(); getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); if (otherContentPane != null) { getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); contentPane.add(otherContentPane,BorderLayout.CENTER); getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); } getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); return contentPane; getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); } return otherContentPane; } protected abstract JPanel setForthContentPane(); protected void populateSubWritableRepeatEditorBean(T e) { this.customDataCheckBox.setSelected(e.isCustomData()); populateSubCustomWritableRepeatEditorBean(e); } protected abstract void populateSubCustomWritableRepeatEditorBean(T e); protected T updateSubWritableRepeatEditorBean() { T e = updateSubCustomWritableRepeatEditorBean(); e.setCustomData(this.customDataCheckBox.isSelected()); return e; } protected abstract T updateSubCustomWritableRepeatEditorBean(); }

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

@ -3,12 +3,14 @@ package com.fr.design.widget.ui;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.data.core.FormatField; import com.fr.data.core.FormatField;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.DateEditor; import com.fr.form.ui.DateEditor;
import com.fr.general.DateUtils; import com.fr.general.DateUtils;
@ -19,8 +21,6 @@ import com.fr.stable.StringUtils;
import com.fr.stable.UtilEvalError; import com.fr.stable.UtilEvalError;
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;
@ -50,16 +50,10 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override @Override
protected JPanel setSecondContentPane() { protected JPanel setSecondContentPane() {
JPanel otherContentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
otherContentPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
JPanel returnTypePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel returnTypePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
returnTypePane.add(new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), BorderLayout.WEST); returnTypePane.add(new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), BorderLayout.WEST);
returnTypeComboBox = new UIComboBox(new String[] { Inter.getLocText("String"), Inter.getLocText("Date") }); returnTypeComboBox = new UIComboBox(new String[] { Inter.getLocText("String"), Inter.getLocText("Date") });
returnTypeComboBox.setPreferredSize(new Dimension(70, 20)); returnTypeComboBox.setPreferredSize(new Dimension(70, 20));
returnTypePane.add(returnTypeComboBox, BorderLayout.CENTER);
JPanel firstPanel = GUICoreUtils.createFlowPane(new JComponent[]{returnTypePane}, FlowLayout.LEFT, 5);
firstPanel.setPreferredSize(new Dimension(141,30));
otherContentPane.add(firstPanel);
// sample pane // sample pane
sampleLabel = new UILabel(""); sampleLabel = new UILabel("");
@ -79,9 +73,27 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
}); });
JPanel secondPanel = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"),dateFormatComboBox,sampleLabel}, FlowLayout.LEFT, 5); JPanel secondPanel = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"),dateFormatComboBox,sampleLabel}, FlowLayout.LEFT, 5);
secondPanel.setPreferredSize(new Dimension(220,30)); secondPanel.setPreferredSize(new Dimension(220,30));
otherContentPane.add(secondPanel);
otherContentPane.add(initStartEndDatePane(), BorderLayout.SOUTH); startDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null);
return otherContentPane; endDv = ValueEditorPaneFactory.createDateValueEditorPane(null, null);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypeComboBox },
new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), dateFormatComboBox},
new Component[]{null, sampleLabel},
new Component[]{new UILabel(Inter.getLocText("FS_Start_Date") + ":"), startDv},
new Component[]{new UILabel(Inter.getLocText("FS_End_Date") + ":"), endDv},
};
double[] rowSize = {p, p,p,p,p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 1);
return panel;
} }
private String[] getDateFormateArray() { private String[] getDateFormateArray() {

14
designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java

@ -25,16 +25,22 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false); directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false);
directWriteCheckBox.setPreferredSize(new Dimension(100, 30)); directWriteCheckBox.setPreferredSize(new Dimension(100, 30));
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{directWriteCheckBox}, FlowLayout.LEFT, 5));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
advancedPane.add(contentPane);
contentPane.add(waterMarkDictPane); contentPane.add(waterMarkDictPane);
JPanel otherContentPane = this.setSecondContentPane(); JPanel otherContentPane = this.setSecondContentPane();
if (otherContentPane != null) { if (otherContentPane != null) {
contentPane.add(otherContentPane); contentPane.add(otherContentPane);
} }
return advancedPane; return contentPane;
}
public JPanel setValidatePane(){
JPanel otherContentPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
otherContentPane.add(GUICoreUtils.createFlowPane(new JComponent[]{directWriteCheckBox}, FlowLayout.LEFT, 5));
return otherContentPane;
} }
protected abstract JPanel setSecondContentPane(); protected abstract JPanel setSecondContentPane();

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

@ -7,6 +7,8 @@ import java.awt.event.ItemListener;
import javax.swing.*; import javax.swing.*;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
@ -15,18 +17,18 @@ import javax.swing.event.DocumentListener;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
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.utils.gui.GUICoreUtils; import com.fr.design.layout.TableLayout;
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;
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;
private UICheckBox allowBlankCheckBox; protected UICheckBox allowBlankCheckBox;
// richer:错误信息,是所有控件共有的属性,所以放到这里来 // richer:错误信息,是所有控件共有的属性,所以放到这里来
private UITextField errorMsgTextField; protected UITextField errorMsgTextField;
private UITextField regErrorMsgTextField; protected JPanel validatePane;
private JPanel validatePane;
public FieldEditorDefinePane() { public FieldEditorDefinePane() {
this.initComponents(); this.initComponents();
@ -34,47 +36,19 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8));
initRegErrorMsgTextField();
//JPanel firstPanel = FRGUIPaneFactory.createBorderLayout_M_Pane();
allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null"));
allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT));
allowBlankCheckBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected());
}
});
initErrorMsgPane(); initErrorMsgPane();
JPanel contentPane = this.setFirstContentPane();
if (contentPane != null) {
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane);
this.add(uiExpandablePane, BorderLayout.NORTH);
}
this.addValidatePane();
} }
protected void initRegErrorMsgTextField() {
regErrorMsgTextField = new UITextField(16);
regErrorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {
public void changedUpdate(DocumentEvent e) {
regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText());
}
public void insertUpdate(DocumentEvent e) {
regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText());
}
public void removeUpdate(DocumentEvent e) {
regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText());
}
});
}
protected void initErrorMsgPane() { protected void initErrorMsgPane() {
// 错误信息 // 错误信息
JPanel errorMsgPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); errorMsgTextField = new UITextField(10);
errorMsgPane.add(new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"));
errorMsgTextField = new UITextField(16);
errorMsgPane.add(errorMsgTextField);
// richer:主要为了方便查看比较长的错误信息 // richer:主要为了方便查看比较长的错误信息
errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {
@ -91,20 +65,13 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
errorMsgTextField.setToolTipText(errorMsgTextField.getText()); errorMsgTextField.setToolTipText(errorMsgTextField.getText());
} }
}); });
this.addAllowBlankPane(allowBlankCheckBox);
JPanel contentPane = this.setFirstContentPane();
if (contentPane != null) {
//contentPane.add(firstPanel);
this.add(contentPane, BorderLayout.NORTH);
} else {
//this.add(firstPanel, BorderLayout.CENTER);
}
} }
@Override @Override
public void populateBean(T ob) { public void populateBean(T ob) {
this.allowBlankCheckBox.setSelected(ob.isAllowBlank()); this.allowBlankCheckBox.setSelected(ob.isAllowBlank());
errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected()); // errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected());
this.errorMsgTextField.setText(ob.getErrorMessage()); this.errorMsgTextField.setText(ob.getErrorMessage());
populateSubFieldEditorBean(ob); populateSubFieldEditorBean(ob);
@ -126,30 +93,72 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected abstract JPanel setFirstContentPane(); protected abstract JPanel setFirstContentPane();
@Override @Override
public void checkValid() throws Exception { public void checkValid() throws Exception {
} }
public void addAllowBlankPane(UICheckBox allowBlankCheckBox) { protected void addValidatePane() {
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Validate")); validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
validatePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); final UILabel uiLabel = new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":");
validatePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); errorMsgTextField = new UITextField(10);
northPane.add(validatePane); allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null"));
this.add(northPane, BorderLayout.CENTER); allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));
JPanel firstPane = GUICoreUtils.createFlowPane(new JComponent[]{allowBlankCheckBox}, FlowLayout.LEFT, 5); allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT));
validatePane.add(firstPane); allowBlankCheckBox.addItemListener(new ItemListener() {
JPanel secondPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), errorMsgTextField}, FlowLayout.LEFT, 24);
secondPane.setPreferredSize(new Dimension(400, 23));
validatePane.add(secondPane);
}
public JPanel getValidatePane() { @Override
return validatePane; public void itemStateChanged(ItemEvent e) {
boolean isSelected = allowBlankCheckBox.isSelected();
uiLabel.setVisible(!isSelected);
errorMsgTextField.setVisible(!isSelected);
if(isSelected){
uiLabel.setPreferredSize(new Dimension(0, 0));
errorMsgTextField.setPreferredSize(new Dimension(0, 0));
}else{
uiLabel.setPreferredSize(new Dimension(66, 20));
errorMsgTextField.setPreferredSize(new Dimension(150, 20));
}
}
});
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{allowBlankCheckBox, null },
new Component[]{uiLabel, errorMsgTextField},
};
double[] rowSize = {p, p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 1);
validatePane.add(panel, BorderLayout.NORTH);
JPanel contentPane = this.setValidatePane();
if (contentPane != null) {
validatePane.add(contentPane, BorderLayout.CENTER);
}
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Validate"), 280, 20, validatePane);
this.add(uiExpandablePane, BorderLayout.CENTER);
// JPanel firstPane = GUICoreUtils.createFlowPane(new JComponent[]{allowBlankCheckBox}, FlowLayout.LEFT, 5);
// validatePane.add(firstPane);
// JPanel secondPane = new JPanel(FRGUIPaneFactory.createLabelFlowLayout());
// secondPane.add(new UILabel("错误提示" + ":"));
// secondPane.add(errorMsgTextField);
// JPanel secondPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), errorMsgTextField}, FlowLayout.LEFT, 24);
// secondPane.setPreferredSize(new Dimension(400, 23));
// validatePane.add(secondPane);
} }
public UITextField getRegErrorMsgTextField() { public JPanel setValidatePane(){
return regErrorMsgTextField; return null;
} }
} }

32
designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java

@ -5,23 +5,20 @@ import java.util.List;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
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;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.present.dict.DictionaryPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.IframeEditor; import com.fr.form.ui.IframeEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.design.widget.DataModify;
public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> { public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
private UITextField srcTextField; private UITextField srcTextField;
@ -35,7 +32,7 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
private void initComponents() { private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
JPanel attr = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); JPanel attr = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
@ -44,22 +41,23 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
contentPane.add(attr); contentPane.add(attr);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] rowSize = { p, TableLayout.PREFERRED }; double[] rowSize = { p, p, p, p };
double[] columnSize = { p, f }; double[] columnSize = { p, f };
java.awt.Component[][] coms = { java.awt.Component[][] coms = {
{ horizontalCheck, null },
{ verticalCheck, null },
{ new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField() }, { new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField() },
{ new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } }; { new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } };
parameterViewPane.setPreferredSize(new Dimension(400, 256)); int[][] rowCount = {{1, 1},{1, 1},{1, 1}, {1, 1}};
JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5);
centerPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
centerPane.add(GUICoreUtils.createFlowPane(new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField(16), FlowLayout.LEFT));
centerPane.add(GUICoreUtils.createFlowPane( new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane(), FlowLayout.LEFT)); contentPane.add(panel);
parameterViewPane.setPreferredSize(new Dimension(540, 235));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced")); UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane);
advancedPane.add(contentPane); this.add(uiExpandablePane, BorderLayout.NORTH);
contentPane.add(centerPane);
this.add(advancedPane, BorderLayout.CENTER);
} }

23
designer/src/com/fr/design/widget/ui/MultiFileEditorPane.java

@ -2,6 +2,7 @@ package com.fr.design.widget.ui;
import java.awt.*; import java.awt.*;
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.*;
@ -11,7 +12,8 @@ import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.icombobox.DictionaryConstants; import com.fr.design.gui.icombobox.DictionaryConstants;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.MultiFileEditor; import com.fr.form.ui.MultiFileEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -38,27 +40,36 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
fileSizeField = new UINumberField(); fileSizeField = new UINumberField();
fileSizeField.setPreferredSize(new Dimension(80, 18)); fileSizeField.setPreferredSize(new Dimension(80, 18));
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel singleFilePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); JPanel singleFilePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
singleFilePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); singleFilePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
singleFilePane.add(singleFileCheckBox); singleFilePane.add(singleFileCheckBox);
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{singleFilePane}, FlowLayout.LEFT,0));
JPanel allowTypePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); JPanel allowTypePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
allowTypePane.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); allowTypePane.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
allowTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
allowTypePane.add(new UILabel(" " + Inter.getLocText("File-Allow_Upload_Files") + ":")); allowTypePane.add(new UILabel(" " + Inter.getLocText("File-Allow_Upload_Files") + ":"));
allowTypePane.add(acceptType); allowTypePane.add(acceptType);
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{allowTypePane}, FlowLayout.LEFT,5));
JPanel fileSizePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); JPanel fileSizePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
fileSizePane.add(new UILabel(" " + Inter.getLocText("File-File_Size_Limit") + ":")); fileSizePane.add(new UILabel(" " + Inter.getLocText("File-File_Size_Limit") + ":"));
fileSizePane.add(fileSizeField); fileSizePane.add(fileSizeField);
fileSizePane.add(new UILabel(" KB")); fileSizePane.add(new UILabel(" KB"));
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{fileSizePane}, FlowLayout.LEFT,11));
return centerPane; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{singleFileCheckBox, null },
new Component[]{new UILabel(" " + Inter.getLocText("File-Allow_Upload_Files") + ":"), acceptType},
new Component[]{new UILabel(" " + Inter.getLocText("File-File_Size_Limit") + ":"), fileSizeField},
};
double[] rowSize = {p, p,p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5);
return panel;
} }
@Override @Override

4
designer/src/com/fr/design/widget/ui/NoneWidgetDefinePane.java

@ -1,10 +1,6 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.present.dict.DictionaryPane;
import com.fr.form.ui.NoneWidget; import com.fr.form.ui.NoneWidget;
import com.fr.design.widget.DataModify;
/** /**
* *

44
designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java

@ -19,9 +19,10 @@ import javax.swing.text.DefaultFormatter;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
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.NumberEditor; import com.fr.form.ui.NumberEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.design.utils.gui.GUICoreUtils;
public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor> { public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor> {
/** /**
@ -141,7 +142,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
}; };
public NumberEditorDefinePane() { public NumberEditorDefinePane() {
this.initComponents(); super();
} }
@ -156,23 +157,21 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
content.setLayout(FRGUIPaneFactory.createBorderLayout()); content.setLayout(FRGUIPaneFactory.createBorderLayout());
// richer:数字的允许直接编辑没有意义 // richer:数字的允许直接编辑没有意义
waterMarkDictPane = new WaterMarkDictPane();
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
content.add(northPane, BorderLayout.NORTH);
waterMarkDictPane = new WaterMarkDictPane(); return waterMarkDictPane;
northPane.add(waterMarkDictPane); }
content.add(northPane, BorderLayout.NORTH);
public JPanel setValidatePane() {
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals")); this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals"));
this.decimalLength = new com.fr.design.editor.editor.IntegerEditor(); this.decimalLength = new com.fr.design.editor.editor.IntegerEditor();
this.decimalLength.setColumns(4); this.decimalLength.setColumns(4);
limitNumberPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Double", "Numbers"}) + ":"), this.decimalLength},
FlowLayout.LEFT, 4);
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.allowDecimalsCheckBox, limitNumberPane}, FlowLayout.LEFT, 4));
this.allowDecimalsCheckBox.addActionListener(actionListener1); this.allowDecimalsCheckBox.addActionListener(actionListener1);
this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative")); this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative"));
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.allowNegativeCheckBox}, FlowLayout.LEFT, 4));
this.allowNegativeCheckBox.addActionListener(actionListener2); this.allowNegativeCheckBox.addActionListener(actionListener2);
this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false); this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false);
@ -180,7 +179,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
maxValueSpinner.setPreferredSize(new Dimension(120, 20)); maxValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.maxValueSpinner); setNotAllowsInvalid(this.maxValueSpinner);
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.setMaxValueCheckBox, this.maxValueSpinner}, FlowLayout.LEFT, 4));
this.maxValueSpinner.setVisible(false); this.maxValueSpinner.setVisible(false);
this.setMaxValueCheckBox.addActionListener(actionListener3); this.setMaxValueCheckBox.addActionListener(actionListener3);
this.maxValueSpinner.addChangeListener(changeListener1); this.maxValueSpinner.addChangeListener(changeListener1);
@ -189,15 +187,29 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
minValueSpinner.setPreferredSize(new Dimension(120, 20)); minValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.minValueSpinner); setNotAllowsInvalid(this.minValueSpinner);
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.setMinValueCheckBox, this.minValueSpinner}, FlowLayout.LEFT, 4));
this.minValueSpinner.setVisible(false); this.minValueSpinner.setVisible(false);
this.setMinValueCheckBox.addActionListener(actionListener4); this.setMinValueCheckBox.addActionListener(actionListener4);
this.minValueSpinner.addChangeListener(changeListener2); this.minValueSpinner.addChangeListener(changeListener2);
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), getRegErrorMsgTextField()}, FlowLayout.LEFT, 24));
return content;
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{allowDecimalsCheckBox, null },
new Component[]{new UILabel(Inter.getLocText(new String[]{"Double", "Numbers"})), decimalLength },
new Component[]{allowNegativeCheckBox, null},
new Component[]{setMaxValueCheckBox, maxValueSpinner},
new Component[]{setMinValueCheckBox, minValueSpinner},
};
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 1);
return panel;
} }
@Override @Override
protected void populateSubFieldEditorBean(NumberEditor e) { protected void populateSubFieldEditorBean(NumberEditor e) {
allowDecimalsCheckBox.setSelected(e.isAllowDecimals()); allowDecimalsCheckBox.setSelected(e.isAllowDecimals());
@ -229,7 +241,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
minValueSpinner.setVisible(true); minValueSpinner.setVisible(true);
minValueSpinner.setValue(new Double(e.getMinValue())); minValueSpinner.setValue(new Double(e.getMinValue()));
} }
this.getRegErrorMsgTextField().setText(e.getRegErrorMessage());
this.waterMarkDictPane.populate(e); this.waterMarkDictPane.populate(e);
} }
@ -257,7 +268,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.waterMarkDictPane.update(ob); this.waterMarkDictPane.update(ob);
ob.setRegErrorMessage(this.getRegErrorMsgTextField().getText());
return ob; return ob;
} }

4
designer/src/com/fr/design/widget/ui/RadioDefinePane.java

@ -1,12 +1,8 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.TreeSettingPane;
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.present.dict.DictionaryPane;
import com.fr.design.widget.DataModify;
import com.fr.form.ui.Radio; import com.fr.form.ui.Radio;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.Inter; import com.fr.general.Inter;

11
designer/src/com/fr/design/widget/ui/RadioGroupDefinePane.java

@ -1,16 +1,13 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import java.awt.BorderLayout;
import java.awt.FlowLayout; import java.awt.FlowLayout;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.present.dict.DictionaryPane;
import com.fr.form.ui.RadioGroup; import com.fr.form.ui.RadioGroup;
import com.fr.general.Inter;
public class RadioGroupDefinePane extends FieldEditorDefinePane<RadioGroup> { public class RadioGroupDefinePane extends FieldEditorDefinePane<RadioGroup> {
private DictionaryPane dictPane; private DictionaryPane dictPane;
@ -30,16 +27,12 @@ public class RadioGroupDefinePane extends FieldEditorDefinePane<RadioGroup> {
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
buttonGroupDictPane = new ButtonGroupDictPane(); buttonGroupDictPane = new ButtonGroupDictPane();
buttonGroupDictPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0)); buttonGroupDictPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
centerPane.add(buttonGroupDictPane); centerPane.add(buttonGroupDictPane);
advancedPane.add(centerPane); return centerPane;
attrPane.add(advancedPane, BorderLayout.CENTER);
return attrPane;
} }
@Override @Override

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

@ -1,16 +1,12 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.frpane.RegPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.TextEditor; import com.fr.form.ui.TextEditor;
import com.fr.form.ui.reg.RegExp; import com.fr.form.ui.reg.RegExp;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
@ -26,7 +22,6 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
regPane = createRegPane(); regPane = createRegPane();
final RegPane.RegChangeListener rl = new RegPane.RegChangeListener() { final RegPane.RegChangeListener rl = new RegPane.RegChangeListener() {
@ -46,9 +41,6 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
} }
}; };
regPane.addPhoneRegListener(pl); regPane.addPhoneRegListener(pl);
getValidatePane().add(GUICoreUtils.createFlowPane(regPane, FlowLayout.LEFT));
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), getRegErrorMsgTextField()}, FlowLayout.LEFT, 24));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
waterMarkDictPane.addInputKeyListener(new KeyAdapter() { waterMarkDictPane.addInputKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) { public void keyTyped(KeyEvent e) {
@ -61,15 +53,19 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
regPane.getRegComboBox().addActionListener(new ActionListener() { regPane.getRegComboBox().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
RegExp regExp = (RegExp) regPane.getRegComboBox().getSelectedItem(); RegExp regExp = (RegExp) regPane.getRegComboBox().getSelectedItem();
getRegErrorMsgTextField().setEnabled(regExp.errorMessageEditable());
} }
}); });
advancedPane.add(waterMarkDictPane);
attrPane.add(advancedPane, BorderLayout.NORTH); return waterMarkDictPane;
return attrPane; }
public JPanel setValidatePane(){
return regPane;
} }
protected RegPane createRegPane() { protected RegPane createRegPane() {
return new RegPane(); return new RegPane();
} }
@ -82,14 +78,12 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
@Override @Override
protected void populateSubFieldEditorBean(TextEditor e) { protected void populateSubFieldEditorBean(TextEditor e) {
this.regPane.populate(e.getRegex()); this.regPane.populate(e.getRegex());
getRegErrorMsgTextField().setText(e.getRegErrorMessage());
waterMarkDictPane.populate(e); waterMarkDictPane.populate(e);
} }
@Override @Override
protected TextEditor updateSubFieldEditorBean() { protected TextEditor updateSubFieldEditorBean() {
TextEditor ob = newTextEditorInstance(); TextEditor ob = newTextEditorInstance();
ob.setRegErrorMessage(this.getRegErrorMsgTextField().getText());
ob.setRegex(this.regPane.update()); ob.setRegex(this.regPane.update());
waterMarkDictPane.update(ob); waterMarkDictPane.update(ob);

4
designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java

@ -50,9 +50,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
} }
protected JPanel setSecondContentPane() { protected JPanel setSecondContentPane() {
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
advancedPane.add(contentPane);
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane(); JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
contentPane.add(contenter,BorderLayout.NORTH); contentPane.add(contenter,BorderLayout.NORTH);
@ -62,7 +60,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
if (otherContentPane != null) { if (otherContentPane != null) {
contentPane.add(otherContentPane,BorderLayout.CENTER); contentPane.add(otherContentPane,BorderLayout.CENTER);
} }
return advancedPane; return contentPane;
} }
protected JPanel setThirdContentPane() { protected JPanel setThirdContentPane() {

4
designer/src/com/fr/design/widget/ui/UserEditorDefinePane.java

@ -1,12 +1,8 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.TreeSettingPane;
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.present.dict.DictionaryPane;
import com.fr.design.widget.DataModify;
import com.fr.form.ui.NameWidget; import com.fr.form.ui.NameWidget;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.Inter; import com.fr.general.Inter;

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

@ -3,7 +3,8 @@ package com.fr.design.widget.ui;
import java.awt.event.KeyListener; import java.awt.event.KeyListener;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
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;
@ -16,8 +17,9 @@ public class WaterMarkDictPane extends JPanel{
public WaterMarkDictPane() { public WaterMarkDictPane() {
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
this.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
this.add(new UILabel(Inter.getLocText("WaterMark") + ":")); this.add(new UILabel(Inter.getLocText("WaterMark") + ":"));
waterMarkTextField = new UITextField(16); waterMarkTextField = new UITextField(13);
this.add(waterMarkTextField); this.add(waterMarkTextField);
} }

4
designer/src/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java

@ -20,9 +20,7 @@ public abstract class WriteUnableRepeatEditorPane<E extends WriteUnableRepeatEdi
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
advancedPane.add(contentPane);
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
JPanel contenter=FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane(); JPanel contenter=FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
removeRepeatCheckBox = new UICheckBox(Inter.getLocText("Form-Remove_Repeat_Data"), false); removeRepeatCheckBox = new UICheckBox(Inter.getLocText("Form-Remove_Repeat_Data"), false);
@ -31,7 +29,7 @@ public abstract class WriteUnableRepeatEditorPane<E extends WriteUnableRepeatEdi
JPanel otherContentPane = this.setThirdContentPane(); JPanel otherContentPane = this.setThirdContentPane();
if (otherContentPane != null) if (otherContentPane != null)
contentPane.add(otherContentPane,BorderLayout.CENTER); contentPane.add(otherContentPane,BorderLayout.CENTER);
return advancedPane; return contentPane;
} }
protected abstract JPanel setThirdContentPane(); protected abstract JPanel setThirdContentPane();
@Override @Override

12
designer/src/com/fr/design/widget/ui/btn/DefineAppendColumnRowPane.java

@ -28,18 +28,20 @@ public class DefineAppendColumnRowPane extends BasicPane {
} }
private void initComponents() { private void initComponents() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double rowSize[] = { p, p }; double rowSize[] = { p, p ,p};
double columnSize[] = { p, p, p }; double columnSize[] = { p, f};
crEditor = new ColumnRowEditor(); crEditor = new ColumnRowEditor();
jNumberEditor = new com.fr.design.editor.editor.IntegerEditor(); jNumberEditor = new com.fr.design.editor.editor.IntegerEditor();
rowCountLable = new UILabel(Inter.getLocText("Edit-Row_Count") + ":"); rowCountLable = new UILabel(Inter.getLocText("Edit-Row_Count") + ":");
JPanel lpane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel lpane = FRGUIPaneFactory.createBorderLayout_S_Pane();
lpane.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 0)); lpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
lpane.add(new UILabel(Inter.getLocText("Append_Delete_Row_Message"))); lpane.add(new UILabel(Inter.getLocText("Append_Delete_Row_Message")));
Component[][] components = { { new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"}) + ":"), crEditor, lpane }, { rowCountLable, jNumberEditor } }; Component[][] components = { { new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"}) + ":"), crEditor }, { rowCountLable, jNumberEditor } ,{lpane,null}};
JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));

30
designer/src/com/fr/design/widget/ui/btn/TreeNodeToogleButtonDefinePane.java

@ -1,5 +1,6 @@
package com.fr.design.widget.ui.btn; package com.fr.design.widget.ui.btn;
import com.fr.design.foldablepane.UIExpandablePane;
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.TableLayout;
@ -27,16 +28,33 @@ public class TreeNodeToogleButtonDefinePane<T extends TreeNodeToggleButton> exte
protected void initComponents() { protected void initComponents() {
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double rowSize[] = {p}; double rowSize[] = {p};
double columnSize[] = {p, 184}; double columnSize[] = {p, f};
Component[][] n_components = { Component[][] n_components = {
{new UILabel(Inter.getLocText(new String[]{"Form-Button", "Type"}) + ":"), createButtonTypeComboBox()} {new UILabel(Inter.getLocText("FR-Designer_Button-Type") + ":"), createButtonTypeComboBox()},
}; };
JPanel northPane = TableLayoutHelper.createTableLayoutPane(n_components, rowSize, columnSize); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, 0, 8);
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced")); UIExpandablePane advancedPane = new UIExpandablePane("高级", 280, 20, panel);
advancedPane.add(northPane); this.add(advancedPane);
add(advancedPane, BorderLayout.CENTER);
// setLayout(FRGUIPaneFactory.createBorderLayout());
// double p = TableLayout.PREFERRED;
// double rowSize[] = {p};
// double columnSize[] = {p, 184};
// Component[][] n_components = {
// {new UILabel(Inter.getLocText(new String[]{"Form-Button", "Type"}) + ":"), createButtonTypeComboBox()}
// };
// JPanel northPane = TableLayoutHelper.createTableLayoutPane(n_components, rowSize, columnSize);
// JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
//// advancedPane.add(northPane);
// add(northPane);
} }
@Override @Override

8
designer/src/com/fr/poly/PolyDesigner.java

@ -139,7 +139,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
} }
private void initComponents() { private void initComponents() {
jSliderContainer = ((JWorkBook) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()).reportComposite.getjSliderContainer(); jSliderContainer = JSliderPane.getInstance();
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
ployareaPane = new JPanel(new PolyDesignerLayout()); ployareaPane = new JPanel(new PolyDesignerLayout());
polyArea = new PolyArea(this, resolution); polyArea = new PolyArea(this, resolution);
@ -396,7 +396,8 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
* 不支持权限编辑 * 不支持权限编辑
*/ */
public void noAuthorityEdit() { public void noAuthorityEdit() {
EastRegionContainerPane.getInstance().replaceUpPane(new NoSupportAuthorityEdit()); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new NoSupportAuthorityEdit());
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setAuthorityMode(false); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setAuthorityMode(false);
} }
@ -739,7 +740,8 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
startEditing(blockName); startEditing(blockName);
if (selection == null) { if (selection == null) {
if (BaseUtils.isAuthorityEditing()) { if (BaseUtils.isAuthorityEditing()) {
EastRegionContainerPane.getInstance().replaceUpPane(new NoSupportAuthorityEdit()); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION_DISABLED);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new NoSupportAuthorityEdit());
} else { } else {
EastRegionContainerPane.getInstance().replaceDownPane(new JPanel()); EastRegionContainerPane.getInstance().replaceDownPane(new JPanel());
QuickEditorRegion.getInstance().populate(QuickEditor.DEFAULT_EDITOR); QuickEditorRegion.getInstance().populate(QuickEditor.DEFAULT_EDITOR);

3
designer/src/com/fr/poly/creator/ChartBlockEditor.java

@ -274,7 +274,8 @@ public class ChartBlockEditor extends BlockEditor<MiddleChartComponent, PolyChar
//清参数面板 //清参数面板
jTemplate.removeParameterPaneSelection(); jTemplate.removeParameterPaneSelection();
} }
EastRegionContainerPane.getInstance().replaceUpPane(new NoSupportAuthorityEdit()); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION_DISABLED);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new NoSupportAuthorityEdit());
} }
QuickEditorRegion.getInstance().populate(creator.getQuickEditor(designer)); QuickEditorRegion.getInstance().populate(creator.getQuickEditor(designer));
} }

6
designer/src/com/fr/poly/creator/ECBlockPane.java

@ -53,13 +53,15 @@ public class ECBlockPane extends PolyElementCasePane {
public void selectionChanged(SelectionEvent e) { public void selectionChanged(SelectionEvent e) {
if (BaseUtils.isAuthorityEditing()) { if (BaseUtils.isAuthorityEditing()) {
if (designer.getSelection().getEditingElementCasePane() == null) { if (designer.getSelection().getEditingElementCasePane() == null) {
EastRegionContainerPane.getInstance().replaceUpPane(new NoSupportAuthorityEdit()); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION_DISABLED);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new NoSupportAuthorityEdit());
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setAuthorityMode(false); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setAuthorityMode(false);
return; return;
} }
AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(designer); AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(designer);
authorityPropertyPane.populate(); authorityPropertyPane.populate();
EastRegionContainerPane.getInstance().replaceUpPane(authorityPropertyPane); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane);
return; return;
} }

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

@ -92,6 +92,7 @@ public interface UIConstants {
public static final Color DEFAULT_BG_RULER = new Color(0xffffff); 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_LINE_COLOR = new Color(0xababab);
public static final Color RULER_SCALE_COLOR = new Color(0x4e504f); public static final Color RULER_SCALE_COLOR = new Color(0x4e504f);
public static final Color PROPERTY_PANE_BACKGROUND = new Color(0xdadadd);
public static final BufferedImage DRAG_BAR = BaseUtils.readImage("com/fr/design/images/control/bar.png"); public static final BufferedImage DRAG_BAR = BaseUtils.readImage("com/fr/design/images/control/bar.png");
@ -107,6 +108,8 @@ public interface UIConstants {
public static final BufferedImage DRAG_LEFT_PRESS = BaseUtils.readImage("com/fr/design/images/control/leftpre.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 = 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 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 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");
@ -135,6 +138,8 @@ public interface UIConstants {
public static final Icon EDIT_ICON = BaseUtils.readIcon("com/fr/design/images/m_file/edit.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 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 CLEAR_ICON = BaseUtils.readIcon("/com/fr/design/images/data/source/delete.png");
public static final Icon LIST_EDIT_ICON = BaseUtils.readIcon("/com/fr/design/images/control/edit.png");
public static final Icon LIST_EDIT_WHITE_ICON = BaseUtils.readIcon("/com/fr/design/images/control/edit.png");
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(153, 153, 153); public static final Color BARNOMAL = new Color(153, 153, 153);

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

@ -2,9 +2,9 @@ package com.fr.design.foldablepane;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import javax.swing.JPanel;
/** /**
* Created by MoMeak on 2017/7/5. * Created by MoMeak on 2017/7/5.
@ -18,24 +18,24 @@ public class HeaderPane extends JPanel {
private String title; private String title;
private Image image; private Image image;
private int fontSize = 13; private int fontSize = 13;
public void setShow(boolean isShow) { public void setShow(boolean isShow) {
this.isShow = isShow; this.isShow = isShow;
} }
public void setTitle(String title) public void setTitle(String title) {
{
this.title = title; this.title = title;
} }
public void setHeadWidth(int headwidth){ public void setHeadWidth(int headwidth) {
this.headWidth = headwidth; this.headWidth = headwidth;
} }
public void setheadHeight(int headHeight){ public void setheadHeight(int headHeight) {
this.headHeight = headHeight; this.headHeight = headHeight;
} }
public void setFontSize(int fontSize){ public void setFontSize(int fontSize) {
this.fontSize = fontSize; this.fontSize = fontSize;
} }
@ -58,16 +58,13 @@ public class HeaderPane extends JPanel {
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/3); g2d.drawString(this.title, 0, headHeight - fontSize / 2 - 1);
if(this.isShow) if (this.isShow) {
{
image = UIConstants.DRAG_DOWN_PRESS; image = UIConstants.DRAG_DOWN_PRESS;
g2d.drawImage(image, title.length() * fontSize, headHeight/2-1, null); g2d.drawImage(image, title.length() * fontSize, headHeight / 2 - 1, null);
} } else {
else
{
image = UIConstants.DRAG_RIGHT_PRESS; image = UIConstants.DRAG_RIGHT_PRESS;
g2d.drawImage(image, title.length() * fontSize, headHeight/3, null); g2d.drawImage(image, title.length() * fontSize, headHeight / 3, null);
} }
@ -90,18 +87,17 @@ public class HeaderPane extends JPanel {
} }
public HeaderPane(Color bgColor, String title , int headWidth, int headHeight) { public HeaderPane(Color bgColor, String title, int headWidth, int headHeight) {
this(bgColor); this(bgColor);
this.title = title; this.title = title;
this.headHeight = headHeight; this.headHeight = headHeight;
this.headWidth = headWidth; this.headWidth = headWidth;
} }
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,25), 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(280, 400);

62
designer_base/src/com/fr/design/gui/controlpane/ObjectUIControlPane.java

@ -0,0 +1,62 @@
package com.fr.design.gui.controlpane;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import com.fr.design.beans.BasicBeanPane;
/**
* Created by plough on 2017/8/1.
*/
public abstract class ObjectUIControlPane extends UIListControlPane {
private Object object;
public ObjectUIControlPane() {
this(null);
}
public ObjectUIControlPane(Object object) {
super();
this.object = object;
}
@Override
protected BasicBeanPane createPaneByCreators(NameableCreator creator) {
try {
if (object == null) {
return super.createPaneByCreators(creator);
} else if (object.getClass().isArray()) {
return creator.getUpdatePane().getConstructor(object.getClass()).newInstance(object);
} else {
Constructor<? extends BasicBeanPane> constructor = getConstructor(creator.getUpdatePane(), object.getClass());
return constructor == null ? super.createPaneByCreators(creator) : constructor.newInstance(object);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 传进BasicBeanPane的构造函数的参数可能是
*
* @param clazz
* @param cls
* @return
*/
private Constructor<? extends BasicBeanPane> getConstructor(Class<? extends BasicBeanPane> clazz, Class<?> cls) {
Constructor<? extends BasicBeanPane> constructor = null;
try {
constructor = clazz.getConstructor(cls);
} catch (SecurityException e) {
} catch (NoSuchMethodException e) {
}
if (constructor != null) {
return constructor;
} else {
if (cls.getName() == Object.class.getName()) {
return null;
}
return getConstructor(clazz, cls.getSuperclass());
}
}
}

30
designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java

@ -2,6 +2,7 @@ package com.fr.design.gui.controlpane;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itoolbar.UIToolBarUI;
import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
@ -28,6 +29,7 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
private ToolBarDef toolbarDef; private ToolBarDef toolbarDef;
private UIToolbar toolBar; private UIToolbar toolBar;
private UIToolbar topToolBar;
protected PopupEditDialog popupEditDialog; protected PopupEditDialog popupEditDialog;
// peter:这是整体的一个cardLayout Pane // peter:这是整体的一个cardLayout Pane
protected CardLayout cardLayout; protected CardLayout cardLayout;
@ -111,7 +113,7 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
// mainSplitPane.setOneTouchExpandable(true); // mainSplitPane.setOneTouchExpandable(true);
this.add(getLeftPane(), BorderLayout.CENTER); this.add(getLeftPane(), BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(0, 10, 12, 10)); this.setBorder(BorderFactory.createEmptyBorder(10, 10, 12, 10));
// mainSplitPane.setDividerLocation(getLeftPreferredSize()); // mainSplitPane.setDividerLocation(getLeftPreferredSize());
this.checkButtonEnabled(); this.checkButtonEnabled();
} }
@ -136,17 +138,23 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
toolbarDef.addShortCut(sj.getShortCut()); toolbarDef.addShortCut(sj.getShortCut());
} }
toolBar = ToolBarDef.createJToolBar(); toolBar = ToolBarDef.createJToolBar();
// toolBar.setLayout(new FlowLayout(FlowLayout.LEFT)); toolBar.setUI(new UIToolBarUI(){
@Override
public void paint(Graphics g, JComponent c) {
Graphics2D g2 = (Graphics2D) g;
g2.setColor(Color.white);
g2.fillRect(0, 0, c.getWidth(), c.getHeight());
}
});
toolbarDef.updateToolBar(toolBar); toolbarDef.updateToolBar(toolBar);
// 封装一层,加边框 // 封装一层,加边框
JPanel toolBarPane = new JPanel(new BorderLayout()); JPanel toolBarPane = new JPanel(new BorderLayout());
toolBarPane.add(toolBar, BorderLayout.CENTER); toolBarPane.add(toolBar, BorderLayout.CENTER);
toolBarPane.setBorder(BorderFactory.createMatteBorder(1, 1, 0, 1, new Color(201, 198, 184))); toolBarPane.setBorder(BorderFactory.createMatteBorder(1, 1, 0, 1, new Color(201, 198, 184)));
leftContentPane.add(toolBarPane, BorderLayout.NORTH); leftContentPane.add(toolBarPane, BorderLayout.NORTH);
// leftContentPane.setBorder(BorderFactory.createLineBorder(new Color(201, 198, 184)));
// 顶部标签及add按钮 // 顶部标签及add按钮
UIToolbar topToolBar = new UIToolbar(); topToolBar = new UIToolbar();
topToolBar.setLayout(new BorderLayout()); topToolBar.setLayout(new BorderLayout());
ShortCut addItem = addItemShortCut().getShortCut(); ShortCut addItem = addItemShortCut().getShortCut();
addItem.intoJToolBar(topToolBar); addItem.intoJToolBar(topToolBar);
@ -246,19 +254,27 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
toolbarDef.updateToolBar(toolBar); toolbarDef.updateToolBar(toolBar);
toolBar.validate(); toolBar.validate();
toolBar.repaint(); toolBar.repaint();
// 顶部按钮
topToolBar.removeAll();
ShortCut addItem = addItemShortCut().getShortCut();
addItem.intoJToolBar(topToolBar);
topToolBar.validate();
this.repaint(); this.repaint();
} }
// 点击"编辑"按钮,弹出面板 // 点击"编辑"按钮,弹出面板
protected class PopupEditDialog extends JDialog { protected class PopupEditDialog extends JDialog {
private JComponent editPane; private JComponent editPane;
private static final int WIDTH = 490; private static final int WIDTH = 570;
private static final int HEIGHT = 570; private static final int HEIGHT = 490;
PopupEditDialog(JComponent pane) { PopupEditDialog(JComponent pane) {
super(DesignerContext.getDesignerFrame()); super(DesignerContext.getDesignerFrame());
setUndecorated(true); setUndecorated(true);
pane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); pane.setBorder(BorderFactory.createEmptyBorder(20, 10, 10, 10));
this.editPane = pane; this.editPane = pane;
this.getContentPane().add(editPane, BorderLayout.CENTER); this.getContentPane().add(editPane, BorderLayout.CENTER);
setSize(WIDTH, HEIGHT); setSize(WIDTH, HEIGHT);

2
designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java

@ -210,7 +210,7 @@ public abstract class UIListControlPane extends UIControlPane {
listModel.addElement(new ListModelElement(aNameableArray)); listModel.addElement(new ListModelElement(aNameableArray));
} }
if (listModel.size() > 0) { if (listModel.size() > 0 || this.nameableList.getSelectedIndex() != 0) {
this.nameableList.setSelectedIndex(0); this.nameableList.setSelectedIndex(0);
} }
this.checkButtonEnabled(); this.checkButtonEnabled();

39
designer_base/src/com/fr/design/gui/controlpane/UINameableListCellRenderer.java

@ -1,6 +1,7 @@
package com.fr.design.gui.controlpane; package com.fr.design.gui.controlpane;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ListModelElement;
@ -31,6 +32,7 @@ public class UINameableListCellRenderer extends
private UILabel editButton; // "编辑按钮",实际上是一个 UILabel,由列表项(UIListControlPane)统一处理点击事件 private UILabel editButton; // "编辑按钮",实际上是一个 UILabel,由列表项(UIListControlPane)统一处理点击事件
private UILabel label; private UILabel label;
private UIListControlPane listControlPane; private UIListControlPane listControlPane;
private Color initialLabelForeground;
public UINameableListCellRenderer(UIListControlPane listControlPane) { public UINameableListCellRenderer(UIListControlPane listControlPane) {
super(); super();
@ -47,39 +49,19 @@ public class UINameableListCellRenderer extends
return new Dimension(BUTTON_WIDTH, BUTTON_WIDTH); return new Dimension(BUTTON_WIDTH, BUTTON_WIDTH);
} }
}; };
// editButton.set4LargeToolbarButton(); editButton.setIcon(UIConstants.LIST_EDIT_ICON);
editButton.setIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png"));
editButton.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, BORDER_COLOR)); editButton.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, BORDER_COLOR));
editButton.setHorizontalAlignment(SwingConstants.CENTER); editButton.setHorizontalAlignment(SwingConstants.CENTER);
// editButton.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent e) {
// popupEditDialog();
// }
// });
label = new UILabel(); label = new UILabel();
label.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); label.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
// label.setEditable(false); initialLabelForeground = label.getForeground();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(editButton, BorderLayout.WEST); this.add(editButton, BorderLayout.WEST);
this.add(label, BorderLayout.CENTER); this.add(label, BorderLayout.CENTER);
} }
private Border getNoFocusBorder() { private Border getNoFocusBorder() {
// return BorderFactory.createLineBorder(new Color(201, 198, 184));
return BorderFactory.createMatteBorder(0, 0, 1, 0, BORDER_COLOR); return BorderFactory.createMatteBorder(0, 0, 1, 0, BORDER_COLOR);
// Border border = DefaultLookup.getBorder(this, ui, "List.cellNoFocusBorder");
// if (System.getSecurityManager() != null) {
// if (border != null) return border;
// return SAFE_NO_FOCUS_BORDER;
// } else {
// if (border != null &&
// (noFocusBorder == null ||
// noFocusBorder == DEFAULT_NO_FOCUS_BORDER)) {
// return border;
// }
// return noFocusBorder;
// }
} }
private void setText(String t) { private void setText(String t) {
@ -108,20 +90,17 @@ public class UINameableListCellRenderer extends
if (isSelected) { if (isSelected) {
setBackground(bg == null ? list.getSelectionBackground() : bg); setBackground(bg == null ? list.getSelectionBackground() : bg);
setForeground(fg == null ? list.getSelectionForeground() : fg); setForeground(fg == null ? list.getSelectionForeground() : fg);
label.setForeground(Color.white);
editButton.setIcon(UIConstants.LIST_EDIT_WHITE_ICON);
} }
else { else {
setBackground(list.getBackground()); setBackground(list.getBackground());
setForeground(list.getForeground()); setForeground(list.getForeground());
label.setForeground(initialLabelForeground);
editButton.setIcon(UIConstants.LIST_EDIT_ICON);
} }
// if (value instanceof Icon) { setText((value == null) ? "" : value.toString());
// setIcon((Icon)value);
// setText("");
// }
// else {
// setIcon(null);
setText((value == null) ? "" : value.toString());
// }
setEnabled(list.isEnabled()); setEnabled(list.isEnabled());
setFont(list.getFont()); setFont(list.getFont());

1
designer_base/src/com/fr/design/gui/ibutton/UIButton.java

@ -135,6 +135,7 @@ public class UIButton extends JButton implements UIObserver {
private void init() { private void init() {
setOpaque(false);
setBackground(null); setBackground(null);
setRolloverEnabled(true); setRolloverEnabled(true);
initListener(); initListener();

7
designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java

@ -20,7 +20,7 @@ public class UIEastResizableContainer extends JPanel {
private static final long serialVersionUID = 1854340560790476907L; private static final long serialVersionUID = 1854340560790476907L;
private int containerWidth = 240; private int containerWidth = 240;
private int preferredWidth = 240; private int preferredWidth = 240;
private int topToolPaneHeight = 20; private int topToolPaneHeight = 25;
private int leftPaneWidth = 40; private int leftPaneWidth = 40;
private JComponent leftPane; private JComponent leftPane;
@ -63,11 +63,12 @@ public class UIEastResizableContainer extends JPanel {
} }
public UIEastResizableContainer(JComponent leftPane, JComponent rightPane) { public UIEastResizableContainer(JComponent leftPane, JComponent rightPane) {
setBackground(UIConstants.NORMAL_BACKGROUND); setBackground(UIConstants.PROPERTY_PANE_BACKGROUND);
this.leftPane = leftPane; this.leftPane = leftPane;
this.rightPane = rightPane; this.rightPane = rightPane;
this.topToolPane = new TopToolPane(); this.topToolPane = new TopToolPane();
topToolPane.setBackground(UIConstants.PROPERTY_PANE_BACKGROUND);
setLayout(containerLayout); setLayout(containerLayout);
add(topToolPane); add(topToolPane);
@ -307,7 +308,7 @@ public class UIEastResizableContainer extends JPanel {
} }
} }
// g.drawImage(button, 2, ARROW_MARGIN_VERTICAL, 5, toolPaneHeight, null); // g.drawImage(button, 2, ARROW_MARGIN_VERTICAL, 5, toolPaneHeight, null);
g.drawImage(button, 18, 7, 5, 5, null); g.drawImage(button, 18, 9, 5, 5, null);
} }
} }

4
designer_base/src/com/fr/design/gui/style/AlignmentPane.java

@ -164,8 +164,8 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO
JPanel jp1 = new JPanel(new BorderLayout()); JPanel jp1 = 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, 20, basicPane()); basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 290, 24, basicPane());
seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 290, 20, seniorPane()); seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 290, 24, seniorPane());
jp1.add(basicPane, BorderLayout.NORTH); jp1.add(basicPane, BorderLayout.NORTH);
jp1.add(seniorPane, BorderLayout.CENTER); jp1.add(seniorPane, BorderLayout.CENTER);

4
designer_base/src/com/fr/design/gui/style/BorderPane.java

@ -94,11 +94,11 @@ public class BorderPane extends AbstractBasicStylePane {
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM);
borderPanel = new UIExpandablePane(Inter.getLocText("FR-Designer_Border"), 280, 20, panel); borderPanel = new UIExpandablePane(Inter.getLocText("FR-Designer_Border"), 280, 24, panel);
this.add(borderPanel, BorderLayout.NORTH); this.add(borderPanel, BorderLayout.NORTH);
backgroundPane = new BackgroundPane(); backgroundPane = new BackgroundPane();
backgroundPanel = new UIExpandablePane(Inter.getLocText("FR-Designer_Background"), 280, 20, backgroundPane); backgroundPanel = new UIExpandablePane(Inter.getLocText("FR-Designer_Background"), 280, 24, backgroundPane);
this.add(backgroundPanel, BorderLayout.CENTER); this.add(backgroundPanel, BorderLayout.CENTER);
outerToggleButton.addChangeListener(outerToggleButtonChangeListener); outerToggleButton.addChangeListener(outerToggleButtonChangeListener);

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

BIN
designer_base/src/com/fr/design/images/data/source/hoverDown.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

BIN
designer_base/src/com/fr/design/images/data/source/hoverDown20.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

BIN
designer_base/src/com/fr/design/images/data/source/hoverDown@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

BIN
designer_base/src/com/fr/design/images/data/source/hoverUp20.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

BIN
designer_base/src/com/fr/design/images/data/source/normalDown.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

BIN
designer_base/src/com/fr/design/images/data/source/normalDown20.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

BIN
designer_base/src/com/fr/design/images/data/source/normalDown@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

BIN
designer_base/src/com/fr/design/images/data/source/normalUp20.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

BIN
designer_base/src/com/fr/design/images/data/source/scaleDown.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

BIN
designer_base/src/com/fr/design/images/data/source/scaleUp.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

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

@ -2092,16 +2092,16 @@ FR-Designer_CellWrite_Show_As_HTML=CellWrite_Show_As_HTML
FR-Designer_Datasource_Other_Attributes=Other_Attributes FR-Designer_Datasource_Other_Attributes=Other_Attributes
FR-Designer_Not_use_a_cell_attribute_table_editing=Not_use_a_cell_attribute_table_editing FR-Designer_Not_use_a_cell_attribute_table_editing=Not_use_a_cell_attribute_table_editing
FR-Designer_CellElement_Property_Table=CellElement_Property_Table FR-Designer_CellElement_Property_Table=CellElement_Property_Table
FR-Designer_Add_Condition=Add Condition
FR-Designer_Use_Params_Template=
FR-Designer_Label_Name=
FR-Designer_T_Insert_Float=Insert_Float FR-Designer_T_Insert_Float=Insert_Float
FR-Designer_Add_FloatElement=Add_FloatElement FR-Designer_Add_FloatElement=Add_FloatElement
FR-Designer_Insert_Image=Insert_Image FR-Designer_Insert_Image=Insert_Image
FR-Designer_Insert-Chart=Insert-Chart
FR-Designer_Insert-Text=Insert-Text
FR-Designer_Insert_Formula=Insert_Formula FR-Designer_Insert_Formula=Insert_Formula
FR-Designer_Scale_Down=Scale_Down
FR-Designer_Insert_Chart= FR-Designer_Scale_Up=Scale_Up
FR-Designer_Insert_Text= FR-Designer_Scale_Slider=Scale_Slider
FR-Designer_Double= FR-Designer_Scale_Grade=Scale_Grade
FR-Designer_Insert_Chart=Insert_Chart
FR-Designer_Insert_Text=Insert_Text
FR-Designer_Double=Double
FR-Designer_Add_Event=Add Event
FR-Designer_Not_Support_Authority_Edit=this element does not support authority edit

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

@ -2093,16 +2093,16 @@ FR-Designer_CellWrite_Show_As_HTML=CellWrite_Show_As_HTML
FR-Designer_Datasource_Other_Attributes=Other_Attributes FR-Designer_Datasource_Other_Attributes=Other_Attributes
FR-Designer_Not_use_a_cell_attribute_table_editing=Not_use_a_cell_attribute_table_editing FR-Designer_Not_use_a_cell_attribute_table_editing=Not_use_a_cell_attribute_table_editing
FR-Designer_CellElement_Property_Table=CellElement_Property_Table FR-Designer_CellElement_Property_Table=CellElement_Property_Table
FR-Designer_Add_Condition=Add Condition
FR-Designer_Use_Params_Template=use parameter template
FR-Designer_Label_Name=label name
FR-Designer_T_Insert_Float=Insert_Float FR-Designer_T_Insert_Float=Insert_Float
FR-Designer_Add_FloatElement=Add_FloatElement FR-Designer_Add_FloatElement=Add_FloatElement
FR-Designer_Insert_Image=Insert_Image FR-Designer_Insert_Image=Insert_Image
FR-Designer_Insert_Chart=Insert-Chart FR-Designer_Insert_Chart=Insert-Chart
FR-Designer_Insert_Text=Insert-Text FR-Designer_Insert_Text=Insert-Text
FR-Designer_Insert_Formula=Insert_Formula FR-Designer_Insert_Formula=Insert_Formula
FR-Designer_Double=Double
FR-Designer_Insert-Chart= FR-Designer_Scale_Down=Scale_Down
FR-Designer_Insert-Text= FR-Designer_Scale_Up=Scale_Up
FR-Designer_Double= FR-Designer_Scale_Slider=Scale_Slider
FR-Designer_Scale_Grade=Scale_Grade
FR-Designer_Add_Event=Add Event
FR-Designer_Not_Support_Authority_Edit=this element does not support authority edit

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

@ -1982,6 +1982,7 @@ FR-Base_UnSignIn=\ \u672A\u30ED\u30B0\u30A4\u30F3
Every=\u6BCE Every=\u6BCE
CellWrite-Preview_Cell_Content=\u30BB\u30EB\u5185\u5BB9 CellWrite-Preview_Cell_Content=\u30BB\u30EB\u5185\u5BB9
FormulaD-Data_Fields=\u30C7\u30FC\u30BF\u30D5\u30A3\u30FC\u30EB\u30C9 FormulaD-Data_Fields=\u30C7\u30FC\u30BF\u30D5\u30A3\u30FC\u30EB\u30C9
FormulaD-Data_Fields=\u30C7\u30FC\u30BF\u30D5\u30A3\u30FC\u30EB\u30C9
FR-Designer_Permissions=\u6A29\u9650 FR-Designer_Permissions=\u6A29\u9650
FR-Designer_Form_Button=\u30DC\u30BF\u30F3 FR-Designer_Form_Button=\u30DC\u30BF\u30F3
FR-Designer_WF_Name=\u540D FR-Designer_WF_Name=\u540D
@ -2074,13 +2075,15 @@ FR-Designer_CellWrite_Show_As_HTML=
FR-Designer_Datasource_Other_Attributes= FR-Designer_Datasource_Other_Attributes=
FR-Designer_Not_use_a_cell_attribute_table_editing= FR-Designer_Not_use_a_cell_attribute_table_editing=
FR-Designer_CellElement_Property_Table= FR-Designer_CellElement_Property_Table=
FR-Designer_Add_Condition=
FR-Designer_T_Insert_Float= FR-Designer_T_Insert_Float=
FR-Designer_Add_FloatElement= FR-Designer_Add_FloatElement=
FR-Designer_Insert_Image= FR-Designer_Insert_Image=
FR-Designer_Insert_Chart= FR-Designer_Insert_Chart=
FR-Designer_Insert_Text= FR-Designer_Insert_Text=
FR-Designer_Scale_Down=
FR-Designer_Scale_Up=
FR-Designer_Scale_Slider=
FR-Designer_Scale_Grade=
FR-Designer_AlphaFine_Enable= FR-Designer_AlphaFine_Enable=
FR-Designer_AlphaFine_EnableAlphaFine= FR-Designer_AlphaFine_EnableAlphaFine=
FR-Designer_AlphaFine_EnableInternet= FR-Designer_AlphaFine_EnableInternet=
@ -2104,6 +2107,5 @@ FR-Designer_Write_Enhance_Preview=
FR-Designer-StyleAlignment_Style_PartSpacing= FR-Designer-StyleAlignment_Style_PartSpacing=
FR-Designer_Use_Params_Template= FR-Designer_Use_Params_Template=
FR-Designer_Label_Name= FR-Designer_Label_Name=
FR-Designer_Insert-Chart=
FR-Designer_Insert-Text=
FR-Designer_Insert_Formula= FR-Designer_Insert_Formula=
FR-Designer_Not_Support_Authority_Edit=\u3053\u306E\u8981\u7D20\u306F\u6A29\u9650\u5236\u5FA1\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093

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

@ -1995,7 +1995,7 @@ FR-Designer_Parameter=\uB9E4\uAC1C\uBCC0\uC218
FR-Designer-Plugin_Plugin=\uD50C\uB7EC\uADF8\uC778 FR-Designer-Plugin_Plugin=\uD50C\uB7EC\uADF8\uC778
FR-Designer_Background=\uBC30\uACBD FR-Designer_Background=\uBC30\uACBD
Template=\uD15C\uD50C\uB9BF Template=\uD15C\uD50C\uB9BF
FR-Designer_Double=\uC18C\uC218
FR-Designer_Original_Marked_Filed=\uCD08\uAE30\uD0DC\uADF8\uD544\uB4DC FR-Designer_Original_Marked_Filed=\uCD08\uAE30\uD0DC\uADF8\uD544\uB4DC
FR-Designer_Build_Tree_Accord_Marked_Filed_Length=\uC120\uD0DD\uD55C\uB370\uC774\uD130\uC138\uD2B8\uC758\uD0DC\uADF8\uD544\uB4DC\uAE38\uC774\uC5D0\uB530\uB77C\uD2B8\uB9AC\uC0DD\uC131 FR-Designer_Build_Tree_Accord_Marked_Filed_Length=\uC120\uD0DD\uD55C\uB370\uC774\uD130\uC138\uD2B8\uC758\uD0DC\uADF8\uD544\uB4DC\uAE38\uC774\uC5D0\uB530\uB77C\uD2B8\uB9AC\uC0DD\uC131
FR-Designer_Tree_Data_Field=\uD2B8\uB9AC\uB370\uC774\uD130\uD544\uB4DC FR-Designer_Tree_Data_Field=\uD2B8\uB9AC\uB370\uC774\uD130\uD544\uB4DC
@ -2073,14 +2073,16 @@ FR-Designer_CellWrite_Show_As_HTML=
FR-Designer_Datasource_Other_Attributes= FR-Designer_Datasource_Other_Attributes=
FR-Designer_Not_use_a_cell_attribute_table_editing= FR-Designer_Not_use_a_cell_attribute_table_editing=
FR-Designer_CellElement_Property_Table= FR-Designer_CellElement_Property_Table=
FR-Designer_Add_Condition=
FR-Designer_T_Insert_Float= FR-Designer_T_Insert_Float=
FR-Designer_Add_FloatElement= FR-Designer_Add_FloatElement=
FR-Designer_Insert_Image= FR-Designer_Insert_Image=
FR-Designer_Insert_Chart= FR-Designer_Insert_Chart=
FR-Designer_Insert_Text= FR-Designer_Insert_Text=
FR-Designer_Insert_Formula= FR-Designer_Insert_Formula=
FR-Designer_Scale_Down=
FR-Designer_Scale_Up=
FR-Designer_Scale_Slider=
FR-Designer_Scale_Grade=
FR-Designer_AlphaFine_Enable= FR-Designer_AlphaFine_Enable=
FR-Designer_AlphaFine_EnableAlphaFine= FR-Designer_AlphaFine_EnableAlphaFine=
FR-Designer_AlphaFine_EnableInternet= FR-Designer_AlphaFine_EnableInternet=
@ -2105,5 +2107,5 @@ FR-Designer_Scale_customButton=
FR-Designer-StyleAlignment_Style_PartSpacing= FR-Designer-StyleAlignment_Style_PartSpacing=
FR-Designer_Use_Params_Template= FR-Designer_Use_Params_Template=
FR-Designer_Label_Name= FR-Designer_Label_Name=
FR-Designer_Insert-Chart= FR-Designer_Add_Event=
FR-Designer_Insert-Text= FR-Designer_Not_Support_Authority_Edit=\uD574\uB2F9\uC694\uC18C\uB294\uAD8C\uD55C\uCEE8\uD2B8\uB864\uC744\uC9C0\uC6D0\uD558\uC9C0\uC54A\uC2B5\uB2C8\uB2E4.

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

@ -2101,3 +2101,14 @@ FR-Designer_Insert_Image=\u63D2\u5165\u56FE\u7247
FR-Designer_Insert_Chart=\u63D2\u5165\u56FE\u8868 FR-Designer_Insert_Chart=\u63D2\u5165\u56FE\u8868
FR-Designer_Insert_Text=\u63D2\u5165\u666E\u901A\u6587\u672C FR-Designer_Insert_Text=\u63D2\u5165\u666E\u901A\u6587\u672C
FR-Designer_Insert_Formula=\u63D2\u5165\u516C\u5F0F FR-Designer_Insert_Formula=\u63D2\u5165\u516C\u5F0F
FR-Designer_Add_Event=\u6DFB\u52A0\u4E8B\u4EF6
FR-Designer_Cell_Visible=\u5355\u5143\u683C\u53EF\u89C1
FR-Designer_Float_Visible=\u60AC\u6D6E\u5143\u7D20\u53EF\u89C1
FR-Designer_Cell_Value=\u5355\u5143\u683C\u503C
FR-Designer_Widget_Visible=\u63A7\u4EF6\u53EF\u89C1
FR-Designer_Widget_Enabled=\u63A7\u4EF6\u53EF\u7528
FR-Designer_Scale_Down=\u7F29\u5C0F
FR-Designer_Scale_Up=\u653E\u5927
FR-Designer_Scale_Slider=\u7F29\u653E\u6ED1\u5757
FR-Designer_Scale_Grade=\u7F29\u653E\u7EA7\u522B\uFF0C\u5355\u51FB\u540E\u8C03\u8282\u663E\u793A\u6BD4\u4F8B\u3002
FR-Designer_Not_Support_Authority_Edit=\u8BE5\u5143\u7D20\u4E0D\u652F\u6301\u6743\u9650\u63A7\u5236

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

@ -2092,18 +2092,20 @@ FR-Designer_CellWrite_Show_As_HTML=
FR-Designer_Datasource_Other_Attributes= FR-Designer_Datasource_Other_Attributes=
FR-Designer_Not_use_a_cell_attribute_table_editing= FR-Designer_Not_use_a_cell_attribute_table_editing=
FR-Designer_CellElement_Property_Table= FR-Designer_CellElement_Property_Table=
FR-Designer_Add_Condition=
FR-Designer_T_Insert_Float= FR-Designer_T_Insert_Float=
FR-Designer_Add_FloatElement= FR-Designer_Add_FloatElement=
FR-Designer_Insert_Image= FR-Designer_Insert_Image=
FR-Designer_Insert_Chart= FR-Designer_Insert_Chart=
FR-Designer_Insert_Text= FR-Designer_Insert_Text=
FR-Designer_Insert_Formula= FR-Designer_Insert_Formula=
FR-Designer_Scale_Down=
FR-Designer_Scale_Up=
FR-Designer_Scale_Slider=
FR-Designer_Scale_Grade=
FR-Designer_AlphaFine_EnableInternet= FR-Designer_AlphaFine_EnableInternet=
FR-Designer_Scale_EnlargeOrReduce= FR-Designer_Scale_EnlargeOrReduce=
FR-Designer-StyleAlignment_Style_PartSpacing= FR-Designer-StyleAlignment_Style_PartSpacing=
FR-Designer_Use_Params_Template= FR-Designer_Use_Params_Template=
FR-Designer_Label_Name= FR-Designer_Label_Name=
FR-Designer_Insert-Chart= FR-Designer_Add_Event=
FR-Designer_Insert-Text= FR-Designer_Not_Support_Authority_Edit=\u8A72\u5143\u7D20\u4E0D\u652F\u63F4\u8A31\u53EF\u6B0A\u63A7\u5236

86
designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java

@ -1 +1,85 @@
package com.fr.design.mainframe; import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.TargetComponent; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : daisy * Date: 13-9-12 * Time: 下午6:21 */ public abstract class AuthorityEditPane extends JPanel { protected static final int TOP_GAP = 11; protected static final int LEFT_GAP = 8; protected static final int ALIGNMENT_GAP = -3; protected UILabel type = null; protected UILabel name = null; protected JPanel checkPane = null; private TargetComponent target; public AuthorityEditPane(TargetComponent target) { this.target = target; setLayout(new BorderLayout()); type = new UILabel(); name = new UILabel(); checkPane = new JPanel(); checkPane.setLayout(new BorderLayout()); this.add(layoutText(), BorderLayout.WEST); this.add(layoutPane(), BorderLayout.CENTER); this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, 0)); } private JPanel layoutText() { double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ new Component[]{new UILabel(Inter.getLocText("Type") + ":", SwingConstants.RIGHT)}, new Component[]{new UILabel(Inter.getLocText("WF-Name") + ":", SwingConstants.RIGHT)}, new Component[]{new UILabel(Inter.getLocText("DashBoard-Potence") + ":", SwingConstants.RIGHT)}, }; double[] rowSize = {p, p, p}; double[] columnSize = {p}; int[][] rowCount = {{1}, {1}, {1}}; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); } private JPanel layoutPane() { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ new Component[]{type}, new Component[]{name}, new Component[]{checkPane}, }; double[] rowSize = {p, p, p}; double[] columnSize = {f}; int[][] rowCount = {{1}, {1}, {1}}; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); } /** * 更新权限编辑面板的具体内容:类型、名称、权限面板 */ public void populateDetials() { populateType(); populateName(); checkPane.removeAll(); populateCheckPane(); checkPane.setBorder(BorderFactory.createEmptyBorder(ALIGNMENT_GAP, 0, 0, 0)); } public abstract void populateType(); public abstract void populateName(); public abstract JPanel populateCheckPane(); } package com.fr.design.mainframe;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.TargetComponent;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Author : daisy
* Date: 13-9-12
* Time: 下午6:21
*/
public abstract class AuthorityEditPane extends JPanel {
protected static final int TOP_GAP = 11;
protected static final int LEFT_GAP = 4;
protected static final int RIGHT_GAP = 10;
protected static final int ALIGNMENT_GAP = -3;
protected static final int LEFT_CHECKPANE = 3;
protected UILabel type = null;
protected UILabel name = null;
protected JPanel checkPane = null;
private TargetComponent target;
private JPanel typePane;
private JPanel namePane;
public AuthorityEditPane(TargetComponent target) {
this.target = target;
setLayout(new BorderLayout());
type = new UILabel();
typePane = new JPanel(new BorderLayout());
typePane.add(type, BorderLayout.CENTER);
type.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0));
typePane.setBorder(BorderFactory.createLineBorder(Color.lightGray));
name = new UILabel();
namePane = new JPanel(new BorderLayout());
namePane.add(name, BorderLayout.CENTER);
name.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0));
namePane.setBorder(BorderFactory.createLineBorder(Color.lightGray));
checkPane = new JPanel();
checkPane.setLayout(new BorderLayout());
// this.add(layoutText(), BorderLayout.WEST);
// this.add(layoutPane(), BorderLayout.CENTER);
this.add(centerPane(), BorderLayout.NORTH);
this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, RIGHT_GAP));
}
private JPanel centerPane() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), typePane},
new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), namePane},
new Component[]{checkPane, null},
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM);
}
/**
* 更新权限编辑面板的具体内容类型名称权限面板
*/
public void populateDetials() {
populateType();
populateName();
checkPane.removeAll();
populateCheckPane();
checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
}
public abstract void populateType();
public abstract void populateName();
public abstract JPanel populateCheckPane();
}

50
designer_base/src/com/fr/design/mainframe/AuthorityPropertyPane.java

@ -1 +1,49 @@
package com.fr.design.mainframe; import com.fr.design.constants.UIConstants; import com.fr.design.designer.TargetComponent; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : daisy * Date: 13-9-12 * Time: 下午6:14 */ public class AuthorityPropertyPane extends JPanel { private static final int TITLE_HEIGHT = 19; private AuthorityEditPane authorityEditPane = null; public AuthorityPropertyPane(TargetComponent t) { this.setLayout(new BorderLayout()); this.setBorder(null); UILabel authorityTitle = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) { @Override public Dimension getPreferredSize() { return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT); } }; authorityTitle.setHorizontalAlignment(SwingConstants.CENTER); authorityTitle.setVerticalAlignment(SwingConstants.CENTER); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(authorityTitle, BorderLayout.CENTER); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); this.add(northPane, BorderLayout.NORTH); authorityEditPane = t.createAuthorityEditPane(); UIScrollPane scrollPane = new UIScrollPane(authorityEditPane); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); this.add(scrollPane, BorderLayout.CENTER); } public void populate() { authorityEditPane.populateDetials(); } } package com.fr.design.mainframe;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.TargetComponent;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Author : daisy
* Date: 13-9-12
* Time: 下午6:14
*/
public class AuthorityPropertyPane extends JPanel {
private static final int TITLE_HEIGHT = 19;
private AuthorityEditPane authorityEditPane = null;
public AuthorityPropertyPane(TargetComponent t) {
this.setLayout(new BorderLayout());
this.setBorder(null);
UILabel authorityTitle = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) {
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT);
}
};
authorityTitle.setHorizontalAlignment(SwingConstants.CENTER);
authorityTitle.setVerticalAlignment(SwingConstants.CENTER);
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.add(authorityTitle, BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR));
// this.add(northPane, BorderLayout.NORTH);
authorityEditPane = t.createAuthorityEditPane();
UIScrollPane scrollPane = new UIScrollPane(authorityEditPane);
scrollPane.setBorder(null);
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
this.add(scrollPane, BorderLayout.CENTER);
}
public void populate() {
authorityEditPane.populateDetials();
}
}

112
designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

@ -28,12 +28,17 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private JPanel leftPane; private JPanel leftPane;
private JPanel rightPane; private JPanel rightPane;
private FixedPopupPane currentPopupPane; private FixedPopupPane currentPopupPane;
private static final int CONTAINER_WIDTH = 290; private static final int CONTAINER_WIDTH = 288;
private static final int TAB_WIDTH = 40; private static final int TAB_WIDTH = 38;
private static final int TAB_BUTTON_WIDTH = 32; private static final int TAB_BUTTON_WIDTH = 32;
private static final int TAB_BUTTON_HEIGHT = 28;
private static final int CONTENT_WIDTH = CONTAINER_WIDTH - TAB_WIDTH; private static final int CONTENT_WIDTH = CONTAINER_WIDTH - TAB_WIDTH;
private static final int POPUP_TOOLPANE_HEIGHT = 25; private static final int POPUP_TOOLPANE_HEIGHT = 25;
private static final int ARROW_RANGE_START = CONTENT_WIDTH - 30; private static final int ARROW_RANGE_START = CONTENT_WIDTH - 30;
// 弹出对话框高度
private static final int POPUP_MIN_HEIGHT = 145;
private static final int POPUP_MAX_HEIGHT = 480;
private static final int POPUP_DEFAULT_HEIGHT = 360;
private static final String KEY_CELL_ELEMENT = "cellElement"; private static final String KEY_CELL_ELEMENT = "cellElement";
private static final String KEY_CELL_ATTR = "cellAttr"; private static final String KEY_CELL_ATTR = "cellAttr";
private static final String KEY_FLOAT_ELEMENT = "floatElement"; private static final String KEY_FLOAT_ELEMENT = "floatElement";
@ -43,7 +48,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private static final String KEY_WIDGET_LIB = "widgetLib"; private static final String KEY_WIDGET_LIB = "widgetLib";
private static final String KEY_AUTHORITY_EDITION = "authorityEdition"; private static final String KEY_AUTHORITY_EDITION = "authorityEdition";
private static final String KEY_CONFIGURED_ROLES = "editedRoles"; private static final String KEY_CONFIGURED_ROLES = "editedRoles";
private static final String DEFAULT_PANE = "defaultPane"; // "无可用配置项"面板 private static final String DEFAULT_PANE = "defaultPane";
private static final String DEFAULT_AUTHORITY_PANE = "defaultAuthorityPane";
private JPanel defaultPane; // "无可用配置项"面板
private JPanel defaultAuthorityPane; // "该元素不支持权限编辑"
public enum PropertyMode { public enum PropertyMode {
REPORT, // 报表 REPORT, // 报表
@ -54,7 +63,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
POLY, // 聚合报表 POLY, // 聚合报表
POLY_REPORT, // 聚合报表-报表块 POLY_REPORT, // 聚合报表-报表块
POLY_CHART, // 聚合报表-图表块 POLY_CHART, // 聚合报表-图表块
AUTHORITY_EDITION // 权限编辑 AUTHORITY_EDITION, // 权限编辑
AUTHORITY_EDITION_DISABLED // 权限编辑
} }
private PropertyMode currentMode; // 当前模式(根据不同模式,显示不同的可用面板) private PropertyMode currentMode; // 当前模式(根据不同模式,显示不同的可用面板)
@ -77,6 +87,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
super(); super();
// setVerticalDragEnabled(false); // setVerticalDragEnabled(false);
initPropertyItemList(); initPropertyItemList();
defaultPane = getDefaultPane(Inter.getLocText("FR-Designer_No_Settings_Available"));
defaultAuthorityPane = getDefaultPane(Inter.getLocText("FR-Designer_Not_Support_Authority_Edit"));
switchMode(PropertyMode.REPORT); switchMode(PropertyMode.REPORT);
// initContentPane(); // initContentPane();
// super(leftPane, rightPane); // super(leftPane, rightPane);
@ -115,11 +127,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
new PropertyMode[]{PropertyMode.FORM}); new PropertyMode[]{PropertyMode.FORM});
// 权限编辑 // 权限编辑
PropertyItem authorityEdition = new PropertyItem(KEY_AUTHORITY_EDITION, Inter.getLocText("FR-Designer_Permissions_Edition"), PropertyItem authorityEdition = new PropertyItem(KEY_AUTHORITY_EDITION, Inter.getLocText("FR-Designer_Permissions_Edition"),
"authorityedit", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}, "authorityedit", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION_DISABLED},
new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}); new PropertyMode[]{PropertyMode.AUTHORITY_EDITION});
// 已配置角色 // 已配置角色
PropertyItem configuredRoles = new PropertyItem(KEY_CONFIGURED_ROLES, Inter.getLocText("FR-Designer_Configured_Roles"), PropertyItem configuredRoles = new PropertyItem(KEY_CONFIGURED_ROLES, Inter.getLocText("FR-Designer_Configured_Roles"),
"configuredroles", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}, "configuredroles", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION_DISABLED},
new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}); new PropertyMode[]{PropertyMode.AUTHORITY_EDITION});
propertyItemMap.put(KEY_CELL_ELEMENT, cellElement); propertyItemMap.put(KEY_CELL_ELEMENT, cellElement);
@ -134,9 +146,10 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
} }
// "无可用配置项"面板 // "无可用配置项"面板
private JPanel getDefaultPane() { private JPanel getDefaultPane(String prompt) {
JPanel defaultPane = new JPanel(); JPanel defaultPane = new JPanel();
UILabel label = new UILabel(Inter.getLocText("FR-Designer_No_Settings_Available")); UILabel label = new UILabel(prompt);
label.setHorizontalAlignment(SwingConstants.CENTER);
defaultPane.setLayout(new BorderLayout()); defaultPane.setLayout(new BorderLayout());
defaultPane.add(label, BorderLayout.CENTER); defaultPane.add(label, BorderLayout.CENTER);
return defaultPane; return defaultPane;
@ -159,7 +172,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
} }
rightPane.add(item.getName(), item.getPropertyPanel()); rightPane.add(item.getName(), item.getPropertyPanel());
} }
rightPane.add(DEFAULT_PANE, getDefaultPane()); rightPane.add(DEFAULT_PANE, defaultPane);
rightPane.add(DEFAULT_AUTHORITY_PANE, defaultAuthorityPane);
replaceRightPane(rightPane); replaceRightPane(rightPane);
refreshRightPane(); refreshRightPane();
@ -176,8 +190,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
leftPane.add(item.getButton()); leftPane.add(item.getButton());
} }
// leftPane.setLayout(new BoxLayout(leftPane, BoxLayout.Y_AXIS)); leftPane.setBackground(UIConstants.PROPERTY_PANE_BACKGROUND);
leftPane.setBackground(new Color(217, 218, 221));
replaceLeftPane(leftPane); replaceLeftPane(leftPane);
} }
@ -357,16 +370,24 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
*/ */
public void refreshRightPane() { public void refreshRightPane() {
boolean hasAvailableTab = false; boolean hasAvailableTab = false;
boolean hasEnabledTab = false;
for (String name : propertyItemMap.keySet()) { for (String name : propertyItemMap.keySet()) {
PropertyItem propertyItem = propertyItemMap.get(name); PropertyItem propertyItem = propertyItemMap.get(name);
if (propertyItem.isVisible() && !propertyItem.isPoppedOut() && propertyItem.isEnabled()) { if (propertyItem.isVisible() && propertyItem.isEnabled()) {
propertyCard.show(rightPane, name); // 显示第一个可用tab hasEnabledTab = true;
hasAvailableTab = true; if (!propertyItem.isPoppedOut()) {
break; propertyCard.show(rightPane, name); // 显示第一个可用tab
hasAvailableTab = true;
break;
}
} }
} }
if (!hasAvailableTab) { if (!hasAvailableTab) {
propertyCard.show(rightPane, DEFAULT_PANE); if (!hasEnabledTab && BaseUtils.isAuthorityEditing()) {
propertyCard.show(rightPane, DEFAULT_AUTHORITY_PANE);
} else {
propertyCard.show(rightPane, DEFAULT_PANE);
}
} }
// if (this.getRightPane() instanceof DockingView) { // if (this.getRightPane() instanceof DockingView) {
@ -430,7 +451,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private static final String ICON_SUFFIX_SELECTED = "_selected.png"; private static final String ICON_SUFFIX_SELECTED = "_selected.png";
private String btnIconName; private String btnIconName;
private String iconSuffix = ICON_SUFFIX_NORMAL; // normal, diabled, selected, 三者之一 private String iconSuffix = ICON_SUFFIX_NORMAL; // normal, diabled, selected, 三者之一
private final Color selectedBtnBackground = new Color(240, 240, 240); private final Color selectedBtnBackground = new Color(0xF5F5F7);
private Color originBtnBackground; private Color originBtnBackground;
public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes) { public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes) {
@ -576,7 +597,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private void initButton() { private void initButton() {
button = new UIButton(BaseUtils.readIcon(getBtnIconUrl())) { button = new UIButton(BaseUtils.readIcon(getBtnIconUrl())) {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
return new Dimension(TAB_BUTTON_WIDTH, TAB_BUTTON_WIDTH); return new Dimension(TAB_BUTTON_WIDTH, TAB_BUTTON_HEIGHT);
} }
@Override @Override
public void paintComponent(Graphics g) { public void paintComponent(Graphics g) {
@ -665,36 +686,25 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private class FixedPopupPane extends JPopupMenu { private class FixedPopupPane extends JPopupMenu {
private JComponent contentPane; private JComponent contentPane;
// private PopupToolPane popupToolPane;
private int fixedHeight;
FixedPopupPane(PropertyItem propertyItem) { FixedPopupPane(PropertyItem propertyItem) {
contentPane = propertyItem.getContentPane(); contentPane = propertyItem.getContentPane();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
// popupToolPane = ;
this.add(new PopupToolPane(propertyItem), BorderLayout.NORTH); this.add(new PopupToolPane(propertyItem), BorderLayout.NORTH);
this.add(contentPane, BorderLayout.CENTER); this.add(contentPane, BorderLayout.CENTER);
this.setOpaque(false); this.setOpaque(false);
fixedHeight = getPreferredSize().height - contentPane.getPreferredSize().height; setPreferredSize(new Dimension(CONTAINER_WIDTH - TAB_WIDTH, POPUP_DEFAULT_HEIGHT));
updateSize();
} }
public void menuSelectionChanged(boolean isIncluded) { public void menuSelectionChanged(boolean isIncluded) {
} }
private void updateSize() {
int newHeight = fixedHeight + contentPane.getPreferredSize().height;
this.setPreferredSize(new Dimension(CONTAINER_WIDTH - TAB_WIDTH, newHeight));
}
public JComponent getContentPane() { public JComponent getContentPane() {
return contentPane; return contentPane;
} }
public void replaceContentPane(JComponent pane) { public void replaceContentPane(JComponent pane) {
// remove(pane);
this.remove(this.contentPane); this.remove(this.contentPane);
this.add(this.contentPane = pane); this.add(this.contentPane = pane);
updateSize();
refreshContainer(); refreshContainer();
} }
@ -707,9 +717,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
// 弹出属性面板的工具条 // 弹出属性面板的工具条
private class PopupToolPane extends JPanel { private class PopupToolPane extends JPanel {
private int model = UIConstants.MODEL_NORMAL;
private String title; private String title;
private JComponent contentPane;
private PropertyItem propertyItem; private PropertyItem propertyItem;
private String buttonType; private String buttonType;
private JDialog parentDialog; // 如果不在对话框中,值为null private JDialog parentDialog; // 如果不在对话框中,值为null
@ -732,7 +740,6 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
if (mouseDownCompCoords == null) { if (mouseDownCompCoords == null) {
setBackground(originColor); setBackground(originColor);
} }
model = UIConstants.MODEL_NORMAL;
repaint(); repaint();
} }
@Override @Override
@ -761,13 +768,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
public void mouseMoved(MouseEvent e) { public void mouseMoved(MouseEvent e) {
if (e.getX() >= ARROW_RANGE_START) { if (e.getX() >= ARROW_RANGE_START) {
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
model = UIConstants.MODEL_PRESS;
} else if (isMovable) { } else if (isMovable) {
setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
setBackground(Color.pink); setBackground(Color.pink);
} else { } else {
setCursor(Cursor.getDefaultCursor()); setCursor(Cursor.getDefaultCursor());
model = UIConstants.MODEL_NORMAL;
} }
repaint(); repaint();
} }
@ -807,13 +812,12 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
super(); super();
this.propertyItem = propertyItem; this.propertyItem = propertyItem;
this.title = propertyItem.getTitle(); this.title = propertyItem.getTitle();
this.contentPane = propertyItem.getContentPane(); originColor = Color.white;
originColor = getBackground(); setBackground(originColor);
setLayout(new BorderLayout()); setLayout(new BorderLayout());
UILabel label = new UILabel(title); UILabel label = new UILabel(title);
label.setForeground(new Color(69, 135, 255));
add(label, BorderLayout.WEST); add(label, BorderLayout.WEST);
setBorder(new EmptyBorder(5, 10, 0, 0)); setBorder(new EmptyBorder(5, 10, 5, 0));
initToolButton(buttonType); initToolButton(buttonType);
} }
@ -856,27 +860,15 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
Image button; Image button;
g.setColor(new Color(69, 135, 255)); g.setColor(new Color(69, 135, 255));
g.setFont(FRFont.getInstance().applySize(14)); g.setFont(FRFont.getInstance().applySize(14));
// g.drawString(title, 5, 20);
// g.drawImage(UIConstants.DRAG_BAR, 0, 0, CONTENT_WIDTH, POPUP_TOOLPANE_HEIGHT, null);
if (buttonType.equals(NO_BUTTON)) { if (buttonType.equals(NO_BUTTON)) {
return; return;
} }
if (buttonType.equals(DOWN_BUTTON)) { if (buttonType.equals(DOWN_BUTTON)) {
if (model == UIConstants.MODEL_NORMAL) { button = UIConstants.POP_BUTTON_DOWN;
button = UIConstants.DRAG_LEFT_NORMAL;
} else {
button = UIConstants.DRAG_LEFT_PRESS;
}
} else { } else {
if (model == UIConstants.MODEL_NORMAL) { button = UIConstants.POP_BUTTON_UP;
button = UIConstants.DRAG_RIGHT_NORMAL;
} else {
button = UIConstants.DRAG_RIGHT_PRESS;
}
} }
// g.drawImage(button, 2, ARROW_MARGIN_VERTICAL, 5, toolPaneHeight, null); g.drawImage(button, ARROW_RANGE_START + 8, 4, 16, 16, null);
g.drawImage(button, ARROW_RANGE_START + 12, 7, 5, 5, null);
} }
} }
@ -886,7 +878,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private Cursor originCursor; private Cursor originCursor;
private Cursor southResizeCursor = Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR); private Cursor southResizeCursor = Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR);
private Point mouseDownCompCoords; private Point mouseDownCompCoords;
private int minHeight; // 对话框最小高度
private JComponent contentPane; private JComponent contentPane;
private PropertyItem propertyItem; private PropertyItem propertyItem;
public PopupDialog(PropertyItem propertyItem) { public PopupDialog(PropertyItem propertyItem) {
@ -899,8 +891,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
contentPane = propertyItem.getContentPane(); contentPane = propertyItem.getContentPane();
container.add(popupToolPane, BorderLayout.NORTH); container.add(popupToolPane, BorderLayout.NORTH);
container.add(contentPane, BorderLayout.CENTER); container.add(contentPane, BorderLayout.CENTER);
minHeight = container.getPreferredSize().height; setSize(CONTENT_WIDTH, POPUP_DEFAULT_HEIGHT);
setSize(CONTENT_WIDTH, minHeight);
// validate(); // validate();
adjustLocation(); adjustLocation();
@ -940,8 +931,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
Point currCoords = e.getLocationOnScreen(); Point currCoords = e.getLocationOnScreen();
bounds.height = currCoords.y - mouseDownCompCoords.y + bounds.height; bounds.height = currCoords.y - mouseDownCompCoords.y + bounds.height;
// 校正位置 // 校正位置
if (bounds.height < minHeight) { if (bounds.height < POPUP_MIN_HEIGHT) {
bounds.height = minHeight; bounds.height = POPUP_MIN_HEIGHT;
}
if (bounds.height > POPUP_MAX_HEIGHT) {
bounds.height = POPUP_MAX_HEIGHT;
} }
mouseDownCompCoords.y = currCoords.y; mouseDownCompCoords.y = currCoords.y;
setBounds(bounds); setBounds(bounds);

188
designer_base/src/com/fr/design/mainframe/JFormSliderPane.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -13,14 +14,10 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.MatteBorder;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.*;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.math.BigDecimal; import java.math.BigDecimal;
/** /**
@ -32,7 +29,7 @@ public class JFormSliderPane extends JPanel {
private static final int SIX = 6; private static final int SIX = 6;
private static final int TEN = 10; private static final int TEN = 10;
private static final int ONE_EIGHT = 18; private static final int ONE_EIGHT = 18;
private static final int FONT_SIZE = 14; private static final int FONT_SIZE = 12;
private static final int SPINNER_WIDTH = 45; private static final int SPINNER_WIDTH = 45;
private static final int SPINNER_HEIGHT = 20; private static final int SPINNER_HEIGHT = 20;
private static final int HALF_HUNDRED = 50; private static final int HALF_HUNDRED = 50;
@ -40,10 +37,15 @@ public class JFormSliderPane extends JPanel {
private static final int TWO_HUNDRED = 200; private static final int TWO_HUNDRED = 200;
private static final int THREE_HUNDRED = 300; private static final int THREE_HUNDRED = 300;
private static final int FOUR_HUNDRED = 400; private static final int FOUR_HUNDRED = 400;
private static final int DIALOG_WIDTH = 150; private static final int DIALOG_WIDTH = 157;
private static final int DIALOG_HEIGHT = 220; private static final int DIALOG_HEIGHT = 172;
private static final int SHOWVALBUTTON_WIDTH = 70; private static final int SLIDER_WIDTH = 220;
private static final int SHOWVALBUTTON_HEIGHTH = 25; private static final int SLIDER_HEIGHT = 20;
private static final int SHOWVALBUTTON_WIDTH = 40;
private static final int SHOWVALBUTTON_HEIGHTH = 20;
private static final int SLIDER_GAP = 5;
private static final int TOOLTIP_Y = 25;
private static final Color BACK_COLOR = new Color(245, 245, 247);
public int showValue = 100; public int showValue = 100;
public double resolutionTimes = 1.0; public double resolutionTimes = 1.0;
private static JFormSliderPane THIS; private static JFormSliderPane THIS;
@ -54,7 +56,7 @@ public class JFormSliderPane extends JPanel {
private int sliderValue; private int sliderValue;
private UIButton downButton; private UIButton downButton;
private UIButton upButton; private UIButton upButton;
private UIButton showValButton; private JButton showValButton;
private UIRadioButton twoHundredButton; private UIRadioButton twoHundredButton;
private UIRadioButton oneHundredButton; private UIRadioButton oneHundredButton;
private UIRadioButton SevenFiveButton; private UIRadioButton SevenFiveButton;
@ -71,61 +73,102 @@ public class JFormSliderPane extends JPanel {
public JFormSliderPane() { public JFormSliderPane() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
slider = new UISlider(0, HUNDRED, HALF_HUNDRED); initSlider();
slider.setUI(new JSliderPaneUI(slider)); initShowValSpinner();
slider.addChangeListener(listener); initDownUpButton();
initShowValButton();
showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1));
showValSpinner.setEnabled(true);
showValSpinner.addChangeListener(showValSpinnerChangeListener);
showValSpinner.setPreferredSize(new Dimension(SPINNER_WIDTH, SPINNER_HEIGHT));
//MoMeak:控制只能输入10-400,但是用起来感觉不舒服,先注释掉吧
// JSpinner.NumberEditor editor = new JSpinner.NumberEditor(showValSpinner, "0");
// showValSpinner.setEditor(editor);
// JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField();
// textField.setEditable(true);
// DefaultFormatterFactory factory = (DefaultFormatterFactory) textField .getFormatterFactory();
// NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter();
// formatter.setAllowsInvalid(false);
downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/moveDown.png"));
upButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/moveUp.png"));
downButton.setActionCommand("less");
upButton.setActionCommand("more");
downButton.addActionListener(buttonActionListener);
upButton.addActionListener(buttonActionListener);
showValButton = new UIButton(showValSpinner.getValue() + "%");
showValButton.setBorderPainted(false);
showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH));
showValButton.addActionListener(showValButtonActionListener);
initUIRadioButton(); initUIRadioButton();
initPane(); initPane();
JPanel panel = new JPanel(new FlowLayout(1, 1, 0)); JPanel panel = new JPanel(new FlowLayout(1, 5, 0));
panel.add(downButton); panel.add(downButton);
panel.add(slider); panel.add(slider);
panel.add(upButton); panel.add(upButton);
panel.add(showValButton); panel.add(showValButton);
panel.setBackground(BACK_COLOR);
this.add(panel, BorderLayout.NORTH); this.add(panel, BorderLayout.NORTH);
this.setBounds(0, 0, THREE_HUNDRED, ONE_EIGHT);
} }
public static final JFormSliderPane getInstance() { public static final JFormSliderPane getInstance() {
// if (THIS == null) { // if (THIS == null) {
// THIS = new JFormSliderPane(); // THIS = new JSliderPane();
// } // }
THIS = new JFormSliderPane(); THIS = new JFormSliderPane();
return THIS; return THIS;
} }
private void initSlider() {
slider = new UISlider(0, HUNDRED, HALF_HUNDRED){
public Point getToolTipLocation(MouseEvent event){
return new Point(event.getX(), event.getY() - TOOLTIP_Y);
}
};
slider.setUI(new JSliderPaneUI(slider));
slider.addChangeListener(listener);
slider.setPreferredSize(new Dimension(220, 20));
//去掉虚线框
slider.setFocusable(false);
slider.setToolTipText(Inter.getLocText("FR-Designer_Scale_Slider"));
}
private void initShowValSpinner() {
showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1)){
public Point getToolTipLocation(MouseEvent event){
return new Point(event.getX(), event.getY() - TOOLTIP_Y);
}
};
showValSpinner.setEnabled(true);
showValSpinner.addChangeListener(showValSpinnerChangeListener);
showValSpinner.setPreferredSize(new Dimension(SPINNER_WIDTH, SPINNER_HEIGHT));
}
private void initDownUpButton() {
downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png")){
public Point getToolTipLocation(MouseEvent event){
return new Point(event.getX(), event.getY() - TOOLTIP_Y);
}
};
downButton.setOpaque(false);
downButton.setBorderPainted(false);
downButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Down"));
upButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalUp20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png")){
public Point getToolTipLocation(MouseEvent event){
return new Point(event.getX(), event.getY() - TOOLTIP_Y);
}
};
upButton.setOpaque(false);
upButton.setBorderPainted(false);
upButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Up"));
downButton.setActionCommand("less");
upButton.setActionCommand("more");
downButton.addActionListener(buttonActionListener);
upButton.addActionListener(buttonActionListener);
}
private void initShowValButton() {
showValButton = new JButton(showValSpinner.getValue() + "%"){
public Point getToolTipLocation(MouseEvent event){
return new Point(event.getX(), event.getY() - TOOLTIP_Y);
}
};
showValButton.setOpaque(false);
showValButton.setMargin(new Insets(0, 0, 0, 0));
showValButton.setFont(new Font("SimSun", Font.PLAIN, 12));
showValButton.setBackground(BACK_COLOR);
showValButton.setBorderPainted(false);
showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH));
showValButton.addActionListener(showValButtonActionListener);
showValButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Grade"));
}
private void initUIRadioButton() { private void initUIRadioButton() {
twoHundredButton = new UIRadioButton("200%"); twoHundredButton = new UIRadioButton("200%");
oneHundredButton = new UIRadioButton("100%"); oneHundredButton = new UIRadioButton("100%");
SevenFiveButton = new UIRadioButton("75%"); SevenFiveButton = new UIRadioButton("75%");
fiveTenButton = new UIRadioButton("50%"); fiveTenButton = new UIRadioButton("50%");
twoFiveButton = new UIRadioButton("25%"); twoFiveButton = new UIRadioButton("25%");
// selfAdaptButton = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_selfAdaptButton")); selfAdaptButton = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_selfAdaptButton"));
selfAdaptButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE));
customButton = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_customButton")); customButton = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_customButton"));
customButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE));
twoHundredButton.addItemListener(radioButtonItemListener); twoHundredButton.addItemListener(radioButtonItemListener);
oneHundredButton.addItemListener(radioButtonItemListener); oneHundredButton.addItemListener(radioButtonItemListener);
SevenFiveButton.addItemListener(radioButtonItemListener); SevenFiveButton.addItemListener(radioButtonItemListener);
@ -140,7 +183,7 @@ public class JFormSliderPane extends JPanel {
bg.add(SevenFiveButton); bg.add(SevenFiveButton);
bg.add(fiveTenButton); bg.add(fiveTenButton);
bg.add(twoFiveButton); bg.add(twoFiveButton);
// bg.add(selfAdaptButton); bg.add(selfAdaptButton);
bg.add(customButton); bg.add(customButton);
customButton.setSelected(true); customButton.setSelected(true);
} }
@ -149,25 +192,44 @@ public class JFormSliderPane extends JPanel {
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, p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p, p, p};
UILabel upLabel = new UILabel(" " + Inter.getLocText("FR-Designer_Scale_EnlargeOrReduce"));
upLabel.setOpaque(false);
JPanel septPane = new JPanel(new BorderLayout());
JSeparator sept = new JSeparator();
sept.setBackground(new Color(232, 232, 233));
septPane.add(sept, BorderLayout.NORTH);
septPane.setBorder(BorderFactory.createEmptyBorder(2, 5, 1, 10));
septPane.setBackground(BACK_COLOR);
twoHundredButton.setBackground(BACK_COLOR);
oneHundredButton.setBackground(BACK_COLOR);
SevenFiveButton.setBackground(BACK_COLOR);
fiveTenButton.setBackground(BACK_COLOR);
twoFiveButton.setBackground(BACK_COLOR);
// selfAdaptButton.setBackground(BACK_COLOR);
customButton.setBackground(BACK_COLOR);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{upLabel, null},
new Component[]{septPane, null},
new Component[]{twoHundredButton, null}, new Component[]{twoHundredButton, null},
new Component[]{oneHundredButton, null}, new Component[]{oneHundredButton, null},
new Component[]{SevenFiveButton, null}, new Component[]{SevenFiveButton, null},
new Component[]{fiveTenButton, null}, new Component[]{fiveTenButton, null},
new Component[]{twoFiveButton, null}, new Component[]{twoFiveButton, null},
// new Component[]{selfAdaptButton,null},
new Component[]{customButton, createSpinnerPanel()} new Component[]{customButton, createSpinnerPanel()}
}; };
dialogContentPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); dialogContentPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_MEDIUM, 0);
dialogContentPanel.setBackground(BACK_COLOR);
dialogContentPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
} }
private JPanel createSpinnerPanel() { private JPanel createSpinnerPanel() {
JPanel spinnerPanel = new JPanel(new FlowLayout()); JPanel spinnerPanel = new JPanel(new FlowLayout());
spinnerPanel.add(showValSpinner); spinnerPanel.add(showValSpinner);
UILabel percent = new UILabel("%"); UILabel percent = new UILabel("%");
percent.setFont(new Font("Dialog", Font.PLAIN, FONT_SIZE)); percent.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE));
spinnerPanel.add(percent); spinnerPanel.add(percent);
spinnerPanel.setBackground(BACK_COLOR);
return spinnerPanel; return spinnerPanel;
} }
@ -314,14 +376,14 @@ public class JFormSliderPane extends JPanel {
dialog = new FormPopupPane(upButton, dialogContentPanel); dialog = new FormPopupPane(upButton, dialogContentPanel);
if (upButtonX == 0) { if (upButtonX == 0) {
upButtonX = btnCoords.x; upButtonX = btnCoords.x;
GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP, -DIALOG_HEIGHT);
} }
} else { } else {
if (upButtonX == 0) { if (upButtonX == 0) {
upButtonX = btnCoords.x; upButtonX = btnCoords.x;
GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP, -DIALOG_HEIGHT);
} else { } else {
GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP, -DIALOG_HEIGHT);
} }
} }
} }
@ -341,29 +403,13 @@ public class JFormSliderPane extends JPanel {
class FormPopupPane extends JPopupMenu { class FormPopupPane extends JPopupMenu {
private JComponent contentPane; private static final int DIALOG_WIDTH = 157;
private static final int UPLABEL_HEIGHT = 25; private static final int DIALOG_HEIGHT = 172;
private static final int DIALOG_WIDTH = 150;
private static final int DIALOG_HEIGHT = 220;
private static final int UPLABEL_WIDTH = 300;
private JComponent centerPane;
private UILabel upLabel;
FormPopupPane(UIButton b, JPanel dialogContentPanel) { FormPopupPane(UIButton b, JPanel dialogContentPanel) {
contentPane = new JPanel(new BorderLayout()); this.add(dialogContentPanel, BorderLayout.CENTER);
centerPane = new JPanel(new BorderLayout());
upLabel = new UILabel(" " + Inter.getLocText("FR-Designer_Scale_EnlargeOrReduce"));
upLabel.setOpaque(true);
upLabel.setPreferredSize(new Dimension(UPLABEL_WIDTH, UPLABEL_HEIGHT));
upLabel.setBackground(Color.LIGHT_GRAY);
upLabel.setBorder(new MatteBorder(0, 0, 1, 0, Color.gray));
centerPane.add(dialogContentPanel, BorderLayout.NORTH);
contentPane.add(upLabel, BorderLayout.NORTH);
contentPane.add(centerPane, BorderLayout.CENTER);
// contentPane.setBorder(new MatteBorder(1,1,1,1,Color.darkGray));
this.add(contentPane, BorderLayout.CENTER);
this.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT)); this.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT));
this.setOpaque(false); this.setBackground(new Color(245, 245, 247));
} }

226
designer_base/src/com/fr/design/mainframe/JSliderPane.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -13,15 +14,11 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.MatteBorder;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.plaf.basic.BasicSliderUI; import javax.swing.plaf.basic.BasicSliderUI;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.*;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.math.BigDecimal; import java.math.BigDecimal;
/** /**
@ -33,7 +30,7 @@ public class JSliderPane extends JPanel {
private static final int SIX = 6; private static final int SIX = 6;
private static final int TEN = 10; private static final int TEN = 10;
private static final int ONE_EIGHT = 18; private static final int ONE_EIGHT = 18;
private static final int FONT_SIZE = 14; private static final int FONT_SIZE = 12;
private static final int SPINNER_WIDTH = 45; private static final int SPINNER_WIDTH = 45;
private static final int SPINNER_HEIGHT = 20; private static final int SPINNER_HEIGHT = 20;
private static final int HALF_HUNDRED = 50; private static final int HALF_HUNDRED = 50;
@ -41,10 +38,16 @@ public class JSliderPane extends JPanel {
private static final int TWO_HUNDRED = 200; private static final int TWO_HUNDRED = 200;
private static final int THREE_HUNDRED = 300; private static final int THREE_HUNDRED = 300;
private static final int FOUR_HUNDRED = 400; private static final int FOUR_HUNDRED = 400;
private static final int DIALOG_WIDTH = 150; private static final int DIALOG_WIDTH = 157;
private static final int DIALOG_HEIGHT = 240; private static final int DIALOG_HEIGHT = 192;
private static final int SHOWVALBUTTON_WIDTH = 70; private static final int SLIDER_WIDTH = 220;
private static final int SHOWVALBUTTON_HEIGHTH = 25; private static final int SLIDER_HEIGHT = 20;
private static final int SHOWVALBUTTON_WIDTH = 40;
private static final int SHOWVALBUTTON_HEIGHTH = 20;
private static final int SLIDER_GAP = 5;
private static final int TOOLTIP_Y = 25;
private static final Color BACK_COLOR = new Color(245, 245, 247);
public int showValue = 100; public int showValue = 100;
public double resolutionTimes = 1.0; public double resolutionTimes = 1.0;
private static JSliderPane THIS; private static JSliderPane THIS;
@ -55,7 +58,7 @@ public class JSliderPane extends JPanel {
private int sliderValue; private int sliderValue;
private UIButton downButton; private UIButton downButton;
private UIButton upButton; private UIButton upButton;
private UIButton showValButton; private JButton showValButton;
private UIRadioButton twoHundredButton; private UIRadioButton twoHundredButton;
private UIRadioButton oneHundredButton; private UIRadioButton oneHundredButton;
private UIRadioButton SevenFiveButton; private UIRadioButton SevenFiveButton;
@ -72,44 +75,23 @@ public class JSliderPane extends JPanel {
public JSliderPane() { public JSliderPane() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
slider = new UISlider(0, HUNDRED, HALF_HUNDRED); initSlider();
slider.setUI(new JSliderPaneUI(slider)); initShowValSpinner();
slider.addChangeListener(listener); initDownUpButton();
initShowValButton();
showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1));
showValSpinner.setEnabled(true);
showValSpinner.addChangeListener(showValSpinnerChangeListener);
showValSpinner.setPreferredSize(new Dimension(SPINNER_WIDTH, SPINNER_HEIGHT));
//MoMeak:控制只能输入10-400,但是用起来感觉不舒服,先注释掉吧
// JSpinner.NumberEditor editor = new JSpinner.NumberEditor(showValSpinner, "0");
// showValSpinner.setEditor(editor);
// JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField();
// textField.setEditable(true);
// DefaultFormatterFactory factory = (DefaultFormatterFactory) textField .getFormatterFactory();
// NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter();
// formatter.setAllowsInvalid(false);
downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/moveDown.png"));
upButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/moveUp.png"));
downButton.setActionCommand("less");
upButton.setActionCommand("more");
downButton.addActionListener(buttonActionListener);
upButton.addActionListener(buttonActionListener);
showValButton = new UIButton(showValSpinner.getValue() + "%");
showValButton.setBorderPainted(false);
showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH));
showValButton.addActionListener(showValButtonActionListener);
initUIRadioButton(); initUIRadioButton();
initPane(); initPane();
JPanel panel = new JPanel(new FlowLayout(1, 1, 0)); JPanel panel = new JPanel(new FlowLayout(1, 5, 0));
panel.add(downButton); panel.add(downButton);
panel.add(slider); panel.add(slider);
panel.add(upButton); panel.add(upButton);
panel.add(showValButton); panel.add(showValButton);
panel.setBackground(BACK_COLOR);
this.add(panel, BorderLayout.NORTH); this.add(panel, BorderLayout.NORTH);
this.setBounds(0, 0, THREE_HUNDRED, ONE_EIGHT);
} }
public static final JSliderPane getInstance() { public static final JSliderPane getInstance() {
// if (THIS == null) { // if (THIS == null) {
// THIS = new JSliderPane(); // THIS = new JSliderPane();
@ -118,6 +100,70 @@ public class JSliderPane extends JPanel {
return THIS; return THIS;
} }
private void initSlider() {
slider = new UISlider(0, HUNDRED, HALF_HUNDRED){
public Point getToolTipLocation(MouseEvent event){
return new Point(event.getX(), event.getY() - TOOLTIP_Y);
}
};
slider.setUI(new JSliderPaneUI(slider));
slider.addChangeListener(listener);
slider.setPreferredSize(new Dimension(220, 20));
//去掉虚线框
slider.setFocusable(false);
slider.setToolTipText(Inter.getLocText("FR-Designer_Scale_Slider"));
}
private void initShowValSpinner() {
showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1)){
public Point getToolTipLocation(MouseEvent event){
return new Point(event.getX(), event.getY() - TOOLTIP_Y);
}
};
showValSpinner.setEnabled(true);
showValSpinner.addChangeListener(showValSpinnerChangeListener);
showValSpinner.setPreferredSize(new Dimension(SPINNER_WIDTH, SPINNER_HEIGHT));
}
private void initDownUpButton() {
downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png")){
public Point getToolTipLocation(MouseEvent event){
return new Point(event.getX(), event.getY() - TOOLTIP_Y);
}
};
downButton.setOpaque(false);
downButton.setBorderPainted(false);
downButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Down"));
upButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalUp20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png")){
public Point getToolTipLocation(MouseEvent event){
return new Point(event.getX(), event.getY() - TOOLTIP_Y);
}
};
upButton.setOpaque(false);
upButton.setBorderPainted(false);
upButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Up"));
downButton.setActionCommand("less");
upButton.setActionCommand("more");
downButton.addActionListener(buttonActionListener);
upButton.addActionListener(buttonActionListener);
}
private void initShowValButton() {
showValButton = new JButton(showValSpinner.getValue() + "%"){
public Point getToolTipLocation(MouseEvent event){
return new Point(event.getX(), event.getY() - TOOLTIP_Y);
}
};
showValButton.setOpaque(false);
showValButton.setMargin(new Insets(0, 0, 0, 0));
showValButton.setFont(new Font("SimSun", Font.PLAIN, 12));
showValButton.setBackground(BACK_COLOR);
showValButton.setBorderPainted(false);
showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH));
showValButton.addActionListener(showValButtonActionListener);
showValButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Grade"));
}
private void initUIRadioButton() { private void initUIRadioButton() {
twoHundredButton = new UIRadioButton("200%"); twoHundredButton = new UIRadioButton("200%");
oneHundredButton = new UIRadioButton("100%"); oneHundredButton = new UIRadioButton("100%");
@ -125,7 +171,9 @@ public class JSliderPane extends JPanel {
fiveTenButton = new UIRadioButton("50%"); fiveTenButton = new UIRadioButton("50%");
twoFiveButton = new UIRadioButton("25%"); twoFiveButton = new UIRadioButton("25%");
selfAdaptButton = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_selfAdaptButton")); selfAdaptButton = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_selfAdaptButton"));
selfAdaptButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE));
customButton = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_customButton")); customButton = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_customButton"));
customButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE));
twoHundredButton.addItemListener(radioButtonItemListener); twoHundredButton.addItemListener(radioButtonItemListener);
oneHundredButton.addItemListener(radioButtonItemListener); oneHundredButton.addItemListener(radioButtonItemListener);
SevenFiveButton.addItemListener(radioButtonItemListener); SevenFiveButton.addItemListener(radioButtonItemListener);
@ -149,8 +197,25 @@ public class JSliderPane extends JPanel {
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, p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p, p, p, p};
UILabel upLabel = new UILabel(" " + Inter.getLocText("FR-Designer_Scale_EnlargeOrReduce"));
upLabel.setOpaque(false);
JPanel septPane = new JPanel(new BorderLayout());
JSeparator sept = new JSeparator();
sept.setBackground(new Color(232, 232, 233));
septPane.add(sept, BorderLayout.NORTH);
septPane.setBorder(BorderFactory.createEmptyBorder(2, 5, 1, 10));
septPane.setBackground(BACK_COLOR);
twoHundredButton.setBackground(BACK_COLOR);
oneHundredButton.setBackground(BACK_COLOR);
SevenFiveButton.setBackground(BACK_COLOR);
fiveTenButton.setBackground(BACK_COLOR);
twoFiveButton.setBackground(BACK_COLOR);
selfAdaptButton.setBackground(BACK_COLOR);
customButton.setBackground(BACK_COLOR);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{upLabel, null},
new Component[]{septPane, null},
new Component[]{twoHundredButton, null}, new Component[]{twoHundredButton, null},
new Component[]{oneHundredButton, null}, new Component[]{oneHundredButton, null},
new Component[]{SevenFiveButton, null}, new Component[]{SevenFiveButton, null},
@ -159,15 +224,18 @@ public class JSliderPane extends JPanel {
new Component[]{selfAdaptButton, null}, new Component[]{selfAdaptButton, null},
new Component[]{customButton, createSpinnerPanel()} new Component[]{customButton, createSpinnerPanel()}
}; };
dialogContentPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); dialogContentPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_MEDIUM, 0);
dialogContentPanel.setBackground(BACK_COLOR);
dialogContentPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
} }
private JPanel createSpinnerPanel() { private JPanel createSpinnerPanel() {
JPanel spinnerPanel = new JPanel(new FlowLayout()); JPanel spinnerPanel = new JPanel(new FlowLayout());
spinnerPanel.add(showValSpinner); spinnerPanel.add(showValSpinner);
UILabel percent = new UILabel("%"); UILabel percent = new UILabel("%");
percent.setFont(new Font("Dialog", Font.PLAIN, FONT_SIZE)); percent.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE));
spinnerPanel.add(percent); spinnerPanel.add(percent);
spinnerPanel.setBackground(BACK_COLOR);
return spinnerPanel; return spinnerPanel;
} }
@ -314,14 +382,14 @@ public class JSliderPane extends JPanel {
dialog = new PopupPane(upButton, dialogContentPanel); dialog = new PopupPane(upButton, dialogContentPanel);
if (upButtonX == 0) { if (upButtonX == 0) {
upButtonX = btnCoords.x; upButtonX = btnCoords.x;
GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP * 2, -DIALOG_HEIGHT);
} }
} else { } else {
if (upButtonX == 0) { if (upButtonX == 0) {
upButtonX = btnCoords.x; upButtonX = btnCoords.x;
GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP * 2, -DIALOG_HEIGHT);
} else { } else {
GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP * 2, -DIALOG_HEIGHT);
} }
} }
} }
@ -341,6 +409,7 @@ public class JSliderPane extends JPanel {
class JSliderPaneUI extends BasicSliderUI { class JSliderPaneUI extends BasicSliderUI {
private static final Color BACK_COLOR = new Color(245, 245, 247);
private static final int VERTICAL_WIDTH = 11; private static final int VERTICAL_WIDTH = 11;
private static final int VERTICAL_HEIGHT = 16; private static final int VERTICAL_HEIGHT = 16;
private static final int FOUR = 4; private static final int FOUR = 4;
@ -356,33 +425,18 @@ class JSliderPaneUI extends BasicSliderUI {
* 绘制指示物 * 绘制指示物
*/ */
public Dimension getThumbSize() {
Dimension size = new Dimension();
if (slider.getOrientation() == JSlider.VERTICAL) {
size.width = VERTICAL_WIDTH;
size.height = VERTICAL_HEIGHT;
} else {
size.width = VERTICAL_WIDTH;
size.height = VERTICAL_HEIGHT;
}
return size;
}
public void paintThumb(Graphics g) { public void paintThumb(Graphics g) {
Rectangle knobBounds = thumbRect; Rectangle knobBounds = thumbRect;
int w = knobBounds.width; int w = knobBounds.width;
int h = knobBounds.height; int h = knobBounds.height;
Graphics2D g2d = (Graphics2D) g;
g.translate(knobBounds.x, knobBounds.y);
if (slider.isEnabled()) { g2d.translate(knobBounds.x, knobBounds.y);
g.setColor(slider.getBackground()); // g2d.setColor(slider.getBackground());
} else { // g2d.fillRect(0, FOUR, FOUR, 9);
g.setColor(slider.getBackground().darker()); g2d.setColor(new Color(51, 51, 52));
} g2d.drawRoundRect(0, SIX, FOUR, 9, 2, 2);
g.setColor(Color.darkGray); g2d.fillRoundRect(0, SIX, FOUR, 9, 2, 2);
g.fillRect(0, 1, w - SIX, h + 1);
} }
/** */ /** */
@ -396,8 +450,10 @@ class JSliderPaneUI extends BasicSliderUI {
Graphics2D g2 = (Graphics2D) g; Graphics2D g2 = (Graphics2D) g;
cy = (trackBounds.height / 2); cy = (trackBounds.height / 2);
cw = trackBounds.width; cw = trackBounds.width;
g.setColor(Color.lightGray); g2.setPaint(BACK_COLOR);
g.drawLine(0, cy, cw + FIVE, cy); g2.fillRect(0, -cy, cw + 10, cy * 4);
g.setColor(new Color(216, 216, 216));
g.drawLine(0, cy, cw + 3, cy);
g.drawLine(FIVE + cw / 2, cy - FOUR, FIVE + cw / 2, cy + FOUR); g.drawLine(FIVE + cw / 2, cy - FOUR, FIVE + cw / 2, cy + FOUR);
} else { } else {
super.paintTrack(g); super.paintTrack(g);
@ -407,29 +463,13 @@ class JSliderPaneUI extends BasicSliderUI {
} }
class PopupPane extends JPopupMenu { class PopupPane extends JPopupMenu {
private JComponent contentPane; private static final int DIALOG_WIDTH = 157;
private static final int UPLABEL_HEIGHT = 25; private static final int DIALOG_HEIGHT = 192;
private static final int DIALOG_WIDTH = 150;
private static final int DIALOG_HEIGHT = 240; PopupPane(JButton b, JPanel dialogContentPanel) {
private static final int UPLABEL_WIDTH = 300; this.add(dialogContentPanel, BorderLayout.CENTER);
private JComponent centerPane;
private UILabel upLabel;
PopupPane(UIButton b, JPanel dialogContentPanel) {
contentPane = new JPanel(new BorderLayout());
centerPane = new JPanel(new BorderLayout());
upLabel = new UILabel(" " + Inter.getLocText("FR-Designer_Scale_EnlargeOrReduce"));
upLabel.setOpaque(true);
upLabel.setPreferredSize(new Dimension(UPLABEL_WIDTH, UPLABEL_HEIGHT));
upLabel.setBackground(Color.LIGHT_GRAY);
upLabel.setBorder(new MatteBorder(0, 0, 1, 0, Color.gray));
centerPane.add(dialogContentPanel, BorderLayout.NORTH);
contentPane.add(upLabel, BorderLayout.NORTH);
contentPane.add(centerPane, BorderLayout.CENTER);
// contentPane.setBorder(new MatteBorder(1,1,1,1,Color.darkGray));
this.add(contentPane, BorderLayout.CENTER);
this.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT)); this.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT));
this.setOpaque(false); this.setBackground(new Color(245, 245, 247));
} }

5
designer_base/src/com/fr/design/mainframe/JTemplate.java

@ -126,7 +126,10 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
return; return;
} }
long saveTime = System.currentTimeMillis(); // 保存模板的时间点 long saveTime = System.currentTimeMillis(); // 保存模板的时间点
tic.collectInfo(template, this, openTime, saveTime); try {
tic.collectInfo(template, this, openTime, saveTime);
} catch (Throwable th) { // 不管收集过程中出现任何异常,都不应该影响模版保存
}
openTime = saveTime; // 更新 openTime,准备下一次计算 openTime = saveTime; // 更新 openTime,准备下一次计算
} }

63
designer_base/src/com/fr/design/mainframe/NoSupportAuthorityEdit.java

@ -1 +1,62 @@
package com.fr.design.mainframe; import com.fr.design.constants.UIConstants; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : daisy * Date: 13-9-22 * Time: 上午10:05 */ public class NoSupportAuthorityEdit extends AuthorityEditPane { private static final int TITLE_HEIGHT = 19; public NoSupportAuthorityEdit() { super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); this.setLayout(new BorderLayout()); this.setBorder(null); UILabel title = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) { @Override public Dimension getPreferredSize() { return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT); } }; title.setHorizontalAlignment(SwingConstants.CENTER); title.setVerticalAlignment(SwingConstants.CENTER); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(title, BorderLayout.CENTER); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); this.add(northPane, BorderLayout.NORTH); this.add(createTextPane(), BorderLayout.CENTER); } private JPanel createTextPane() { JPanel panel = new JPanel(new BorderLayout()); UILabel uiLabel = new UILabel(Inter.getLocText("not_support_authority_edit")); uiLabel.setHorizontalAlignment(SwingConstants.CENTER); uiLabel.setVerticalAlignment(SwingConstants.CENTER); panel.add(uiLabel, BorderLayout.CENTER); return panel; } @Override public void populateType() { } @Override public void populateName() { } @Override public JPanel populateCheckPane() { return null; } } package com.fr.design.mainframe;
import com.fr.design.constants.UIConstants;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Author : daisy
* Date: 13-9-22
* Time: 上午10:05
*/
public class NoSupportAuthorityEdit extends AuthorityEditPane {
private static final int TITLE_HEIGHT = 19;
public NoSupportAuthorityEdit() {
super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate());
this.setLayout(new BorderLayout());
this.setBorder(null);
UILabel title = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) {
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT);
}
};
title.setHorizontalAlignment(SwingConstants.CENTER);
title.setVerticalAlignment(SwingConstants.CENTER);
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.add(title, BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR));
// this.add(northPane, BorderLayout.NORTH);
this.add(createTextPane(), BorderLayout.CENTER);
}
private JPanel createTextPane() {
JPanel panel = new JPanel(new BorderLayout());
UILabel uiLabel = new UILabel(Inter.getLocText("not_support_authority_edit"));
uiLabel.setHorizontalAlignment(SwingConstants.CENTER);
uiLabel.setVerticalAlignment(SwingConstants.CENTER);
panel.add(uiLabel, BorderLayout.CENTER);
return panel;
}
@Override
public void populateType() {
}
@Override
public void populateName() {
}
@Override
public JPanel populateCheckPane() {
return null;
}
}

186
designer_base/src/com/fr/design/roleAuthority/RolesAlreadyEditedPane.java

File diff suppressed because one or more lines are too long

132
designer/src/com/fr/design/widget/EventCreator.java → designer_base/src/com/fr/design/widget/EventCreator.java

@ -1,76 +1,58 @@
package com.fr.design.widget; package com.fr.design.widget;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.gui.controlpane.NameableSelfCreator; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper; import com.fr.design.gui.controlpane.NameableSelfCreator;
import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.form.event.Listener; import com.fr.design.gui.ilist.ListModelElement;
import com.fr.form.ui.FileEditor; import com.fr.form.event.Listener;
import com.fr.form.ui.Widget; import com.fr.form.ui.FileEditor;
import com.fr.general.Inter; import com.fr.form.ui.Widget;
import com.fr.general.NameObject; import com.fr.general.Inter;
import com.fr.stable.Nameable; import com.fr.general.NameObject;
import com.fr.stable.Nameable;
public class EventCreator extends NameableSelfCreator {
private String eventName; public class EventCreator extends NameableSelfCreator {
private String eventName;
public EventCreator(String eventName) {
super(switchLang(eventName), Listener.class, WidgetEventPane.WidgetEventListenerUpdatePane.class); public EventCreator(String eventName, Class<? extends BasicBeanPane> updatePane) {
this.eventName = eventName; super(switchLang(eventName), Listener.class, updatePane);
} this.eventName = eventName;
}
@Override
public Nameable createNameable(UnrepeatedNameHelper helper) { @Override
return new NameObject(helper.createUnrepeatedName(this.menuName()),new Listener(this.eventName)) ; public Nameable createNameable(UnrepeatedNameHelper helper) {
} return new NameObject(helper.createUnrepeatedName(this.menuName()),new Listener(this.eventName)) ;
}
public static EventCreator[] createEventCreator(String[] supportedEvents) {
EventCreator[] creators = new EventCreator[supportedEvents.length]; public static EventCreator[] createEventCreator(String[] supportedEvents, Class<? extends BasicBeanPane> updatePane) {
EventCreator[] creators = new EventCreator[supportedEvents.length];
for (int i = 0; i < supportedEvents.length; i++) {
creators[i] = new EventCreator(supportedEvents[i]); for (int i = 0; i < supportedEvents.length; i++) {
} creators[i] = new EventCreator(supportedEvents[i], updatePane);
}
return creators;
} return creators;
}
/*
* richer:国际化事件名称所有需要国际化的事件都应按格式Event-eventName来进行国际化 /*
*/ * richer:国际化事件名称所有需要国际化的事件都应按格式Event-eventName来进行国际化
public static final String switchLang(String eventName) { */
try { public static final String switchLang(String eventName) {
return Inter.getLocText("Event-" + eventName); try {
} catch (Exception e) { return Inter.getLocText("Event-" + eventName);
FRContext.getLogger().error(e.getMessage(), e); } catch (Exception e) {
return eventName; FRContext.getLogger().error(e.getMessage(), e);
} return eventName;
} }
@Override }
public void saveUpdatedBean(ListModelElement wrapper, Object bean) { @Override
((NameObject)wrapper.wrapper).setObject(bean); public void saveUpdatedBean(ListModelElement wrapper, Object bean) {
} ((NameObject)wrapper.wrapper).setObject(bean);
}
public static final EventCreator BEFOREEDIT = new EventCreator(Widget.BEFOREEDIT); @Override
public String createTooltip() {
public static final EventCreator AFTEREDIT = new EventCreator(Widget.AFTEREDIT); return null;
}
public static final EventCreator CHANGE = new EventCreator(Widget.CHANGE);
public static final EventCreator CLICK = new EventCreator(Widget.EVENT_CLICK);
public static final EventCreator SUCCESS = new EventCreator("success");
public static final EventCreator AFTERINIT = new EventCreator(Widget.AFTERINIT);
public static final EventCreator STOPEDIT = new EventCreator(Widget.STOPEDIT);
public static final EventCreator STATECHANGE = new EventCreator(Widget.EVENT_STATECHANGE);
public static final EventCreator CALLBACK = new EventCreator(FileEditor.EVENT_UPLOAD_CALLBACK);
@Override
public String createTooltip() {
return null;
}
} }

453
designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java

@ -1,243 +1,73 @@
package com.fr.design.designer.properties; package com.fr.design.designer.properties;
import com.fr.base.BaseUtils; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.base.FRContext; import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.actions.UpdateAction;
import com.fr.design.gui.frpane.ListenerUpdatePane; import com.fr.design.gui.frpane.ListenerUpdatePane;
import com.fr.design.gui.ilist.JNameEdList;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.javascript.EmailPane; import com.fr.design.javascript.EmailPane;
import com.fr.design.javascript.JavaScriptActionPane; import com.fr.design.javascript.JavaScriptActionPane;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.menu.MenuDef; import com.fr.design.widget.EventCreator;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.write.submit.DBManipulationPane; import com.fr.design.write.submit.DBManipulationPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.form.event.Listener; import com.fr.form.event.Listener;
import com.fr.design.form.javascript.FormEmailPane; import com.fr.design.form.javascript.FormEmailPane;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.js.JavaScriptImpl;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.util.ArrayList;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.IOException;
public class EventPropertyTable extends BasicPane { public class EventPropertyTable extends UIListControlPane {
private ShortCut[] shorts;
private XCreator creator; private XCreator creator;
private JNameEdList nameableList;
private ToolBarDef toolbarDef;
private AddItemMenuDef itemMenu;
private ShortCut editItemAction;
private ShortCut copyItemAction;
private ShortCut removeItemAction;
private UIToolbar toolbar;
private ListenerUpdatePane listenerPane;
private FormDesigner designer; private FormDesigner designer;
public EventPropertyTable(FormDesigner designer) { public EventPropertyTable(FormDesigner designer) {
super(); super();
this.designer = designer; this.designer = designer;
this.initComponents();
} }
protected void initComponents() { @Override
this.setLayout(new BorderLayout()); public String getAddItemText() {
nameableList = new JNameEdList(new DefaultListModel()); return Inter.getLocText("FR-Designer_Add_Event");
this.add(new JScrollPane(nameableList), BorderLayout.CENTER); }
nameableList.setCellRenderer(new NameableListCellRenderer()); public static class WidgetEventListenerUpdatePane extends ListenerUpdatePane {
nameableList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
nameableList.addMouseListener(listMouseListener);
nameableList.setTransferHandler(new DnDTransferHandler());
nameableList.setDropMode(DropMode.INSERT);
nameableList.setDragEnabled(true);
toolbarDef = new ToolBarDef();
shorts = new ShortCut[] { itemMenu = new AddItemMenuDef(), editItemAction = new EditItemMenuDef(),
copyItemAction = new CopyItemAction(), removeItemAction = new RemoveItemAction() };
for (ShortCut sj : shorts) {
toolbarDef.addShortCut(sj);
}
toolbar = ToolBarDef.createJToolBar();
toolbarDef.updateToolBar(toolbar);
this.add(toolbar, BorderLayout.NORTH);
}
/**
* 指定索引添加对象
* @param nameObject 对象名
* @param index 索引
*/
public void addNameObject(NameObject nameObject, int index) {
DefaultListModel model = (DefaultListModel) nameableList.getModel();
model.add(index, nameObject);
nameableList.setSelectedIndex(index);
nameableList.ensureIndexIsVisible(index);
nameableList.repaint();
}
/**
* 刷新控件
* @param strings 字符数组
*/
public void refreshNameableCreator(String[] strings) {
itemMenu.populate(strings);
toolbarDef.updateToolBar(toolbar);
toolbar.validate();
toolbar.repaint();
this.repaint();
}
private void checkButtonEnabled() {
boolean enable = nameableList.getSelectedValue() instanceof NameObject;
itemMenu.setEnabled(this.creator != null && itemMenu.getShortCutCount() > 0);
editItemAction.setEnabled(enable);
copyItemAction.setEnabled(enable);
removeItemAction.setEnabled(enable);
}
private MouseListener listMouseListener = new MouseAdapter() {
@Override @Override
public void mouseReleased(MouseEvent evt) { protected JavaScriptActionPane createJavaScriptActionPane() {
checkButtonEnabled(); return new JavaScriptActionPane() {
if (evt.getClickCount() >= 2 && SwingUtilities.isLeftMouseButton(evt)) {
NameObject object = (NameObject) nameableList.getSelectedValue();
showEventPane(object);
}
}
};
private void showEventPane(final NameObject object) {
if (listenerPane == null) {
listenerPane = new ListenerUpdatePane() {
@Override @Override
protected JavaScriptActionPane createJavaScriptActionPane() { protected DBManipulationPane createDBManipulationPane() {
return new JavaScriptActionPane() { return new DBManipulationPane(ValueEditorPaneFactory.formEditors());
}
@Override
protected DBManipulationPane createDBManipulationPane() {
return new DBManipulationPane(ValueEditorPaneFactory.formEditors());
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Set_Callback_Function");
}
@Override
protected EmailPane initEmaiPane() {
return new FormEmailPane();
}
@Override
public boolean isForm() {
return true;
}
protected String[] getDefaultArgs() {
return new String[0];
}
}; @Override
protected String title4PopupWindow() {
return Inter.getLocText("Set_Callback_Function");
} }
@Override @Override
protected boolean supportCellAction() { protected EmailPane initEmaiPane() {
return false; return new FormEmailPane();
}
@Override
public boolean isForm() {
return true;
} }
};
}
listenerPane.populateBean((Listener) object.getObject());
BasicDialog dialog = listenerPane.showWindow(SwingUtilities.getWindowAncestor(this));
dialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
object.setObject(listenerPane.updateBean());
updateWidgetListener(creator);
}
});
dialog.setVisible(true);
}
private class NameableListCellRenderer extends DefaultListCellRenderer {
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof NameObject) {
Nameable wrappee = (NameObject) value;
this.setText(wrappee.getName());
}
return this;
}
}
/*
* 增加项的MenuDef
*/
protected class AddItemMenuDef extends MenuDef {
public AddItemMenuDef() {
this.setName(Inter.getLocText("Add"));
this.setMnemonic('A');
this.setIconPath("/com/fr/design/images/control/addPopup.png");
}
public void populate(String[] eventNames) {
this.clearShortCuts();
for (int i = 0; i < eventNames.length; i++) {
final String eventname = eventNames[i];
this.addShortCut(new UpdateAction() {
{
this.setName(switchLang(eventname));
}
public void actionPerformed(ActionEvent e) {
NameObject nameable = new NameObject(createUnrepeatedName(switchLang(eventname)), new Listener(
eventname,new JavaScriptImpl()));
EventPropertyTable.this.addNameObject(nameable, EventPropertyTable.this.nameableList.getModel() protected String[] getDefaultArgs() {
.getSize()); return new String[0];
updateWidgetListener(creator); }
}
});
}
}
}
protected class EditItemMenuDef extends UpdateAction { };
public EditItemMenuDef() {
this.setName(Inter.getLocText("Edit"));
this.setMnemonic('E');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/edit.png"));
} }
public void actionPerformed(ActionEvent evt) { @Override
if (nameableList.getSelectedValue() instanceof NameObject) { protected boolean supportCellAction() {
showEventPane((NameObject) nameableList.getSelectedValue()); return false;
}
} }
} }
@ -261,222 +91,53 @@ public class EventPropertyTable extends BasicPane {
} }
Widget widget = creator.toData(); Widget widget = creator.toData();
refreshNameableCreator(widget.supportedEvents()); refreshNameableCreator(EventCreator.createEventCreator(widget.supportedEvents(), WidgetEventListenerUpdatePane.class));
((DefaultListModel) nameableList.getModel()).removeAllElements(); ArrayList<NameObject> nameObjectList = new ArrayList<>();
for (int i = 0, size = widget.getListenerSize(); i < size; i++) { for (int i = 0, size = widget.getListenerSize(); i < size; i++) {
Listener listener = widget.getListener(i); Listener listener = widget.getListener(i);
if (!listener.isDefault()) { if (!listener.isDefault()) {
addNameObject(new NameObject(switchLang(listener.getEventName()) + (i + 1), listener), i); nameObjectList.add(i, new NameObject(switchLang(listener.getEventName()) + (i + 1), listener));
} }
} }
populate(nameObjectList.toArray(new NameObject[widget.getListenerSize()]));
checkButtonEnabled(); checkButtonEnabled();
this.repaint(); this.repaint();
} }
/** /**
* 更新控件事件 * 更新控件事件
* @param creator 控件 * @param creator 控件
*/ */
public void updateWidgetListener(XCreator creator) { public void updateWidgetListener(XCreator creator) {
DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel(); (creator.toData()).clearListeners();
(creator.toData()).clearListeners(); Nameable[] res = this.update();
for (int i = 0, len = listModel.getSize(); i < len; i++) { for (int i = 0; i < res.length; i++) {
(creator.toData()).addListener((Listener) ((NameObject) listModel.getElementAt(i)).getObject()); NameObject nameObject = (NameObject)res[i];
} (creator.toData()).addListener((Listener) nameObject.getObject());
designer.fireTargetModified(); }
designer.fireTargetModified();
checkButtonEnabled(); checkButtonEnabled();
} }
private class RemoveItemAction extends UpdateAction {
public RemoveItemAction() {
this.setName(Inter.getLocText("Remove"));
this.setMnemonic('R');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png"));
}
public void actionPerformed(ActionEvent evt) {
GUICoreUtils.removeJListSelectedNodes(SwingUtilities.getWindowAncestor(EventPropertyTable.this),
nameableList);
updateWidgetListener(creator);
}
}
/*
* CopyItem
*/
private class CopyItemAction extends UpdateAction {
public CopyItemAction() {
this.setName(Inter.getLocText("Copy"));
this.setMnemonic('C');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/copy.png"));
}
public void actionPerformed(ActionEvent evt) {
NameObject selectedNameObject = (NameObject) nameableList.getSelectedValue();
// p: 用反射机制实现
try {
NameObject newNameObject = (NameObject) BaseUtils.cloneObject(selectedNameObject);
newNameObject.setName("CopyOf" + selectedNameObject.getName());
EventPropertyTable.this.addNameObject(newNameObject, nameableList.getSelectedIndex() + 1);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
updateWidgetListener(creator);
}
}
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "Event"; return "Event";
} }
/** @Override
* 生成不重复名字 public NameableCreator[] createNameableCreators() {
* @param prefix 字符 return new NameableCreator[]{
* @return 返回 new EventCreator(Widget.EVENT_STATECHANGE, WidgetEventListenerUpdatePane.class)
*/ };
public String createUnrepeatedName(String prefix) {
DefaultListModel model = (DefaultListModel) nameableList.getModel();
Nameable[] all = new Nameable[model.getSize()];
for (int i = 0; i < model.size(); i++) {
all[i] = (Nameable) model.get(i);
}
int count = 1;
while (true) {
String name_test = prefix + count;
boolean repeated = false;
for (int i = 0, len = model.size(); i < len; i++) {
Nameable nameable = all[i];
if (ComparatorUtils.equals(nameable.getName(), name_test)) {
repeated = true;
break;
}
}
if (!repeated) {
return name_test;
}
count++;
}
}
private class DnDTransferHandler extends TransferHandler {
private int action;
public DnDTransferHandler() {
this(TransferHandler.MOVE);
}
public DnDTransferHandler(int action) {
this.action = action;
}
@Override
public int getSourceActions(JComponent comp) {
return action;
}
@Override
public Transferable createTransferable(JComponent comp) {
int index = nameableList.getSelectedIndex();
if (index < 0 || index >= nameableList.getModel().getSize()) {
return null;
}
return new DnDListItem((NameObject) nameableList.getSelectedValue());
}
@Override
public boolean canImport(TransferSupport support) {
if (!support.isDrop()) {
return false;
}
if (!support.isDataFlavorSupported(DnDListItem.FLAVOR)) {
return false;
}
boolean actionSupported = (action & support.getSourceDropActions()) == action;
if (actionSupported) {
support.setDropAction(action);
return true;
}
return false;
}
@Override
public boolean importData(TransferHandler.TransferSupport support) {
if (!canImport(support)) {
return false;
}
JList.DropLocation dl = (JList.DropLocation) support.getDropLocation();
int importIndex = dl.getIndex();
try {
NameObject item = (NameObject) support.getTransferable().getTransferData(DnDListItem.FLAVOR);
JList list = (JList) support.getComponent();
DefaultListModel model = (DefaultListModel) list.getModel();
for (int i = 0; i <= importIndex; i++) {
if (ComparatorUtils.equals(item,model.getElementAt(i))) {
importIndex--;
break;
}
}
model.removeElement(item);
model.insertElementAt(item, importIndex);
updateWidgetListener(creator);
} catch (UnsupportedFlavorException e) {
return false;
} catch (java.io.IOException e) {
return false;
}
return true;
}
} }
public static class DnDListItem implements Transferable { @Override
private NameObject no; public void saveSettings() {
public static final DataFlavor FLAVOR = new DataFlavor(DnDListItem.class, "DnDListItem.class"); if (isPopulating) {
return;
public DnDListItem(NameObject no) { }
this.no = no; updateWidgetListener(creator);
} }
@Override
public DataFlavor[] getTransferDataFlavors() {
return new DataFlavor[] { FLAVOR };
}
@Override
/**
*是否支持 dataFlavor
*@param DataFlavor类
*@return 支持返回true
*/
public boolean isDataFlavorSupported(DataFlavor flavor) {
if (ComparatorUtils.equals(flavor,FLAVOR)) {
return true;
}
return false;
}
@Override
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
if (ComparatorUtils.equals(flavor,FLAVOR)) {
return no;
}
return null;
}
}
} }

82
designer_form/src/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java

@ -34,8 +34,8 @@ import com.fr.general.Inter;
public class FormWidgetAuthorityEditPane extends AuthorityEditPane { public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
private FormDesigner designer; private FormDesigner designer;
private Widget[] widgets = null; private Widget[] widgets = null;
private UICheckBox widgetVisible = new UICheckBox(Inter.getLocText("FR-Designer_Visible")); private UICheckBox widgetVisible = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Visible"));
private UICheckBox widgetAvailable = new UICheckBox(Inter.getLocText("FR-Designer_Enabled")); private UICheckBox widgetAvailable = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Enabled"));
private ItemListener visibleItemListener = new ItemListener() { private ItemListener visibleItemListener = new ItemListener() {
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();
@ -88,23 +88,19 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
} }
/** /**
* 更新类型面板 * 更新类型面板
* *
* * @date 2014-12-21-下午6:19:43
* @date 2014-12-21-下午6:19:43 */
*
*/
public void populateType() { public void populateType() {
type.setText(Inter.getLocText("Widget-Form_Widget_Config")); type.setText(Inter.getLocText("Widget-Form_Widget_Config"));
} }
/** /**
* 更新名称面板 * 更新名称面板
* *
* * @date 2014-12-21-下午7:12:27
* @date 2014-12-21-下午7:12:27 */
*
*/
public void populateName() { public void populateName() {
String nameText = ""; String nameText = "";
if (widgets == null || widgets.length <= 0) { if (widgets == null || widgets.length <= 0) {
@ -117,29 +113,27 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
} }
/** /**
* 更新checkbox所在的面板 * 更新checkbox所在的面板
* *
* @return 面板 * @return 面板
* * @date 2014-12-21-下午6:19:03
* */
* @date 2014-12-21-下午6:19:03
*
*/
public JPanel populateCheckPane() { public JPanel populateCheckPane() {
checkPane.add(populateWidgetCheckPane(), BorderLayout.WEST); checkPane.add(populateWidgetCheckPane(), BorderLayout.CENTER);
checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
return checkPane; return checkPane;
} }
private JPanel populateWidgetCheckPane() { private JPanel populateWidgetCheckPane() {
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_Widget"), SwingConstants.LEFT), widgetVisible, widgetAvailable} new Component[]{widgetVisible},
new Component[]{widgetAvailable}
}; };
double[] rowSize = {p}; double[] rowSize = {p, p};
double[] columnSize = {p, p, f}; double[] columnSize = {p};
int[][] rowCount = {{1, 1, 1}}; int[][] rowCount = {{1},{1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_SMALL);
} }
@ -157,7 +151,7 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
populateName(); populateName();
checkPane.removeAll(); checkPane.removeAll();
populateCheckPane(); populateCheckPane();
checkPane.setBorder(BorderFactory.createEmptyBorder(ALIGNMENT_GAP, 0, 0, 0)); checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
checkCheckBoxes(); checkCheckBoxes();
} }
@ -169,25 +163,25 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
widgetVisible.addItemListener(visibleItemListener); widgetVisible.addItemListener(visibleItemListener);
widgetAvailable.addItemListener(usableItemListener); widgetAvailable.addItemListener(usableItemListener);
} }
private void populateWidgetButton(String selected){ private void populateWidgetButton(String selected) {
if (widgets == null || widgets.length == 0) { if (widgets == null || widgets.length == 0) {
return; return;
} }
//选中多个, 界面上只取第一个 //选中多个, 界面上只取第一个
Widget widget = widgets[0]; Widget widget = widgets[0];
if(widget.isVisible()){ if (widget.isVisible()) {
widgetVisible.setSelected(!widget.isDoneVisibleAuthority(selected)); widgetVisible.setSelected(!widget.isDoneVisibleAuthority(selected));
}else{ } else {
widgetVisible.setSelected(widget.isVisibleAuthority(selected)); widgetVisible.setSelected(widget.isVisibleAuthority(selected));
} }
if(widget.isEnabled()){ if (widget.isEnabled()) {
widgetAvailable.setSelected(!widget.isDoneUsableAuthority(selected)); widgetAvailable.setSelected(!widget.isDoneUsableAuthority(selected));
}else{ } else {
widgetAvailable.setSelected(widget.isUsableAuthority(selected)); widgetAvailable.setSelected(widget.isUsableAuthority(selected));
} }
} }

14
designer_form/src/com/fr/design/mainframe/FormDesigner.java

@ -475,7 +475,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
paraHeight = 0; paraHeight = 0;
paraComponent = null; paraComponent = null;
formLayoutContainer.setSize(rootComponent.getWidth(), rootComponent.getHeight()); formLayoutContainer.setSize(rootComponent.getWidth(), rootComponent.getHeight());
EastRegionContainerPane.getInstance().replaceDownPane(this.getEastDownPane()); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(this.getEastDownPane());
//atat //atat
//EastRegionContainerPane.getInstance().addTitlePane(ParameterPropertyPane.getInstance(FormDesigner.this)); //EastRegionContainerPane.getInstance().addTitlePane(ParameterPropertyPane.getInstance(FormDesigner.this));
//删除后重绘下 //删除后重绘下
@ -1042,11 +1042,13 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
if (isSupportAuthority()) { if (isSupportAuthority()) {
AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(this); AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(this);
authorityPropertyPane.populate(); authorityPropertyPane.populate();
EastRegionContainerPane.getInstance().replaceUpPane(authorityPropertyPane); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane);
} else { } else {
EastRegionContainerPane.getInstance().replaceUpPane(new NoSupportAuthorityEdit()); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION_DISABLED);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new NoSupportAuthorityEdit());
} }
EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
} }
/** /**
@ -1259,13 +1261,13 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
pane.setLayout(new BorderLayout()); pane.setLayout(new BorderLayout());
pane.add(FormWidgetDetailPane.getInstance(FormDesigner.this), BorderLayout.CENTER); pane.add(FormWidgetDetailPane.getInstance(FormDesigner.this), BorderLayout.CENTER);
EastRegionContainerPane.getInstance().replaceDownPane(pane); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(pane);
} }
}.start(); }.start();
} else { } else {
pane.setLayout(new BorderLayout()); pane.setLayout(new BorderLayout());
pane.add(FormWidgetDetailPane.getInstance(this), BorderLayout.CENTER); pane.add(FormWidgetDetailPane.getInstance(this), BorderLayout.CENTER);
EastRegionContainerPane.getInstance().replaceDownPane(pane); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(pane);
} }
return pane; return pane;

17
designer_form/src/com/fr/design/mainframe/JForm.java

@ -220,14 +220,19 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
} }
}); });
formDesign.addDesignerEditListener(new DesignerEditListener() { formDesign.addDesignerEditListener(new DesignerEditListener() {
private XComponent lastAffectedCreator;
@Override @Override
public void fireCreatorModified(DesignerEvent evt) { public void fireCreatorModified(DesignerEvent evt) {
if (evt.getCreatorEventID() == DesignerEvent.CREATOR_CUTED if (evt.getCreatorEventID() == DesignerEvent.CREATOR_CUTED
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED) { || evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED) {
setPropertyPaneChange(formDesign.getRootComponent()); setPropertyPaneChange(formDesign.getRootComponent());
} else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) { } else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) {
setPropertyPaneChange(evt.getAffectedCreator()); // 防止多次触发
if (lastAffectedCreator != null && lastAffectedCreator == evt.getAffectedCreator()) {
return;
}
lastAffectedCreator = evt.getAffectedCreator();
setPropertyPaneChange(lastAffectedCreator);
} }
} }
}); });
@ -648,11 +653,13 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
WidgetToolBarPane.getInstance(formDesign); WidgetToolBarPane.getInstance(formDesign);
if (BaseUtils.isAuthorityEditing()) { if (BaseUtils.isAuthorityEditing()) {
if (formDesign.isSupportAuthority()) { if (formDesign.isSupportAuthority()) {
EastRegionContainerPane.getInstance().replaceUpPane(new AuthorityPropertyPane(this)); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new AuthorityPropertyPane(this));
} else { } else {
EastRegionContainerPane.getInstance().replaceUpPane(new NoSupportAuthorityEdit()); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION_DISABLED);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new NoSupportAuthorityEdit());
} }
EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
return; return;
} }

21
designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java

@ -4,10 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.*;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.properties.EventPropertyTable; import com.fr.design.designer.properties.EventPropertyTable;
import com.fr.design.designer.properties.WidgetPropertyTable; import com.fr.design.designer.properties.WidgetPropertyTable;
import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.fun.WidgetPropertyUIProvider;
@ -130,9 +127,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
private void createEventTable() { private void createEventTable() {
eventTable = new EventPropertyTable(designer); eventTable = new EventPropertyTable(designer);
designer.addDesignerEditListener(new EventPropertyDesignerAdapter(eventTable)); designer.addDesignerEditListener(new EventPropertyDesignerAdapter(eventTable));
eventTable.setBorder(null);
esp = new UIScrollPane(eventTable); //用来装载事件table
esp.setBorder(null);
} }
/** /**
@ -242,7 +236,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
tabbedPane.setBorder(null); tabbedPane.setBorder(null);
tabbedPane.setTabPlacement(SwingConstants.BOTTOM); tabbedPane.setTabPlacement(SwingConstants.BOTTOM);
tabbedPane.addTab(Inter.getLocText("FR-Designer_Properties"), psp); tabbedPane.addTab(Inter.getLocText("FR-Designer_Properties"), psp);
tabbedPane.addTab(Inter.getLocText("FR-Designer_Event"), esp); tabbedPane.addTab(Inter.getLocText("FR-Designer_Event"), eventTable);
tabbedPane.addTab(Inter.getLocText("FR-Widget_Mobile_Terminal"), wsp); tabbedPane.addTab(Inter.getLocText("FR-Widget_Mobile_Terminal"), wsp);
} }
@ -314,6 +308,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
*/ */
private class EventPropertyDesignerAdapter implements DesignerEditListener { private class EventPropertyDesignerAdapter implements DesignerEditListener {
EventPropertyTable propertyTable; EventPropertyTable propertyTable;
private XComponent lastAffectedCreator;
EventPropertyDesignerAdapter(EventPropertyTable eventTable) { EventPropertyDesignerAdapter(EventPropertyTable eventTable) {
this.propertyTable = eventTable; this.propertyTable = eventTable;
@ -321,8 +316,14 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
@Override @Override
public void fireCreatorModified(DesignerEvent evt) { public void fireCreatorModified(DesignerEvent evt) {
if (evt.getCreatorEventID() == DesignerEvent.CREATOR_EDITED if (evt.getCreatorEventID() == DesignerEvent.CREATOR_EDITED) {
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) { propertyTable.refresh();
} else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) {
// 防止多次触发
if (lastAffectedCreator != null && lastAffectedCreator == evt.getAffectedCreator()) {
return;
}
lastAffectedCreator = evt.getAffectedCreator();
propertyTable.refresh(); propertyTable.refresh();
} }
} }

Loading…
Cancel
Save