Browse Source

邮件图片导出设置part5 in 5

master
vito 9 years ago
parent
commit
aad1dfbf61
  1. 6
      designer/src/com/fr/design/report/ExcelExportPane.java
  2. 4
      designer/src/com/fr/design/report/PDFExportPane.java
  3. 35
      designer/src/com/fr/design/report/ReportExportAttrPane.java
  4. 4
      designer/src/com/fr/design/report/WordExportPane.java
  5. 19
      designer_base/src/com/fr/design/ExtraDesignClassManager.java
  6. 30
      designer_base/src/com/fr/design/fun/AbstractExportPane.java
  7. 22
      designer_base/src/com/fr/design/fun/ExportAttrTabProvider.java
  8. 19
      designer_base/src/com/fr/design/fun/impl/AbstractExportAttrTabProvider.java

6
designer/src/com/fr/design/report/ExcelExportPane.java

@ -4,8 +4,10 @@ package com.fr.design.report;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import com.fr.design.fun.AbstractExportPane;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import javax.swing.*;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itextfield.UITextField;
@ -32,7 +34,7 @@ public class ExcelExportPane extends BasicPane {
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel outnorthPane =FRGUIPaneFactory.createTitledBorderPane("Excel" + Inter.getLocText("ReportD-Excel_Export"));
JPanel northPane=FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
this.add(outnorthPane);

4
designer/src/com/fr/design/report/PDFExportPane.java

@ -4,7 +4,7 @@ package com.fr.design.report;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JPanel;
import javax.swing.*;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
@ -26,7 +26,7 @@ public class PDFExportPane extends BasicPane {
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel outnorthPane =FRGUIPaneFactory.createTitledBorderPane("PDF" + Inter.getLocText("ReportD-Excel_Export"));
JPanel northPane=FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
this.add(outnorthPane);

35
designer/src/com/fr/design/report/ReportExportAttrPane.java

@ -1,27 +1,43 @@
package com.fr.design.report;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.*;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.AbstractExportPane;
import com.fr.design.fun.ExportAttrTabProvider;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.general.Inter;
import com.fr.io.attr.ImageExportAttr;
import com.fr.io.attr.ReportExportAttr;
import java.util.HashMap;
import java.util.Map;
public class ReportExportAttrPane extends BasicPane {
private ExcelExportPane excelExportPane;
private PDFExportPane pdfExportPane;
private WordExportPane wordExportPane;
Map<String, AbstractExportPane> paneMap;
public ReportExportAttrPane() {
UITabbedPane uiTabbedPane = new UITabbedPane();
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
excelExportPane = new ExcelExportPane();
this.add(excelExportPane);
uiTabbedPane.addTab("Excel", excelExportPane);
pdfExportPane = new PDFExportPane();
this.add(pdfExportPane);
uiTabbedPane.addTab("PDF", pdfExportPane);
wordExportPane = new WordExportPane();
this.add(wordExportPane);
uiTabbedPane.addTab("Word", wordExportPane);
ExportAttrTabProvider[] providers = ExtraDesignClassManager.getInstance().getExportAttrTabProviders();
paneMap = new HashMap<String, AbstractExportPane>();
for (ExportAttrTabProvider provider : providers) {
uiTabbedPane.addTab(provider.title(), provider.toSwingComponent());
paneMap.put(provider.tag(), provider.toExportPane());
}
this.add(uiTabbedPane);
}
@Override
@ -45,6 +61,11 @@ public class ReportExportAttrPane extends BasicPane {
if (this.wordExportPane != null) {
this.wordExportPane.populate(reportExportAttr.getWordExportAttr());
}
AbstractExportPane exportPane = paneMap.get("Image");
if(exportPane != null){
exportPane.populate(reportExportAttr.getImageExportAttr());
}
}
public ReportExportAttr update() {
@ -62,6 +83,10 @@ public class ReportExportAttrPane extends BasicPane {
reportExportAttr.setWordExportAttr(this.wordExportPane.update());
}
AbstractExportPane exportPane = paneMap.get("Image");
if(exportPane != null){
reportExportAttr.setImageExportAttr(exportPane.update(ImageExportAttr.class));
}
return reportExportAttr;
}
}

4
designer/src/com/fr/design/report/WordExportPane.java

@ -4,7 +4,7 @@ package com.fr.design.report;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JPanel;
import javax.swing.*;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.MultilineLabel;
@ -23,7 +23,7 @@ public class WordExportPane extends BasicPane {
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel outnorthPane =FRGUIPaneFactory.createTitledBorderPane("Word" + Inter.getLocText("ReportD-Excel_Export"));
this.add(outnorthPane);

19
designer_base/src/com/fr/design/ExtraDesignClassManager.java

@ -132,6 +132,8 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
private Set<WidgetAttrProvider> widgetAttrProviders;
private Set<ExportAttrTabProvider> exportAttrTabProviders;
public TableDataTreePaneProcessor getTableDataTreePaneProcessor() {
return tableDataTreePaneProcessor;
}
@ -753,6 +755,21 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
widgetAttrProviders.add((WidgetAttrProvider) level);
}
public ExportAttrTabProvider[] getExportAttrTabProviders() {
if (exportAttrTabProviders == null) {
return new ExportAttrTabProvider[0];
}
return exportAttrTabProviders.toArray(new ExportAttrTabProvider[exportAttrTabProviders.size()]);
}
public void addExportAttrTabProvider(Level level, PluginSimplify simplify) throws Exception {
if (exportAttrTabProviders == null) {
exportAttrTabProviders = new HashSet<ExportAttrTabProvider>();
}
validAPILevel(level, ExportAttrTabProvider.CURRENT_LEVEL, simplify.getPluginName());
exportAttrTabProviders.add((ExportAttrTabProvider) level);
}
/**
* 文件名
*
@ -847,6 +864,8 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
addElementUIProvider(impl, simplify);
} else if (tagName.equals(WidgetAttrProvider.XML_TAG)) {
addWidgetAttrProvider(impl, simplify);
} else if (tagName.equals(ExportAttrTabProvider.XML_TAG)) {
addExportAttrTabProvider(impl, simplify);
}
} catch (PluginInvalidLevelException e) {
PluginMessage.remindUpdate(e.getMessage());

30
designer_base/src/com/fr/design/fun/AbstractExportPane.java

@ -0,0 +1,30 @@
package com.fr.design.fun;
import com.fr.design.dialog.BasicPane;
/**
* Created by vito on 16/5/5.
*/
public abstract class AbstractExportPane extends BasicPane {
public abstract void populate(Object t);
public abstract Object update();
// public <T> void populate(Object object,Class<? extends T> clazz){
// if(object.getClass().isAssignableFrom(clazz)){
// this.populate(clazz.cast(object));
// }
// }
public <T> T update(Class<? extends T> clazz){
Object object = this.update();
if(object == null){
return null;
}
if(object.getClass().isAssignableFrom(clazz)){
return clazz.cast(object);
}
return null;
}
}

22
designer_base/src/com/fr/design/fun/ExportAttrTabProvider.java

@ -0,0 +1,22 @@
package com.fr.design.fun;
import com.fr.stable.fun.Level;
import javax.swing.*;
/**
* Created by vito on 16/5/5.
*/
public interface ExportAttrTabProvider extends Level{
String XML_TAG = "ExportAttrTabProvider";
int CURRENT_LEVEL = 1;
JComponent toSwingComponent();
AbstractExportPane toExportPane();
String title();
String tag();
}

19
designer_base/src/com/fr/design/fun/impl/AbstractExportAttrTabProvider.java

@ -0,0 +1,19 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.ExportAttrTabProvider;
import com.fr.stable.fun.impl.AbstractProvider;
/**
* Created by vito on 16/5/5.
*/
public abstract class AbstractExportAttrTabProvider extends AbstractProvider implements ExportAttrTabProvider {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public String mark4Provider() {
return this.getClass().getName();
}
}
Loading…
Cancel
Save