@ -0,0 +1,35 @@ |
|||||||
|
package com.fr.design.report; |
||||||
|
|
||||||
|
import com.fr.design.beans.BasicBeanPane; |
||||||
|
import com.fr.design.layout.FRGUIPaneFactory; |
||||||
|
import com.fr.report.write.ValueVerifier; |
||||||
|
|
||||||
|
import java.awt.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by richie on 16/6/12. |
||||||
|
*/ |
||||||
|
public class BuildInVerifierPane extends BasicBeanPane<ValueVerifier> { |
||||||
|
private ValueVerifierEditPane valueVerifierEditPane; |
||||||
|
|
||||||
|
public BuildInVerifierPane() { |
||||||
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||||
|
valueVerifierEditPane = new ValueVerifierEditPane(); |
||||||
|
this.add(valueVerifierEditPane, BorderLayout.CENTER); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void populateBean(ValueVerifier ob) { |
||||||
|
valueVerifierEditPane.populate(ob); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public ValueVerifier updateBean() { |
||||||
|
return valueVerifierEditPane.update(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected String title4PopupWindow() { |
||||||
|
return "BuiltIn"; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,37 @@ |
|||||||
|
package com.fr.design.report; |
||||||
|
|
||||||
|
import com.fr.design.beans.BasicBeanPane; |
||||||
|
import com.fr.design.layout.FRGUIPaneFactory; |
||||||
|
import com.fr.report.write.WClassVerifier; |
||||||
|
|
||||||
|
import java.awt.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by richie on 16/6/12. |
||||||
|
*/ |
||||||
|
public class CustomVerifierPane extends BasicBeanPane<WClassVerifier> { |
||||||
|
private CustomVerifyJobPane pane; |
||||||
|
|
||||||
|
public CustomVerifierPane() { |
||||||
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||||
|
pane = new CustomVerifyJobPane(); |
||||||
|
this.add(pane, BorderLayout.CENTER); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void populateBean(WClassVerifier ob) { |
||||||
|
this.pane.populateBean(ob.getClassVerifyJob()); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public WClassVerifier updateBean() { |
||||||
|
WClassVerifier verifier = new WClassVerifier(); |
||||||
|
verifier.setClassVerifyJob(this.pane.updateBean()); |
||||||
|
return verifier; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected String title4PopupWindow() { |
||||||
|
return "custom"; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,94 @@ |
|||||||
|
package com.fr.design.report.mobile; |
||||||
|
|
||||||
|
import com.fr.base.mobile.MobileFitAttrState; |
||||||
|
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.*; |
||||||
|
import java.awt.event.ActionEvent; |
||||||
|
import java.awt.event.ActionListener; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by 夏翔 on 2016/5/28. |
||||||
|
*/ |
||||||
|
public class AppFitBrowserPane extends BasicBeanPane<ElementCaseMobileAttr> { |
||||||
|
//横屏设置面板
|
||||||
|
private MobileRadioGroupPane horizionPane; |
||||||
|
//竖屏设置面板
|
||||||
|
private MobileRadioGroupPane verticalPane; |
||||||
|
//缩放选项面板
|
||||||
|
private MobileRadioCheckPane radioCheckPane; |
||||||
|
//效果预览面板
|
||||||
|
private AppFitPreviewPane appFitPreviewPane; |
||||||
|
|
||||||
|
|
||||||
|
public AppFitBrowserPane(){ |
||||||
|
initComponents(); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
private void initComponents() { |
||||||
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||||
|
JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow()); |
||||||
|
JPanel fitOpsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||||
|
horizionPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Horizontal")); |
||||||
|
verticalPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Vertical")); |
||||||
|
radioCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Zoom")); |
||||||
|
ActionListener actionListener = getAppPreviewActionListener(); |
||||||
|
horizionPane.addActionListener(actionListener); |
||||||
|
verticalPane.addActionListener(actionListener); |
||||||
|
fitOpsPane.add(horizionPane, BorderLayout.NORTH); |
||||||
|
fitOpsPane.add(verticalPane, BorderLayout.CENTER); |
||||||
|
fitOpsPane.add(radioCheckPane, BorderLayout.SOUTH); |
||||||
|
borderPane.add(fitOpsPane); |
||||||
|
this.add(borderPane); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public void setAppFitPreviewPane(AppFitPreviewPane appFitPreviewPane) { |
||||||
|
this.appFitPreviewPane = appFitPreviewPane; |
||||||
|
} |
||||||
|
|
||||||
|
//纵向和横向独立设置
|
||||||
|
public int[] getCurrentFitOptions() { |
||||||
|
return new int[]{horizionPane.getSelectRadioIndex(), verticalPane.getSelectRadioIndex(), radioCheckPane.getCurrentState()}; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void populateBean(ElementCaseMobileAttr ob) { |
||||||
|
if (ob == null) { |
||||||
|
ob = new ElementCaseMobileAttr(); |
||||||
|
} |
||||||
|
horizionPane.populateBean(ob.getHorziontalAttr()); |
||||||
|
verticalPane.populateBean(ob.getVerticalAttr()); |
||||||
|
radioCheckPane.populateBean(ob.isZoom()); |
||||||
|
appFitPreviewPane.refreshPreview(getCurrentFitOptions()); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public ElementCaseMobileAttr updateBean() { |
||||||
|
MobileFitAttrState horizonState = horizionPane.updateBean(); |
||||||
|
MobileFitAttrState verticalState = verticalPane.updateBean(); |
||||||
|
boolean isZoom = radioCheckPane.updateBean(); |
||||||
|
return new ElementCaseMobileAttr(horizonState, verticalState, isZoom); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected String title4PopupWindow() { |
||||||
|
return Inter.getLocText("FR-Designer_Fit-App"); |
||||||
|
} |
||||||
|
|
||||||
|
private ActionListener getAppPreviewActionListener() { |
||||||
|
return new ActionListener() { |
||||||
|
@Override |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
int[] fitOptions = getCurrentFitOptions(); |
||||||
|
appFitPreviewPane.refreshPreview(fitOptions); |
||||||
|
} |
||||||
|
}; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,71 @@ |
|||||||
|
package com.fr.design.report.mobile; |
||||||
|
|
||||||
|
import com.fr.design.dialog.BasicPane; |
||||||
|
import com.fr.design.gui.ilable.UILabel; |
||||||
|
import com.fr.design.layout.FRGUIPaneFactory; |
||||||
|
import com.fr.general.IOUtils; |
||||||
|
import com.fr.general.Inter; |
||||||
|
|
||||||
|
import javax.swing.*; |
||||||
|
import java.util.ArrayList; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by 夏翔 on 2016/5/28. |
||||||
|
*/ |
||||||
|
public class AppFitPreviewPane extends BasicPane{ |
||||||
|
|
||||||
|
private UILabel horizontalImageLabel; |
||||||
|
|
||||||
|
private UILabel verticalImagelabel; |
||||||
|
|
||||||
|
private ArrayList<ImageIcon> cachedVerticalPreviewImage = new ArrayList<ImageIcon>(); |
||||||
|
|
||||||
|
private ArrayList<ImageIcon> cachedHorizonPreviewImage = new ArrayList<ImageIcon>(); |
||||||
|
|
||||||
|
|
||||||
|
public AppFitPreviewPane() { |
||||||
|
//初始化缓存图片
|
||||||
|
initCacheImage(); |
||||||
|
//初始化组件
|
||||||
|
initComponents(); |
||||||
|
} |
||||||
|
|
||||||
|
private void initCacheImage() { |
||||||
|
cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/V0.png"))); |
||||||
|
cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/V1.png"))); |
||||||
|
cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/V2.png"))); |
||||||
|
cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/V3.png"))); |
||||||
|
cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/H0.png"))); |
||||||
|
cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/H1.png"))); |
||||||
|
cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/H2.png"))); |
||||||
|
cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/H3.png"))); |
||||||
|
} |
||||||
|
|
||||||
|
private void initComponents() { |
||||||
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||||
|
|
||||||
|
JPanel outnorthPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow()); |
||||||
|
this.add(outnorthPane); |
||||||
|
|
||||||
|
horizontalImageLabel = new UILabel(); |
||||||
|
horizontalImageLabel.setIcon(cachedHorizonPreviewImage.get(1)); |
||||||
|
outnorthPane.add(horizontalImageLabel); |
||||||
|
|
||||||
|
verticalImagelabel = new UILabel(); |
||||||
|
verticalImagelabel.setIcon(cachedVerticalPreviewImage.get(0)); |
||||||
|
outnorthPane.add(verticalImagelabel); |
||||||
|
} |
||||||
|
|
||||||
|
public void refreshPreview(int[] index) { |
||||||
|
ImageIcon newHorizonImageIcon = cachedHorizonPreviewImage.get(index[0]) ; |
||||||
|
ImageIcon newVerticalImageIcon = cachedVerticalPreviewImage.get(index[1]); |
||||||
|
horizontalImageLabel.setIcon(newHorizonImageIcon); |
||||||
|
verticalImagelabel.setIcon(newVerticalImageIcon); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected String title4PopupWindow() { |
||||||
|
return Inter.getLocText("FR-Plugin_Preview"); |
||||||
|
} |
||||||
|
} |
@ -1,255 +1,255 @@ |
|||||||
package com.fr.design.write.submit; |
package com.fr.design.write.submit; |
||||||
|
|
||||||
import com.fr.data.SubmitJob; |
import com.fr.data.SubmitJob; |
||||||
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.fun.SubmitProvider; |
import com.fr.design.fun.SubmitProvider; |
||||||
import com.fr.design.gui.controlpane.NameObjectCreator; |
import com.fr.design.gui.controlpane.NameObjectCreator; |
||||||
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.controlpane.ObjectJControlPane; |
||||||
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.layout.FRGUIPaneFactory; |
import com.fr.design.layout.FRGUIPaneFactory; |
||||||
import com.fr.design.mainframe.ElementCasePane; |
import com.fr.design.mainframe.ElementCasePane; |
||||||
import com.fr.design.scrollruler.ModLineBorder; |
import com.fr.design.scrollruler.ModLineBorder; |
||||||
import com.fr.design.utils.gui.GUICoreUtils; |
import com.fr.design.utils.gui.GUICoreUtils; |
||||||
import com.fr.general.ComparatorUtils; |
import com.fr.general.ComparatorUtils; |
||||||
import com.fr.general.FRLogger; |
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.report.write.SubmitVisitor; |
import com.fr.report.write.BuiltInSQLSubmiter; |
||||||
import com.fr.stable.ArrayUtils; |
import com.fr.report.write.ReportWriteAttr; |
||||||
import com.fr.stable.Nameable; |
import com.fr.report.write.SubmitVisitor; |
||||||
import com.fr.stable.bridge.StableFactory; |
import com.fr.report.write.WClassSubmiter; |
||||||
import com.fr.write.BuiltInSQLSubmiterProvider; |
import com.fr.stable.ArrayUtils; |
||||||
import com.fr.write.DBManipulation; |
import com.fr.stable.Nameable; |
||||||
import com.fr.write.ReportWriteAttrProvider; |
import com.fr.write.BuiltInSQLSubmiterProvider; |
||||||
import com.fr.write.WClassSubmiterProvider; |
import com.fr.write.DBManipulation; |
||||||
|
import com.fr.write.WClassSubmiterProvider; |
||||||
import javax.swing.*; |
|
||||||
import java.awt.*; |
import javax.swing.*; |
||||||
import java.awt.event.ItemEvent; |
import java.awt.*; |
||||||
import java.awt.event.ItemListener; |
import java.awt.event.ItemEvent; |
||||||
import java.util.ArrayList; |
import java.awt.event.ItemListener; |
||||||
import java.util.HashMap; |
import java.util.ArrayList; |
||||||
import java.util.List; |
import java.util.HashMap; |
||||||
import java.util.Map; |
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
public class SubmiterListPane extends ObjectJControlPane { |
|
||||||
|
public class SubmitVisitorListPane extends ObjectJControlPane { |
||||||
public SubmiterListPane(ElementCasePane ePane) { |
|
||||||
super(ePane); |
public SubmitVisitorListPane(ElementCasePane ePane) { |
||||||
} |
super(ePane); |
||||||
|
} |
||||||
/** |
|
||||||
* 创建选项 |
/** |
||||||
* |
* 创建选项 |
||||||
* @return 选项 |
* |
||||||
*/ |
* @return 选项 |
||||||
public NameableCreator[] createNameableCreators() { |
*/ |
||||||
return new NameableCreator[]{ |
public NameableCreator[] createNameableCreators() { |
||||||
new NameObjectCreator(Inter.getLocText("RWA-BuildIn_SQL"), |
return new NameableCreator[]{ |
||||||
"/com/fr/web/images/reportlet.png", |
new NameObjectCreator(Inter.getLocText("RWA-BuildIn_SQL"), |
||||||
// BuiltInSQLSubmiter.class,
|
"/com/fr/web/images/reportlet.png", |
||||||
StableFactory.getRegisteredClass(BuiltInSQLSubmiterProvider.TAG), |
BuiltInSQLSubmiter.class, |
||||||
BuildInSQLPane.class), |
BuildInSQLPane.class), |
||||||
new NameObjectCreator( |
new NameObjectCreator( |
||||||
Inter.getLocText(new String[]{"Custom", "RWA-Submit"}), |
Inter.getLocText(new String[]{"Custom", "RWA-Submit"}), |
||||||
"/com/fr/web/images/reportlet.png", |
"/com/fr/web/images/reportlet.png", |
||||||
// WClassSubmiter.class,
|
WClassSubmiter.class, |
||||||
StableFactory.getRegisteredClass(WClassSubmiterProvider.TAG), |
CustomPane.class) |
||||||
CustomPane.class) |
}; |
||||||
}; |
} |
||||||
} |
|
||||||
|
@Override |
||||||
@Override |
protected String title4PopupWindow() { |
||||||
protected String title4PopupWindow() { |
return "write"; |
||||||
return "write"; |
} |
||||||
} |
|
||||||
|
public void populate(ReportWriteAttr reportWriteAttr) { |
||||||
public void populate(ReportWriteAttrProvider reportWriteAttr) { |
if (reportWriteAttr == null) { |
||||||
if (reportWriteAttr == null) { |
return; |
||||||
return; |
} |
||||||
} |
|
||||||
|
List<NameObject> nameObjectList = new ArrayList<>(); |
||||||
List<NameObject> nameObjectList = new ArrayList<NameObject>(); |
|
||||||
|
int submiterCount = reportWriteAttr.getSubmitVisitorCount(); |
||||||
int submiterCount = reportWriteAttr.getSubmitVisitorCount(); |
for (int i = 0; i < submiterCount; i++) { |
||||||
for (int i = 0; i < submiterCount; i++) { |
SubmitVisitor visitor = reportWriteAttr.getSubmitVisitor(i); |
||||||
SubmitVisitor submiter = reportWriteAttr.getSubmitVisitor(i); |
nameObjectList.add(new NameObject(visitor.getName(), visitor)); |
||||||
String name = reportWriteAttr.getSubmitVisitorNameList(i); |
} |
||||||
nameObjectList.add(new NameObject(name, submiter)); |
|
||||||
} |
this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()])); |
||||||
|
} |
||||||
this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()])); |
|
||||||
} |
/** |
||||||
|
* 更新填报属性 |
||||||
/** |
* |
||||||
* 更新填报属性 |
* @param reportWriteAttr 报表填报属性 |
||||||
* |
*/ |
||||||
* @param reportWriteAttr 报表填报属性 |
public void updateReportWriteAttr(ReportWriteAttr reportWriteAttr) { |
||||||
*/ |
// Nameable[]居然不能强转成NameObject[],一定要这么写...
|
||||||
public void updateReportWriteAttr(ReportWriteAttrProvider reportWriteAttr) { |
Nameable[] res = this.update(); |
||||||
// Nameable[]居然不能强转成NameObject[],一定要这么写...
|
NameObject[] res_array = new NameObject[res.length]; |
||||||
Nameable[] res = this.update(); |
java.util.Arrays.asList(res).toArray(res_array); |
||||||
NameObject[] res_array = new NameObject[res.length]; |
|
||||||
java.util.Arrays.asList(res).toArray(res_array); |
reportWriteAttr.clearSubmitVisitors(); |
||||||
|
|
||||||
reportWriteAttr.clearSubmitVisitors(); |
for (int i = 0; i < res_array.length; i++) { |
||||||
|
NameObject nameObject = res_array[i]; |
||||||
for (int i = 0; i < res_array.length; i++) { |
if (nameObject.getObject() instanceof SubmitVisitor) { |
||||||
NameObject nameObject = res_array[i]; |
SubmitVisitor visitor = (SubmitVisitor) nameObject.getObject(); |
||||||
if (nameObject.getObject() instanceof SubmitVisitor) { |
visitor.setName(nameObject.getName()); |
||||||
reportWriteAttr.addSubmitVisitor(nameObject.getName(), (SubmitVisitor) nameObject.getObject()); |
reportWriteAttr.addSubmitVisitor(visitor); |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
public static class BuildInSQLPane extends BasicBeanPane<BuiltInSQLSubmiterProvider> { |
public static class BuildInSQLPane extends BasicBeanPane<BuiltInSQLSubmiterProvider> { |
||||||
protected DBManipulationPane dbManipulationPane; |
protected DBManipulationPane dbManipulationPane; |
||||||
private BuiltInSQLSubmiterProvider editing; |
private BuiltInSQLSubmiterProvider editing; |
||||||
|
|
||||||
public BuildInSQLPane() { |
public BuildInSQLPane() { |
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
public BuildInSQLPane(ElementCasePane ePane) { |
public BuildInSQLPane(ElementCasePane ePane) { |
||||||
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||||
dbManipulationPane = new SmartInsertDBManipulationPane(ePane); |
dbManipulationPane = new SmartInsertDBManipulationPane(ePane); |
||||||
this.add(dbManipulationPane, BorderLayout.CENTER); |
this.add(dbManipulationPane, BorderLayout.CENTER); |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
protected String title4PopupWindow() { |
protected String title4PopupWindow() { |
||||||
return "builtinsql"; |
return "builtinsql"; |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
public void populateBean(BuiltInSQLSubmiterProvider ob) { |
public void populateBean(BuiltInSQLSubmiterProvider ob) { |
||||||
editing = ob; |
editing = ob; |
||||||
|
|
||||||
DBManipulation dbManipulation = ob.getDBManipulation(); |
DBManipulation dbManipulation = ob.getDBManipulation(); |
||||||
dbManipulationPane.populateBean(dbManipulation); |
dbManipulationPane.populateBean(dbManipulation); |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
public BuiltInSQLSubmiterProvider updateBean() { |
public BuiltInSQLSubmiterProvider updateBean() { |
||||||
DBManipulation dbManipulation = dbManipulationPane.updateBean(); |
DBManipulation dbManipulation = dbManipulationPane.updateBean(); |
||||||
|
|
||||||
//复制对象用于撤销
|
//复制对象用于撤销
|
||||||
try{ |
try { |
||||||
editing = (BuiltInSQLSubmiterProvider)editing.clone(); |
editing = (BuiltInSQLSubmiterProvider) editing.clone(); |
||||||
}catch (Exception e){ |
} catch (Exception e) { |
||||||
FRLogger.getLogger().error(e.getMessage()); |
FRLogger.getLogger().error(e.getMessage()); |
||||||
} |
} |
||||||
editing.setDBManipulation(dbManipulation); |
editing.setDBManipulation(dbManipulation); |
||||||
|
|
||||||
return editing; |
return editing; |
||||||
} |
} |
||||||
|
|
||||||
/** |
/** |
||||||
* 检查是否符合规范 |
* 检查是否符合规范 |
||||||
* |
* |
||||||
* @throws Exception |
* @throws Exception |
||||||
*/ |
*/ |
||||||
public void checkValid() throws Exception { |
public void checkValid() throws Exception { |
||||||
this.dbManipulationPane.checkValid(); |
this.dbManipulationPane.checkValid(); |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
public static class CustomPane extends BasicBeanPane<WClassSubmiterProvider> { |
public static class CustomPane extends BasicBeanPane<WClassSubmiterProvider> { |
||||||
private UIComboBox csjConfigComboBox = null; |
private UIComboBox csjConfigComboBox = null; |
||||||
private JPanel customCardPane = null; |
private JPanel customCardPane = null; |
||||||
private Map<String, BasicBeanPane> customSubmitPanes = null; |
private Map<String, BasicBeanPane> customSubmitPanes = null; |
||||||
private final Map<String, String> comboItemsMap; |
private final Map<String, String> comboItemsMap; |
||||||
|
|
||||||
private List<String> configTypes = null; |
private List<String> configTypes = null; |
||||||
|
|
||||||
private WClassSubmiterProvider editing; |
private WClassSubmiterProvider editing; |
||||||
|
|
||||||
private static final String DEFAULT_PANE_TYPE = "submitnormal"; |
private static final String DEFAULT_PANE_TYPE = "submitnormal"; |
||||||
|
|
||||||
public CustomPane() { |
public CustomPane() { |
||||||
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||||
customCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); |
customCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); |
||||||
customSubmitPanes = new HashMap<String, BasicBeanPane>(); |
customSubmitPanes = new HashMap<String, BasicBeanPane>(); |
||||||
comboItemsMap = new HashMap<String, String>(); |
comboItemsMap = new HashMap<String, String>(); |
||||||
|
|
||||||
SubmitProvider[] providers = ExtraDesignClassManager.getInstance().getSubmitProviders(); |
SubmitProvider[] providers = ExtraDesignClassManager.getInstance().getSubmitProviders(); |
||||||
providers = (SubmitProvider[])ArrayUtils.add(providers, new DefaultSubmit()); |
providers = (SubmitProvider[]) ArrayUtils.add(providers, new DefaultSubmit()); |
||||||
for (SubmitProvider provider : providers) { |
for (SubmitProvider provider : providers) { |
||||||
customSubmitPanes.put(provider.keyForSubmit(), provider.appearanceForSubmit()); |
customSubmitPanes.put(provider.keyForSubmit(), provider.appearanceForSubmit()); |
||||||
comboItemsMap.put(provider.keyForSubmit(), provider.dataForSubmit()); |
comboItemsMap.put(provider.keyForSubmit(), provider.dataForSubmit()); |
||||||
} |
} |
||||||
|
|
||||||
configTypes = new ArrayList<String>(); |
configTypes = new ArrayList<String>(); |
||||||
for (Map.Entry<String, BasicBeanPane> entry : customSubmitPanes.entrySet()) { |
for (Map.Entry<String, BasicBeanPane> entry : customSubmitPanes.entrySet()) { |
||||||
String key = entry.getKey(); |
String key = entry.getKey(); |
||||||
configTypes.add(comboItemsMap.get(key)); |
configTypes.add(comboItemsMap.get(key)); |
||||||
customCardPane.add(entry.getValue(), key); |
customCardPane.add(entry.getValue(), key); |
||||||
} |
} |
||||||
csjConfigComboBox = new UIComboBox(configTypes.toArray()); |
csjConfigComboBox = new UIComboBox(configTypes.toArray()); |
||||||
|
|
||||||
JPanel typePane = GUICoreUtils.createFlowPane(new Component[]{new UILabel(Inter.getLocText(new String[]{"Choose", "Type"}) + ":"), csjConfigComboBox}, |
JPanel typePane = GUICoreUtils.createFlowPane(new Component[]{new UILabel(Inter.getLocText(new String[]{"Choose", "Type"}) + ":"), csjConfigComboBox}, |
||||||
FlowLayout.LEFT, 10); |
FlowLayout.LEFT, 10); |
||||||
typePane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), Inter.getLocText(new String[]{"Submit", "Type"}))); |
typePane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), Inter.getLocText(new String[]{"Submit", "Type"}))); |
||||||
this.add(typePane, BorderLayout.NORTH); |
this.add(typePane, BorderLayout.NORTH); |
||||||
|
|
||||||
this.add(customCardPane, BorderLayout.CENTER); |
this.add(customCardPane, BorderLayout.CENTER); |
||||||
|
|
||||||
csjConfigComboBox.addItemListener(new ItemListener() { |
csjConfigComboBox.addItemListener(new ItemListener() { |
||||||
@Override |
@Override |
||||||
public void itemStateChanged(ItemEvent e) { |
public void itemStateChanged(ItemEvent e) { |
||||||
if (e.getStateChange() == ItemEvent.SELECTED) { |
if (e.getStateChange() == ItemEvent.SELECTED) { |
||||||
Object ob = e.getItem(); |
Object ob = e.getItem(); |
||||||
CardLayout c1 = (CardLayout) customCardPane.getLayout(); |
CardLayout c1 = (CardLayout) customCardPane.getLayout(); |
||||||
for (String key : customSubmitPanes.keySet()) { |
for (String key : customSubmitPanes.keySet()) { |
||||||
String item = comboItemsMap.get(key); |
String item = comboItemsMap.get(key); |
||||||
if ((ComparatorUtils.equals(ob, item))) { |
if ((ComparatorUtils.equals(ob, item))) { |
||||||
c1.show(customCardPane, key); |
c1.show(customCardPane, key); |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
}); |
}); |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
public void populateBean(WClassSubmiterProvider ob) { |
public void populateBean(WClassSubmiterProvider ob) { |
||||||
editing = ob; |
editing = ob; |
||||||
SubmitJob submitJob = ob.getSubmitJob(); |
SubmitJob submitJob = ob.getSubmitJob(); |
||||||
if (submitJob == null) { |
if (submitJob == null) { |
||||||
csjConfigComboBox.setSelectedItem(comboItemsMap.get(DEFAULT_PANE_TYPE)); |
csjConfigComboBox.setSelectedItem(comboItemsMap.get(DEFAULT_PANE_TYPE)); |
||||||
|
|
||||||
for (Map.Entry<String, BasicBeanPane> entry : customSubmitPanes.entrySet()) { |
for (Map.Entry<String, BasicBeanPane> entry : customSubmitPanes.entrySet()) { |
||||||
entry.getValue().populateBean(submitJob); |
entry.getValue().populateBean(submitJob); |
||||||
} |
} |
||||||
return; |
return; |
||||||
} |
} |
||||||
String pantype=submitJob.getJobType(); |
String pantype = submitJob.getJobType(); |
||||||
BasicBeanPane pane = customSubmitPanes.get(pantype); |
BasicBeanPane pane = customSubmitPanes.get(pantype); |
||||||
if (pane != null) { |
if (pane != null) { |
||||||
csjConfigComboBox.setSelectedItem(comboItemsMap.get(pantype)); |
csjConfigComboBox.setSelectedItem(comboItemsMap.get(pantype)); |
||||||
pane.populateBean(submitJob); |
pane.populateBean(submitJob); |
||||||
} |
} |
||||||
|
|
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
public WClassSubmiterProvider updateBean() { |
public WClassSubmiterProvider updateBean() { |
||||||
for (Map.Entry<String, BasicBeanPane> entry : customSubmitPanes.entrySet()) { |
for (Map.Entry<String, BasicBeanPane> entry : customSubmitPanes.entrySet()) { |
||||||
BasicBeanPane pane = entry.getValue(); |
BasicBeanPane pane = entry.getValue(); |
||||||
if (pane != null && pane.isVisible()) { |
if (pane != null && pane.isVisible()) { |
||||||
editing.setSubmitJob((SubmitJob) pane.updateBean()); |
editing.setSubmitJob((SubmitJob) pane.updateBean()); |
||||||
} |
} |
||||||
} |
} |
||||||
return editing; |
return editing; |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
protected String title4PopupWindow() { |
protected String title4PopupWindow() { |
||||||
return "custom"; |
return "custom"; |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
@ -0,0 +1,40 @@ |
|||||||
|
package com.fr.design.fun; |
||||||
|
|
||||||
|
import com.fr.data.Verifier; |
||||||
|
import com.fr.design.beans.BasicBeanPane; |
||||||
|
import com.fr.stable.fun.Level; |
||||||
|
import com.fr.stable.fun.Provider; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by richie on 16/6/8. |
||||||
|
*/ |
||||||
|
public interface VerifyDefineProvider extends Level, Provider { |
||||||
|
|
||||||
|
String MARK_STRING = "VerifyDefineProvider"; |
||||||
|
|
||||||
|
int CURRENT_LEVEL = 1; |
||||||
|
|
||||||
|
/** |
||||||
|
* 对应的校验类 |
||||||
|
* @return 校验类 |
||||||
|
*/ |
||||||
|
Class<? extends Verifier> classForVerifier(); |
||||||
|
|
||||||
|
/** |
||||||
|
* 校验设置的界面 |
||||||
|
* @return 界面 |
||||||
|
*/ |
||||||
|
Class<? extends BasicBeanPane> appearanceForVerifier(); |
||||||
|
|
||||||
|
/** |
||||||
|
* 此种类型的校验的名字 |
||||||
|
* @return 名字 |
||||||
|
*/ |
||||||
|
String nameForVerifier(); |
||||||
|
|
||||||
|
/** |
||||||
|
* 菜单图标 |
||||||
|
* @return 图标路径 |
||||||
|
*/ |
||||||
|
String iconPath(); |
||||||
|
} |
@ -0,0 +1,20 @@ |
|||||||
|
package com.fr.design.fun.impl; |
||||||
|
|
||||||
|
import com.fr.design.fun.VerifyDefineProvider; |
||||||
|
import com.fr.stable.fun.impl.AbstractProvider; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by richie on 16/6/8. |
||||||
|
*/ |
||||||
|
public abstract class AbstractVerifyDefineProvider extends AbstractProvider implements VerifyDefineProvider { |
||||||
|
|
||||||
|
@Override |
||||||
|
public int currentAPILevel() { |
||||||
|
return CURRENT_LEVEL; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String mark4Provider() { |
||||||
|
return getClass().getName(); |
||||||
|
} |
||||||
|
} |
After Width: | Height: | Size: 745 B |
After Width: | Height: | Size: 810 B |
After Width: | Height: | Size: 837 B |
After Width: | Height: | Size: 779 B |
After Width: | Height: | Size: 815 B |
After Width: | Height: | Size: 818 B |
After Width: | Height: | Size: 890 B |
After Width: | Height: | Size: 842 B |