Fangjie Hu 8 years ago
parent
commit
29cdc0183d
  1. 2
      designer/src/com/fr/design/actions/file/export/AbstractExcelExportAction.java
  2. 1
      designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java
  3. 24
      designer_base/src/com/fr/design/fun/DesignerFrameUpButtonProvider.java
  4. 23
      designer_base/src/com/fr/design/fun/impl/AbstractDsinFrameUpButtonProvider.java
  5. 19
      designer_base/src/com/fr/design/mainframe/DesignerFrame.java
  6. 24
      designer_base/src/com/fr/design/mainframe/JTemplate.java
  7. 3
      designer_chart/src/com/fr/design/chart/series/PlotSeries/MapDefiAreaNamePane.java
  8. 2
      designer_chart/src/com/fr/design/mainframe/actions/ExcelExportAction4Chart.java
  9. 9
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/area/ChartAreaPane.java
  10. 18
      designer_chart/src/com/fr/design/mainframe/exporter/ExcelExporter4Chart.java
  11. 8
      designer_form/src/com/fr/design/mainframe/JForm.java

2
designer/src/com/fr/design/actions/file/export/AbstractExcelExportAction.java

@ -36,7 +36,7 @@ public abstract class AbstractExcelExportAction extends AbstractExportAction {
if (hasLayerReport(tpl)) {
return "zip";
} else {
return ExcelUtils.checkPOIJarExist() ? "xlsx" : "xls";
return ExcelUtils.checkThirdJarSupportPOI() ? "xlsx" : "xls";
}
}
}

1
designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java

@ -22,7 +22,6 @@ import com.fr.form.ui.IframeEditor;
import com.fr.general.Inter;
import com.fr.stable.ParameterProvider;
import com.fr.design.widget.DataModify;
import com.fr.third.org.apache.poi.hssf.record.formula.functions.Abs;
public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
private UITextField srcTextField;

24
designer_base/src/com/fr/design/fun/DesignerFrameUpButtonProvider.java

@ -0,0 +1,24 @@
package com.fr.design.fun;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.stable.fun.mark.Mutable;
/**
* 设计器面板最上方的按钮接口保存赋值撤销同级
* Coder: zack
* Date: 2016/9/22
* Time: 15:40
*/
public interface DesignerFrameUpButtonProvider extends Mutable {
int CURRENT_LEVEL = 1;
String XML_TAG = "DesignerFrameUpButtonProvider";
/**
* 根据当前的设计状态返回最上层工具按钮
* @param menuState 现在设计器的设计状态
* @return 按钮
*/
UIButton[] getUpButtons(int menuState);
}

23
designer_base/src/com/fr/design/fun/impl/AbstractDsinFrameUpButtonProvider.java

@ -0,0 +1,23 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.DesignerFrameUpButtonProvider;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.stable.fun.mark.API;
/**
* Coder: zack
* Date: 2016/9/22
* Time: 15:50
*/
@API(level = DesignerFrameUpButtonProvider.CURRENT_LEVEL)
public abstract class AbstractDsinFrameUpButtonProvider implements DesignerFrameUpButtonProvider {
@Override
public UIButton[] getUpButtons(int menuState) {
return new UIButton[0];
}
@Override
public String mark4Provider() {
return getClass().getName();
}
}

19
designer_base/src/com/fr/design/mainframe/DesignerFrame.java

@ -464,9 +464,28 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
//添加分享按钮
addShareButton();
//添加插件中的按钮
addExtraButtons();
return combineUp;
}
private void addExtraButtons(){
JTemplate<?, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if(jt == null){
return;
}
UIButton[] extraButtons = jt.createExtraButtons();
for (int i = 0; i < extraButtons.length; i++) {
combineUp.add(extraButtons[i]);
}
if (extraButtons.length > 0) {
combineUp.addSeparator(new Dimension(2, 16));
}
}
private void addShareButton(){
JTemplate<?, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();

24
designer_base/src/com/fr/design/mainframe/JTemplate.java

@ -8,8 +8,8 @@ import com.fr.base.io.IOFile;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.TableDataSourceAction;
import com.fr.design.actions.core.WorkBookSupportable;
import com.fr.design.actions.edit.RedoAction;
import com.fr.design.actions.edit.UndoAction;
import com.fr.design.actions.file.SaveAsTemplateAction;
@ -19,6 +19,7 @@ import com.fr.design.designer.TargetComponent;
import com.fr.design.dialog.InformationWarnPane;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.TemplateTreePane;
import com.fr.design.fun.DesignerFrameUpButtonProvider;
import com.fr.design.fun.MenuHandler;
import com.fr.design.fun.PreviewProvider;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
@ -37,9 +38,12 @@ import com.fr.file.FILE;
import com.fr.file.FILEChooserPane;
import com.fr.file.FileNodeFILE;
import com.fr.file.MemFILE;
import com.fr.form.ui.NoneWidget;
import com.fr.form.ui.Widget;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
@ -51,6 +55,7 @@ import java.awt.*;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Set;
import java.util.regex.Pattern;
/**
@ -505,6 +510,9 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
public boolean saveShareFile(){
return true;
}
public Widget getSelectElementCase(){
return new NoneWidget();
}
protected FILEChooserPane getFILEChooserPane(boolean isShowLoc){
return new FILEChooserPane(true, isShowLoc);
@ -957,4 +965,18 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
public boolean acceptToolbarItem(Class clazz) {
return true;
}
/**
* 加载插件中的按钮
* @return 按钮组
*/
public UIButton[] createExtraButtons() {
Set<DesignerFrameUpButtonProvider> providers = ExtraDesignClassManager.getInstance().getArray(DesignerFrameUpButtonProvider.XML_TAG);
UIButton[] uiButtons = new UIButton[0];
for (DesignerFrameUpButtonProvider provider : providers) {
uiButtons = ArrayUtils.addAll(uiButtons, provider.getUpButtons(getMenuState()));
}
return uiButtons;
}
}

3
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapDefiAreaNamePane.java

@ -36,7 +36,6 @@ import com.fr.design.gui.xcombox.ComboBoxUseEditor;
import com.fr.design.editor.editor.Editor;
import com.fr.design.editor.editor.TextEditor;
import com.fr.general.Inter;
import com.fr.third.org.apache.poi.hssf.record.formula.functions.T;
/**
* 地图, 定义区域名.
@ -90,7 +89,7 @@ public class MapDefiAreaNamePane extends BasicBeanPane<String> implements Abstrc
tableDataBox.setPreferredSize(new Dimension(200, 20));
northPane.add(tableDataBox);
columnBox = new FilterComboBox<T>();
columnBox = new FilterComboBox();
columnBox.setPreferredSize(new Dimension(40, 20));
columnBox.addItemListener(columnChange);

2
designer_chart/src/com/fr/design/mainframe/actions/ExcelExportAction4Chart.java

@ -58,7 +58,7 @@ public class ExcelExportAction4Chart extends AbstractExportAction4JChart {
@Override
protected String getDefaultExtension() {
return ExcelUtils.checkPOIJarExist() ? "xlsx" : "xls";
return ExcelUtils.checkThirdJarSupportPOI() ? "xlsx" : "xls";
}
@Override

9
designer_chart/src/com/fr/design/mainframe/chart/gui/style/area/ChartAreaPane.java

@ -45,13 +45,8 @@ public class ChartAreaPane extends ThirdTabPane<Chart> implements AutoSelectedPa
if(parent instanceof ChartStylePane) {
plotPane.setParentPane((ChartStylePane)parent);
}
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jTemplate.isJWorkBook() || jTemplate.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB) {
//表单中的图表组件的图表区挪到控件属性表的样式中了
paneList.add(new NamePane(areaPane.title4PopupWindow(), areaPane));
}else if(jTemplate.isChartBook()){
paneList.add(new NamePane(areaPane.title4PopupWindow(), areaPane));
}
paneList.add(new NamePane(areaPane.title4PopupWindow(), areaPane));
if(plot.isSupportPlotBackground()) {
paneList.add(new NamePane(plotPane.title4PopupWindow(), plotPane));

18
designer_chart/src/com/fr/design/mainframe/exporter/ExcelExporter4Chart.java

@ -6,14 +6,14 @@ import com.fr.design.mainframe.JChart;
import com.fr.general.FRLogger;
import com.fr.general.IOUtils;
import com.fr.stable.CoreGraphHelper;
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.ClientAnchor;
import org.apache.poi.ss.usermodel.Drawing;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import com.fr.third.v2.org.apache.poi.hssf.usermodel.HSSFClientAnchor;
import com.fr.third.v2.org.apache.poi.hssf.usermodel.HSSFWorkbook;
import com.fr.third.v2.org.apache.poi.ss.usermodel.ClientAnchor;
import com.fr.third.v2.org.apache.poi.ss.usermodel.Drawing;
import com.fr.third.v2.org.apache.poi.ss.usermodel.Sheet;
import com.fr.third.v2.org.apache.poi.ss.usermodel.Workbook;
import com.fr.third.v2.org.apache.poi.xssf.usermodel.XSSFClientAnchor;
import com.fr.third.v2.org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
@ -73,7 +73,7 @@ public class ExcelExporter4Chart extends ImageExporter4Chart {
}
private boolean checkExcelExportVersion() {
return ExcelUtils.checkPOIJarExist();
return ExcelUtils.checkThirdJarSupportPOI();
}
// 加载图片.
private int loadPicture(BufferedImage bufferedImage)throws IOException {

8
designer_form/src/com/fr/design/mainframe/JForm.java

@ -10,6 +10,7 @@ import com.fr.design.designer.beans.actions.FormDeleteAction;
import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XComponent;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.properties.FormWidgetAuthorityEditPane;
import com.fr.design.event.TargetModifiedEvent;
@ -35,6 +36,7 @@ import com.fr.file.FILE;
import com.fr.form.FormElementCaseContainerProvider;
import com.fr.form.FormElementCaseProvider;
import com.fr.form.main.Form;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WBorderLayout;
import com.fr.form.ui.container.WLayout;
import com.fr.general.ComparatorUtils;
@ -756,4 +758,10 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
return WorkBookSupportable.class.isAssignableFrom(clazz);
}
@Override
public Widget getSelectElementCase() {
FormSelection selection = formDesign.getSelectionModel().getSelection();
XCreator creator = selection.getSelectedCreator();
return creator.toData();
}
}
Loading…
Cancel
Save