zhouping 9 years ago
parent
commit
a47ad9e3a6
  1. 2
      designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java
  2. 2
      designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java
  3. 89
      designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java
  4. 71
      designer/src/com/fr/design/report/mobile/AppFitPreviewPane.java
  5. 33
      designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java
  6. 9
      designer_base/src/com/fr/design/dialog/BasicScrollPane.java
  7. 48
      designer_base/src/com/fr/env/RemoteEnv.java
  8. 2
      designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java
  9. 6
      designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java

2
designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java

@ -45,7 +45,7 @@ public class ReportMobileAttrAction extends JWorkBookAction{
final ReportMobileAttrPane mobileAttrPane = new ReportMobileAttrPane(); final ReportMobileAttrPane mobileAttrPane = new ReportMobileAttrPane();
mobileAttrPane.populateBean(mobileAttr); mobileAttrPane.populateBean(mobileAttr);
BasicDialog dialog = mobileAttrPane.showMediumWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
wbTpl.setReportMobileAttr(mobileAttrPane.updateBean()); wbTpl.setReportMobileAttr(mobileAttrPane.updateBean());

2
designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java

File diff suppressed because one or more lines are too long

89
designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java

@ -0,0 +1,89 @@
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 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"));
ActionListener actionListener = getAppPreviewActionListener();
horizionPane.addActionListener(actionListener);
verticalPane.addActionListener(actionListener);
fitOpsPane.add(horizionPane, BorderLayout.NORTH);
fitOpsPane.add(verticalPane, 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()};
}
@Override
public void populateBean(ElementCaseMobileAttr ob) {
if (ob == null) {
ob = new ElementCaseMobileAttr();
}
horizionPane.populateBean(ob.getHorziontalAttr());
verticalPane.populateBean(ob.getVerticalAttr());
appFitPreviewPane.refreshPreview(getCurrentFitOptions());
}
@Override
public ElementCaseMobileAttr updateBean() {
MobileFitAttrState horizonState = horizionPane.updateBean();
MobileFitAttrState verticalState = verticalPane.updateBean();
return new ElementCaseMobileAttr(horizonState, verticalState);
}
@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);
}
};
}
}

71
designer/src/com/fr/design/report/mobile/AppFitPreviewPane.java

@ -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/base/images/dialog/appfit/" + "V0.png")));
cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "V1.png")));
cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "V2.png")));
cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "V3.png")));
cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "H0.png")));
cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "H1.png")));
cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "H2.png")));
cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/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");
}
}

33
designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java

@ -1,40 +1,33 @@
package com.fr.design.report.mobile; package com.fr.design.report.mobile;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.report.mobile.ElementCaseMobileAttr; import com.fr.report.mobile.ElementCaseMobileAttr;
import com.fr.base.mobile.MobileFitAttrState;
import javax.swing.*; import javax.swing.*;
import java.awt.*;
/** /**
* Created by Administrator on 2016/5/12/0012. * Created by Administrator on 2016/5/12/0012.
*/ */
public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
//横屏设置面板
private MobileRadioGroupPane horizionPane; private AppFitBrowserPane appFitBrowserPane;
//竖屏设置面板
private MobileRadioGroupPane verticalPane;
public ReportMobileAttrPane() { public ReportMobileAttrPane() {
initComponents(); initComponents();
} }
private void initComponents() { private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow()); this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
AppFitPreviewPane appFitPreviewPane = new AppFitPreviewPane();
JPanel fitOpsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); appFitBrowserPane = new AppFitBrowserPane();
horizionPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Horizontal")); appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane);
verticalPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Vertical")); this.add(appFitBrowserPane);
fitOpsPane.add(horizionPane, BorderLayout.NORTH);
fitOpsPane.add(verticalPane, BorderLayout.SOUTH);
borderPane.add(fitOpsPane); this.add(appFitPreviewPane);
this.add(borderPane);
} }
@Override @Override
@ -42,17 +35,13 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
if (ob == null) { if (ob == null) {
ob = new ElementCaseMobileAttr(); ob = new ElementCaseMobileAttr();
} }
appFitBrowserPane.populateBean(ob);
horizionPane.populateBean(ob.getHorziontalAttr());
verticalPane.populateBean(ob.getVerticalAttr());
} }
@Override @Override
public ElementCaseMobileAttr updateBean() { public ElementCaseMobileAttr updateBean() {
MobileFitAttrState horizonState = horizionPane.updateBean(); return appFitBrowserPane.updateBean();
MobileFitAttrState verticalState = verticalPane.updateBean();
return new ElementCaseMobileAttr(horizonState, verticalState);
} }
@Override @Override

9
designer_base/src/com/fr/design/dialog/BasicScrollPane.java

@ -153,8 +153,9 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
scrollBar.setEnabled(false); scrollBar.setEnabled(false);
scrollBar.setVisible(false); scrollBar.setVisible(false);
} else { } else {
scrollBar.setEnabled(true); boolean show = isShowScrollBar();
scrollBar.setVisible(true); scrollBar.setEnabled(show);
scrollBar.setVisible(show);
} }
maxheight = getHeight() - DET_HEIGHT; maxheight = getHeight() - DET_HEIGHT;
if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) { if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) {
@ -181,6 +182,10 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
} }
} }
protected boolean isShowScrollBar() {
return true;
}
@Override @Override
public T updateBean() { public T updateBean() {
return null; return null;

48
designer_base/src/com/fr/env/RemoteEnv.java vendored

@ -28,6 +28,8 @@ import com.fr.json.JSONArray;
import com.fr.json.JSONException; import com.fr.json.JSONException;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.plugin.Plugin; import com.fr.plugin.Plugin;
import com.fr.plugin.PluginLicense;
import com.fr.plugin.PluginLicenseManager;
import com.fr.plugin.PluginLoader; import com.fr.plugin.PluginLoader;
import com.fr.stable.*; import com.fr.stable.*;
import com.fr.stable.file.XMLFileManagerProvider; import com.fr.stable.file.XMLFileManagerProvider;
@ -2044,25 +2046,45 @@ public class RemoteEnv implements Env {
} }
public InputStream readPluginConfig() throws Exception { private void readPlugins() throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream();
HashMap<String, String> para = new HashMap<String, String>(); HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design"); para.put("op", "fr_remote_design");
para.put("cmd", "design_get_plugin_info"); para.put("cmd", "design_plugins");
return postBytes2ServerB(out.toByteArray(), para); InputStream inputStream = postBytes2ServerB(out.toByteArray(), para);
String pluginsStr = IOUtils.inputStream2String(inputStream, EncodeConstants.ENCODING_UTF_8);
if (StringUtils.isNotBlank(pluginsStr) && pluginsStr.startsWith("[")) {
JSONArray jsonArray = new JSONArray(pluginsStr);
for (int i = 0; i < jsonArray.length(); i++) {
Plugin plugin = new Plugin();
plugin.parseJSON(jsonArray.getJSONObject(i));
PluginLoader.getLoader().addRemotePlugin(plugin);
} }
/**
* 远程设计先不需要检测MD5
*
* @return 是否正确
* @throws Exception MD5算法异常
*/
@Override
public boolean isTruePluginMD5(Plugin plugin, File file) throws Exception {
return true;
} }
}
private void readPluginLicenses() throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream();
HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design");
para.put("cmd", "design_plugin_licenses");
InputStream inputStream = postBytes2ServerB(out.toByteArray(), para);
String pluginsLicensesStr = IOUtils.inputStream2String(inputStream, EncodeConstants.ENCODING_UTF_8);
if (StringUtils.isNotBlank(pluginsLicensesStr) && pluginsLicensesStr.startsWith("[")) {
JSONArray jsonArray = new JSONArray(pluginsLicensesStr);
for (int i = 0; i < jsonArray.length(); i++) {
PluginLicense pluginLicense = new PluginLicense();
pluginLicense.parseJSON(jsonArray.getJSONObject(i));
PluginLicenseManager.getInstance().addRemotePluginLicense(pluginLicense);
}
}
}
@Override
public void readPluginConfig() throws Exception {
readPlugins();
readPluginLicenses();
}
} }

2
designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java

@ -22,7 +22,7 @@ public interface IndependentChartUIProvider extends Level {
String XML_TAG = "IndependentChartUIProvider"; String XML_TAG = "IndependentChartUIProvider";
int CURRENT_API_LEVEL = 2; int CURRENT_API_LEVEL = 3;
/** /**
* 图表的类型定义界面类型就是属性表的第一个界面 * 图表的类型定义界面类型就是属性表的第一个界面

6
designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java

@ -15,9 +15,13 @@ import com.fr.general.ComparatorUtils;
* Created by Mitisky on 16/3/7. * Created by Mitisky on 16/3/7.
*/ */
public abstract class AbstractIndependentChartUIWithAPILevel implements IndependentChartUIProvider { public abstract class AbstractIndependentChartUIWithAPILevel implements IndependentChartUIProvider {
private static final int OLD_PLUGIN_LEVEL = -2;
@Override @Override
//以前的插件没有覆写这个方法,所以始终获取到-2,比当前level低,提示更新.
//新的插件编译进去的是当前LEVEL,当之后LEVEL增加,会比编译进去的LEVEL大,提示更新.
public int currentAPILevel() { public int currentAPILevel() {
return CURRENT_API_LEVEL; return OLD_PLUGIN_LEVEL;
} }
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){ public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){

Loading…
Cancel
Save