forked from fanruan/design
fanglei
8 years ago
5 changed files with 153 additions and 69 deletions
@ -1,56 +0,0 @@
|
||||
package com.fr.design.dialog.mobile; |
||||
|
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.general.Inter; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* Created by fanglei on 2016/11/14. |
||||
* 这个toolbar类需要被design和design_form两个模块复用,所以为了结构精简,抽出共同方法作为抽象类供它们使用 |
||||
*/ |
||||
public abstract class MobileToolBarBeanPane<T> extends BasicBeanPane<T> { |
||||
//缩放选项面板
|
||||
private MobileRadioCheckPane zoomCheckPane; |
||||
|
||||
//刷新选项面板
|
||||
private MobileRadioCheckPane refreshCheckPane; |
||||
|
||||
public MobileRadioCheckPane getZoomCheckPane() { |
||||
return zoomCheckPane; |
||||
} |
||||
|
||||
public MobileRadioCheckPane getRefreshCheckPane() { |
||||
return refreshCheckPane; |
||||
} |
||||
|
||||
public MobileToolBarBeanPane() { |
||||
initComponents(); |
||||
} |
||||
|
||||
private void initComponents() { |
||||
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow()); |
||||
JPanel toobarsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
|
||||
UILabel uiLabel = new UILabel("html5"); |
||||
uiLabel.setBorder(BorderFactory.createEmptyBorder(5, 15, 10, 15)); |
||||
zoomCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Zoom")); |
||||
refreshCheckPane = new MobileRadioCheckPane("刷新"); |
||||
|
||||
toobarsPane.add(uiLabel, BorderLayout.WEST); |
||||
toobarsPane.add(zoomCheckPane, BorderLayout.CENTER); |
||||
toobarsPane.add(refreshCheckPane, BorderLayout.EAST); |
||||
borderPane.add(toobarsPane); |
||||
this.add(borderPane); |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return "工具栏"; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,53 @@
|
||||
package com.fr.design.form.mobile; |
||||
|
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.general.Inter; |
||||
import com.fr.report.mobile.ElementCaseMobileAttr; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* Created by fanglei on 2016/11/17. |
||||
*/ |
||||
public class FormMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{ |
||||
//工具栏容器
|
||||
private MobileToolBarPane mobileToolBarPane; |
||||
|
||||
public FormMobileAttrPane() { |
||||
this.initComponents(); |
||||
} |
||||
|
||||
private void initComponents() { |
||||
JPanel jPanel = new JPanel(); |
||||
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); |
||||
jPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
this.mobileToolBarPane = new MobileToolBarPane(); |
||||
//设置一个JPanel包裹mobileToolBarPane这个Panel,让jPanel的高度等于mobileToolBarPane高度加10,再放入this中
|
||||
jPanel.setPreferredSize(new Dimension(0, (int)this.mobileToolBarPane.getPreferredSize().getHeight() + 10)); |
||||
jPanel.add("North", mobileToolBarPane); |
||||
this.add(jPanel); |
||||
} |
||||
|
||||
@Override |
||||
public void populateBean(ElementCaseMobileAttr ob) { |
||||
if (ob == null) { |
||||
ob = new ElementCaseMobileAttr(); |
||||
} |
||||
this.mobileToolBarPane.populateBean(ob); |
||||
} |
||||
|
||||
@Override |
||||
public ElementCaseMobileAttr updateBean() { |
||||
ElementCaseMobileAttr caseMobileAttr = new ElementCaseMobileAttr(); |
||||
this.mobileToolBarPane.updateBean(caseMobileAttr); |
||||
return caseMobileAttr; |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return Inter.getLocText("FR-Designer_Mobile-Attr"); |
||||
} |
||||
} |
Loading…
Reference in new issue