plough 8 years ago
parent
commit
00c41517c6
  1. 121
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  2. 4
      designer_base/src/com/fr/design/locale/designer.properties

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

@ -20,24 +20,28 @@ import java.awt.*;
* carl :单独弄出来 * carl :单独弄出来
*/ */
public class CellWidgetCardPane extends BasicPane { public class CellWidgetCardPane extends BasicPane {
// 当前的编辑器属性定义面板 //当前的编辑器属性定义面板
private DataModify<? extends Widget> currentEditorDefinePane; private DataModify<? extends Widget> currentEditorDefinePane;
//属性配置切换面板
private JTabbedPane tabbedPane; private JTabbedPane tabbedPane;
private BasicWidgetPropertySettingPane widgetPropertyPane; private BasicWidgetPropertySettingPane widgetPropertyPane;
private JPanel attriPane;
private JPanel cardPane;
private CardLayout card;
private JPanel presPane; //通用属性容器
private JPanel cardPaneForPresent; private JPanel attriTabPane;
private CardLayout cardForPresent; private JPanel attriCardPane;
private CardLayout attriCardLayout;
//数字字典属性容器
private JPanel dictTabPane;
private JPanel dictCardPane;
private CardLayout dictCardLayout;
private JPanel cardPaneForTreeSetting; //构建树属性容器
private JPanel treeTabPane;
private JPanel formPane; //事件属性容器
private WidgetEventPane eventTabPane; private JPanel eventTabPane;
private WidgetEventPane eventPane;
public CellWidgetCardPane(ElementCasePane pane) { public CellWidgetCardPane(ElementCasePane pane) {
this.initComponents(pane); this.initComponents(pane);
@ -47,26 +51,26 @@ public class CellWidgetCardPane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
tabbedPane = new UITabbedPane(); tabbedPane = new UITabbedPane();
this.add(tabbedPane, BorderLayout.CENTER); this.add(tabbedPane, BorderLayout.CENTER);
attriPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
formPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); eventTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
eventTabPane = new WidgetEventPane(pane); eventPane = new WidgetEventPane(pane);
formPane.add(eventTabPane, BorderLayout.CENTER); eventTabPane.add(eventPane, BorderLayout.CENTER);
tabbedPane.add(Inter.getLocText("FR-Designer_Attribute"), attriPane); tabbedPane.add(Inter.getLocText("FR-Designer_Attribute"), attriTabPane);
tabbedPane.add(Inter.getLocText("FR-Designer_Form_Editing_Listeners"), formPane); tabbedPane.add(Inter.getLocText("FR-Designer_Form_Editing_Listeners"), eventTabPane);
presPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); dictTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
cardPaneForPresent = FRGUIPaneFactory.createCardLayout_S_Pane(); dictCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
presPane.add(cardPaneForPresent, BorderLayout.CENTER); dictTabPane.add(dictCardPane, BorderLayout.CENTER);
cardForPresent = new CardLayout(); dictCardLayout = new CardLayout();
cardPaneForPresent.setLayout(cardForPresent); dictCardPane.setLayout(dictCardLayout);
cardPaneForTreeSetting = FRGUIPaneFactory.createBorderLayout_L_Pane(); treeTabPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
widgetPropertyPane = new BasicWidgetPropertySettingPane(); widgetPropertyPane = new BasicWidgetPropertySettingPane();
attriPane.add(widgetPropertyPane, BorderLayout.NORTH); attriTabPane.add(widgetPropertyPane, BorderLayout.NORTH);
cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); attriCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
attriPane.add(cardPane, BorderLayout.CENTER); attriTabPane.add(attriCardPane, BorderLayout.CENTER);
card = (CardLayout) cardPane.getLayout(); attriCardLayout = (CardLayout) attriCardPane.getLayout();
this.setPreferredSize(new Dimension(600, 450)); this.setPreferredSize(new Dimension(600, 450));
} }
@ -84,49 +88,53 @@ public class CellWidgetCardPane extends BasicPane {
this.tabbedPane.setEnabled(true); this.tabbedPane.setEnabled(true);
} }
attriPane.remove(widgetPropertyPane); attriTabPane.remove(widgetPropertyPane);
widgetPropertyPane = new BasicWidgetPropertySettingPane(); widgetPropertyPane = new BasicWidgetPropertySettingPane();
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 0, 8)); northPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 0, 8));
JPanel basic = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Form_Basic_Properties")); JPanel basic = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Form_Basic_Properties"));
northPane.add(basic); northPane.add(basic);
basic.add(widgetPropertyPane); basic.add(widgetPropertyPane);
attriPane.add(northPane, BorderLayout.NORTH); attriTabPane.add(northPane, BorderLayout.NORTH);
WidgetDefinePaneFactory.RN rn = WidgetDefinePaneFactory.createWidgetDefinePane(cellWidget, new Operator() { WidgetDefinePaneFactory.RN rn = WidgetDefinePaneFactory.createWidgetDefinePane(cellWidget, new Operator() {
@Override @Override
public void did(DataCreatorUI ui, String cardName) { public void did(DataCreatorUI ui, String cardName) {
if (ui == null) { if (ui == null) {
addPresPane(false); removeDictAttriPane();
addTreeSettingPane(false); removeTreeAttriPane();
} }
if (ui instanceof DictionaryPane) { if (ui instanceof DictionaryPane) {
removeDictAttriPane();
removeTreeAttriPane();
showDictPane(ui, cardName); showDictPane(ui, cardName);
} else if (ui instanceof TreeSettingPane) { } else if (ui instanceof TreeSettingPane) {
removeDictAttriPane();
removeTreeAttriPane();
showTreePane(ui); showTreePane(ui);
} }
} }
}); });
DataModify<? extends Widget> definePane = rn.getDefinePane(); DataModify<? extends Widget> definePane = rn.getDefinePane();
cardPane.add(definePane.toSwingComponent(), rn.getCardName()); attriCardPane.add(definePane.toSwingComponent(), rn.getCardName());
card.show(cardPane, rn.getCardName()); attriCardLayout.show(attriCardPane, rn.getCardName());
currentEditorDefinePane = definePane; currentEditorDefinePane = definePane;
eventTabPane.populate(cellWidget); eventPane.populate(cellWidget);
widgetPropertyPane.populate(cellWidget); widgetPropertyPane.populate(cellWidget);
tabbedPane.setSelectedIndex(0); tabbedPane.setSelectedIndex(0);
} }
private void showDictPane(DataCreatorUI ui, String cardName) { private void showDictPane(DataCreatorUI ui, String cardName) {
cardPaneForPresent.removeAll(); dictCardPane.removeAll();
cardPaneForPresent.add(ui.toSwingComponent(), cardName); dictCardPane.add(ui.toSwingComponent(), cardName);
cardForPresent.show(cardPaneForPresent, cardName); dictCardLayout.show(dictCardPane, cardName);
addPresPane(true); addDictAttriPane();
} }
private void showTreePane(DataCreatorUI ui) { private void showTreePane(DataCreatorUI ui) {
cardPaneForTreeSetting.removeAll(); treeTabPane.removeAll();
cardPaneForTreeSetting.add(ui.toSwingComponent()); treeTabPane.add(ui.toSwingComponent());
addTreeSettingPane(true); addTreeAttriPane();
} }
public Widget update() { public Widget update() {
@ -139,7 +147,7 @@ public class CellWidgetCardPane extends BasicPane {
} }
widgetPropertyPane.update(widget); widgetPropertyPane.update(widget);
Listener[] listener = eventTabPane == null ? new Listener[0] : eventTabPane.updateListeners(); Listener[] listener = eventPane == null ? new Listener[0] : eventPane.updateListeners();
widget.clearListeners(); widget.clearListeners();
for (Listener l : listener) { for (Listener l : listener) {
widget.addListener(l); widget.addListener(l);
@ -155,25 +163,26 @@ public class CellWidgetCardPane extends BasicPane {
*/ */
public void checkValid() throws Exception { public void checkValid() throws Exception {
currentEditorDefinePane.checkValid(); currentEditorDefinePane.checkValid();
eventTabPane.checkValid(); eventPane.checkValid();
} }
//:jackie 如果选择的项有形态,则将形态面板加入tab面板
private void addPresPane(boolean add) { private void addDictAttriPane() {
if (add) { tabbedPane.add(this.dictTabPane, 1);
tabbedPane.add(this.presPane, 1);
tabbedPane.setTitleAt(1, Inter.getLocText("FR-Designer_DS_Dictionary")); tabbedPane.setTitleAt(1, Inter.getLocText("FR-Designer_DS_Dictionary"));
} else {
tabbedPane.remove(presPane);
}
} }
private void addTreeSettingPane(boolean add) { private void addTreeAttriPane() {
if (add) { tabbedPane.add(this.treeTabPane, 1);
tabbedPane.add(this.cardPaneForTreeSetting, 1);
tabbedPane.setTitleAt(1, Inter.getLocText("FR-Designer_Create_Tree")); tabbedPane.setTitleAt(1, Inter.getLocText("FR-Designer_Create_Tree"));
} else {
tabbedPane.remove(this.cardPaneForTreeSetting);
} }
private void removeDictAttriPane() {
tabbedPane.remove(this.dictTabPane);
} }
private void removeTreeAttriPane() {
tabbedPane.remove(this.treeTabPane);
}
} }

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

@ -505,8 +505,8 @@ FR-Designer_JavaScript_Set=
FR-Designer_Attribute= FR-Designer_Attribute=
FR-Designer_Form_Editing_Listeners= FR-Designer_Form_Editing_Listeners=
FR-Designer_Form_Basic_Properties= FR-Designer_Form_Basic_Properties=
FR-Designer_DS_Dictionary= FR-Designer_DS_Dictionary=Data Dictionary
FR-Designer_Create_Tree= FR-Designer_Create_Tree=Build Tree
FR-Designer_Set_Callback_Function= FR-Designer_Set_Callback_Function=
FR-Designer_ConfirmDialog_Content= FR-Designer_ConfirmDialog_Content=
FR-Designer_ConfirmDialog_Title= FR-Designer_ConfirmDialog_Title=

Loading…
Cancel
Save