fanglei
8 years ago
10 changed files with 214 additions and 29 deletions
@ -0,0 +1,32 @@
|
||||
package com.fr.design.report.mobile; |
||||
|
||||
import com.fr.design.dialog.mobile.MobileToolBarBeanPane; |
||||
import com.fr.report.mobile.ElementCaseMobileAttr; |
||||
|
||||
/** |
||||
* Created by 方磊 on 2016/11/8. |
||||
*/ |
||||
public class MobileToolBarPane extends MobileToolBarBeanPane<ElementCaseMobileAttr> { |
||||
|
||||
@Override |
||||
public void populateBean(ElementCaseMobileAttr ob) { |
||||
if (ob == null) { |
||||
ob = new ElementCaseMobileAttr(); |
||||
} |
||||
super.getZoomCheckPane().populateBean(ob.isZoom()); |
||||
super.getRefreshCheckPane().populateBean(ob.isRefresh()); |
||||
} |
||||
|
||||
@Override |
||||
public ElementCaseMobileAttr updateBean() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public void updateBean(ElementCaseMobileAttr mobileAttr) { |
||||
if(mobileAttr != null) { |
||||
mobileAttr.setZoom(super.getZoomCheckPane().updateBean()); |
||||
mobileAttr.setRefresh(super.getRefreshCheckPane().updateBean()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,56 @@
|
||||
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,32 @@
|
||||
package com.fr.design.form.mobile; |
||||
|
||||
import com.fr.design.dialog.mobile.MobileToolBarBeanPane; |
||||
import com.fr.report.mobile.ElementCaseMobileAttr; |
||||
|
||||
/** |
||||
* Created by 方磊 on 2016/11/8. |
||||
*/ |
||||
public class MobileToolBarPane extends MobileToolBarBeanPane<ElementCaseMobileAttr> { |
||||
|
||||
@Override |
||||
public void populateBean(ElementCaseMobileAttr ob) { |
||||
if (ob == null) { |
||||
ob = new ElementCaseMobileAttr(); |
||||
} |
||||
super.getZoomCheckPane().populateBean(ob.isZoom()); |
||||
super.getRefreshCheckPane().populateBean(ob.isRefresh()); |
||||
} |
||||
|
||||
@Override |
||||
public ElementCaseMobileAttr updateBean() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public void updateBean(ElementCaseMobileAttr mobileAttr) { |
||||
if(mobileAttr != null) { |
||||
mobileAttr.setZoom(super.getZoomCheckPane().updateBean()); |
||||
mobileAttr.setRefresh(super.getRefreshCheckPane().updateBean()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,56 @@
|
||||
package com.fr.design.mainframe.actions; |
||||
|
||||
import com.fr.base.BaseUtils; |
||||
import com.fr.design.actions.JTemplateAction; |
||||
import com.fr.design.mainframe.JForm; |
||||
import com.fr.design.menu.MenuKeySet; |
||||
import com.fr.form.main.Form; |
||||
import com.fr.report.mobile.ElementCaseMobileAttr; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.event.ActionEvent; |
||||
|
||||
/** |
||||
* Created by fanglei on 2016/11/14. |
||||
*/ |
||||
public class FormMobileAttrAction extends JTemplateAction<JForm> { |
||||
|
||||
public FormMobileAttrAction(JForm jf) { |
||||
super(jf); |
||||
this.setMenuKeySet(REPORT_APP_ATTR); |
||||
this.setName(getMenuKeySet().getMenuKeySetName() + "..."); |
||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/mobile.png")); |
||||
} |
||||
|
||||
/** |
||||
* 执行动作 |
||||
* |
||||
* @return 是否执行成功 |
||||
*/ |
||||
@Override |
||||
public void actionPerformed(ActionEvent e) { |
||||
final JForm jf = getEditingComponent(); |
||||
if (jf == null) { |
||||
return; |
||||
} |
||||
final Form formTpl = jf.getTarget(); |
||||
} |
||||
|
||||
private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() { |
||||
@Override |
||||
public char getMnemonic() { |
||||
return 'T'; |
||||
} |
||||
|
||||
@Override |
||||
public String getMenuName() { |
||||
return "移动端属性"; |
||||
} |
||||
|
||||
@Override |
||||
public KeyStroke getKeyStroke() { |
||||
return null; |
||||
} |
||||
}; |
||||
} |
Loading…
Reference in new issue