Browse Source

Merge branch 'dev' of ssh://www.finedevelop.com:7999/~loy/design_fr into dev

master
loy 8 years ago
parent
commit
18bd88c965
  1. 10
      designer_base/src/com/fr/design/extra/plugindependence/DownLoadDependenceUI.java
  2. 24
      designer_base/src/com/fr/design/fun/DesignerFrameUpButtonProvider.java
  3. 23
      designer_base/src/com/fr/design/fun/impl/AbstractDsinFrameUpButtonProvider.java
  4. 19
      designer_base/src/com/fr/design/mainframe/DesignerFrame.java
  5. 24
      designer_base/src/com/fr/design/mainframe/JTemplate.java
  6. 9
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/area/ChartAreaPane.java
  7. 2
      designer_form/src/com/fr/design/designer/creator/XWFitLayout.java
  8. 8
      designer_form/src/com/fr/design/mainframe/JForm.java

10
designer_base/src/com/fr/design/extra/plugindependence/DownLoadDependenceUI.java

@ -20,12 +20,10 @@ import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.*;
import java.net.HttpURLConnection;
import java.util.ArrayList;
import java.util.List;
/**
* Created by hufan on 2016/9/5.
*/
@ -198,7 +196,7 @@ public class DownLoadDependenceUI implements ActionListener {
}
//安装文件
IOUtils.unzip(new File(temp), FRContext.getCurrentEnv().getPath() + dependenceUnit.getDependenceDir());
IOUtils.unZipFilesGBK(temp, FRContext.getCurrentEnv().getPath() + dependenceUnit.getDependenceDir());
} else {
result = false;
@ -254,14 +252,12 @@ public class DownLoadDependenceUI implements ActionListener {
int choose = JOptionPane.showConfirmDialog(null, Inter.getLocText("FR-Designer-Plugin_Plugin") + Inter.getLocText("FR-Designer-Need") + Inter.getLocText("FR-Designer-Dependence") + Inter.getLocText("FR-Designer-Support") + "," + Inter.getLocText("FR-Designer-Dependence_Need_Install") + "(" + showFileLength() + " m)?", "install tooltip", JOptionPane.YES_NO_OPTION);
if (choose == 0) {//下载安装
if (!connectToServer()) {
//JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Dependence_Connect_Server_Error"), "alert", JOptionPane.ERROR_MESSAGE);
throw new PluginDependenceException(Inter.getLocText("FR-Designer-Dependence_Connect_Server_Error"));
}
//安装依赖环境
if (install()) {
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Dependence_Install_Succeed") + "!!");
} else {
//JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Dependence_Install_Failed") + "!!", "alert", JOptionPane.ERROR_MESSAGE);
throw new PluginDependenceException(Inter.getLocText("FR-Designer-Dependence_Install_Failed"));
}
}else {//不选择下载,则不安装图标插件

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;
}
}

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));

2
designer_form/src/com/fr/design/designer/creator/XWFitLayout.java

@ -53,6 +53,8 @@ public class XWFitLayout extends XLayoutContainer {
super(widget, initSize);
initPercent();
widget.setResolutionScaling(containerPercent);
}
//根据屏幕大小来确定显示的百分比, 1440*900默认100%, 1366*768缩放90%

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