xiaoxia 8 years ago
parent
commit
989358cf8b
  1. 42
      designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java
  2. 11
      designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java
  3. 1
      designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java

42
designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -47,7 +47,7 @@ public class FormWidgetDetailPane extends FormDockView{
private UITabbedPane tabbedPane; private UITabbedPane tabbedPane;
private UIScrollPane downPanel; private UIScrollPane downPanel;
private JPanel reuWidgetPanel; private JPanel esp;
private UIComboBox comboBox; private UIComboBox comboBox;
private ElCaseBindInfo[] elCaseBindInfoList; private ElCaseBindInfo[] elCaseBindInfoList;
private UIButton downloadButton; private UIButton downloadButton;
@ -95,21 +95,14 @@ public class FormWidgetDetailPane extends FormDockView{
clearDockingView(); clearDockingView();
return; return;
} }
esp = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel esp = FRGUIPaneFactory.createBorderLayout_S_Pane();
esp.setBorder(null); esp.setBorder(null);
if (elCaseBindInfoList == null) { if (elCaseBindInfoList == null) {
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList();
} }
initReuWidgetPanel(); initReuWidgetPanel();
esp.add(reuWidgetPanel, BorderLayout.CENTER);
createDownloadButton(); createDownloadButton();
JPanel widgetPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); initMenuPanel();
widgetPane.setBorder(BorderFactory.createEmptyBorder(3, 10, 3, 3));
widgetPane.add(new UILabel(Inter.getLocText("FR-Designer_LocalWidget"),
SwingConstants.HORIZONTAL), BorderLayout.WEST);
widgetPane.add(downloadButton, BorderLayout.EAST);
esp.add(widgetPane,BorderLayout.NORTH);
tabbedPane = new UITabbedPane(); tabbedPane = new UITabbedPane();
tabbedPane.setOpaque(true); tabbedPane.setOpaque(true);
tabbedPane.setBorder(null); tabbedPane.setBorder(null);
@ -124,16 +117,25 @@ public class FormWidgetDetailPane extends FormDockView{
* 初始化组件共享和复用面板 * 初始化组件共享和复用面板
*/ */
private void initReuWidgetPanel() { private void initReuWidgetPanel() {
int rowCount = (elCaseBindInfoList.length + 1)/2;
downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList)); downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList));
downPanel.setPreferredSize(new Dimension(236, rowCount * 82)); esp.add(downPanel);
reuWidgetPanel = new JPanel(); }
/**
* 初始化菜单栏面板
*/
private void initMenuPanel() {
JPanel menutPane = new JPanel();
menutPane.setLayout(FRGUIPaneFactory.createBorderLayout());
menutPane.setBorder(BorderFactory.createEmptyBorder(3, 6, 3, 3));
menutPane.add(new UILabel(Inter.getLocText("FR-Designer_LocalWidget"),
SwingConstants.HORIZONTAL), BorderLayout.WEST);
menutPane.add(downloadButton, BorderLayout.EAST);
comboBox = new UIComboBox(getFormCategories()); comboBox = new UIComboBox(getFormCategories());
comboBox.setPreferredSize(new Dimension(236, 30)); comboBox.setPreferredSize(new Dimension(240, 30));
initComboBoxSelectedListener(); initComboBoxSelectedListener();
reuWidgetPanel.add(comboBox, BorderLayout.NORTH); menutPane.add(comboBox, BorderLayout.SOUTH);
reuWidgetPanel.add(downPanel, BorderLayout.CENTER); esp.add(menutPane,BorderLayout.NORTH);
reuWidgetPanel.setBorder(new LineBorder(Color.gray));
} }
private void initComboBoxSelectedListener() { private void initComboBoxSelectedListener() {
@ -144,7 +146,7 @@ public class FormWidgetDetailPane extends FormDockView{
if (filterIndex == 0) { if (filterIndex == 0) {
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList();
} else { } else {
String filterName = (String) e.getItem(); String filterName = comboBox.getSelectedItem().toString();
elCaseBindInfoList = ShareLoader.getLoader().getFilterBindInfoList(filterName); elCaseBindInfoList = ShareLoader.getLoader().getFilterBindInfoList(filterName);
} }
refreshDownPanel(); refreshDownPanel();
@ -191,10 +193,10 @@ public class FormWidgetDetailPane extends FormDockView{
public void refreshDownPanel() { public void refreshDownPanel() {
reuWidgetPanel.remove(downPanel); esp.remove(downPanel);
downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList)); downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList));
//todo:这个地方有问题 //todo:这个地方有问题
reuWidgetPanel.add(downPanel); esp.add(downPanel);
repaintContainer(); repaintContainer();
} }

11
designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.design.form.layout.FRGridLayout;
import com.fr.form.ui.ElCaseBindInfo; import com.fr.form.ui.ElCaseBindInfo;
@ -16,16 +17,14 @@ import java.util.List;
public class ShareWidgetPane extends JPanel { public class ShareWidgetPane extends JPanel {
public ShareWidgetPane(ElCaseBindInfo[] elCaseBindInfoList) { public ShareWidgetPane(ElCaseBindInfo[] elCaseBindInfoList) {
this.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));// 设置面板的边框 ,距离上、左、下、右 的距离 this.setBorder(BorderFactory.createEmptyBorder(5, 2, 0, 0));// 设置面板的边框 ,距离上、左、下、右 的距离
int rowCount = (elCaseBindInfoList.length + 1)/2; int rowCount = (elCaseBindInfoList.length + 1) / 2;
this.setLayout(new GridLayout(rowCount, 2, 10, 10)); this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
for (ElCaseBindInfo rbModuleInfo : elCaseBindInfoList) { for (ElCaseBindInfo rbModuleInfo : elCaseBindInfoList) {
ShareWidgetButton widgetButton = new ShareWidgetButton(rbModuleInfo); ShareWidgetButton widgetButton = new ShareWidgetButton(rbModuleInfo);
this.add(widgetButton); this.add(widgetButton);
} }
if (elCaseBindInfoList.length == 1) { this.setPreferredSize(new Dimension(240, rowCount * 80));
this.add(new JPanel());
}
} }

1
designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java

@ -15,6 +15,7 @@ import com.fr.design.designer.beans.*;
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.XCreator;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.ComponentTree; import com.fr.design.mainframe.ComponentTree;
import com.sun.java.swing.plaf.motif.*; import com.sun.java.swing.plaf.motif.*;
import com.sun.java.swing.plaf.windows.*; import com.sun.java.swing.plaf.windows.*;

Loading…
Cancel
Save