diff --git a/designer/src/com/fr/design/webattr/PageToolBarPane.java b/designer/src/com/fr/design/webattr/PageToolBarPane.java index 105d17353..b9e8c2bf7 100644 --- a/designer/src/com/fr/design/webattr/PageToolBarPane.java +++ b/designer/src/com/fr/design/webattr/PageToolBarPane.java @@ -34,7 +34,6 @@ public class PageToolBarPane extends AbstractEditToolBarPane { private UICheckBox isShowAsImageBox; private UICheckBox isAutoScaleBox; private UICheckBox isTDHeavyBox; - private UICheckBox isTDHeavyUseLightBox; private EventPane eventPane; private UILabel showLocationLabel = new UILabel(Inter.getLocText("FR-Designer_Report_Show_Location") + ":"); @@ -60,8 +59,6 @@ public class PageToolBarPane extends AbstractEditToolBarPane { north.add(GUICoreUtils.createFlowPane(isAutoScaleBox, FlowLayout.LEFT)); isTDHeavyBox = new UICheckBox(Inter.getLocText("FR-Designer_IS_TD_HEAVY_EXPORT"), false); north.add(GUICoreUtils.createFlowPane(isTDHeavyBox, FlowLayout.LEFT)); - isTDHeavyUseLightBox = new UICheckBox(Inter.getLocText("FR-Designer_USE_TD_HEAVY_LIGHT"), false); - north.add(GUICoreUtils.createFlowPane(isTDHeavyUseLightBox, FlowLayout.LEFT)); editToolBarButton.addActionListener(editBtnListener); isUseToolBarCheckBox.setSelected(true); @@ -96,7 +93,6 @@ public class PageToolBarPane extends AbstractEditToolBarPane { this.centerRadioButton.setEnabled(isEnabled); this.eventPane.setEnabled(isEnabled); this.isTDHeavyBox.setEnabled(isEnabled); - this.isTDHeavyUseLightBox.setEnabled(isEnabled); this.isAutoScaleBox.setEnabled(isEnabled); this.isShowAsImageBox.setEnabled(isEnabled); this.leftRadioButton.setEnabled(isEnabled); @@ -126,7 +122,6 @@ public class PageToolBarPane extends AbstractEditToolBarPane { isShowAsImageBox.setSelected(webPage.isShowAsImage()); isAutoScaleBox.setSelected(webPage.isAutoScaleWhenEmbeddedInIframe()); isTDHeavyBox.setSelected(webPage.isTDHeavy()); - isTDHeavyUseLightBox.setSelected(webPage.isLightTDHeavy()); if (webPage.isUseToolBar()) { this.toolBarManagers = webPage.getToolBarManagers(); this.isUseToolBarCheckBox.setSelected(true); @@ -161,7 +156,6 @@ public class PageToolBarPane extends AbstractEditToolBarPane { webPage.setShowAsImage(isShowAsImageBox.isSelected()); webPage.setAutoScaleWhenEmbeddedInIframe(isAutoScaleBox.isSelected()); webPage.setTDHeavy(isTDHeavyBox.isSelected()); - webPage.setLightTDHeavy(isTDHeavyUseLightBox.isSelected()); return webPage; } diff --git a/designer/src/com/fr/design/webattr/PageWebSettingPane.java b/designer/src/com/fr/design/webattr/PageWebSettingPane.java index e38240c36..504687e89 100644 --- a/designer/src/com/fr/design/webattr/PageWebSettingPane.java +++ b/designer/src/com/fr/design/webattr/PageWebSettingPane.java @@ -29,7 +29,6 @@ public class PageWebSettingPane extends WebSettingPane { private UICheckBox isShowAsImageBox; private UICheckBox isAutoScaleBox; private UICheckBox isTDHeavyBox; - private UICheckBox isTDHeavyUseLightBox; public PageWebSettingPane() { super(); @@ -49,14 +48,13 @@ public class PageWebSettingPane extends WebSettingPane { isShowAsImageBox = new UICheckBox(Inter.getLocText("Is_Paint_Page")); isAutoScaleBox = new UICheckBox(Inter.getLocText("IS_Auto_Scale")); isTDHeavyBox = new UICheckBox(Inter.getLocText("IS_TD_HEAVY_EXPORT"), false); - isTDHeavyUseLightBox = new UICheckBox(Inter.getLocText("USE_TD_HEAVY_LIGHT"), false); double p = TableLayout.PREFERRED; double[] columnSize = { p,p,p}; double[] rowSize = { p, p,p,p }; Component[][] components = new Component[][]{ new Component[]{new UILabel(Inter.getLocText("Report_Show_Location") + ":", UILabel.RIGHT), buttonpane,null}, new Component[]{new UILabel(Inter.getLocText("PageSetup-Page") + ":", UILabel.RIGHT), isShowAsImageBox, isAutoScaleBox}, - new Component[]{null, isTDHeavyBox, isTDHeavyUseLightBox} + new Component[]{null, isTDHeavyBox, null} }; return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); @@ -71,7 +69,6 @@ public class PageWebSettingPane extends WebSettingPane { isShowAsImageBox.setEnabled(isSelected); isAutoScaleBox.setEnabled(isSelected); isTDHeavyBox.setEnabled(isSelected); - isTDHeavyUseLightBox.setEnabled(isSelected); } protected void setDefault(){ super.setDefault(); @@ -79,7 +76,6 @@ public class PageWebSettingPane extends WebSettingPane { isShowAsImageBox.setSelected(false); isAutoScaleBox.setSelected(false); isTDHeavyBox.setSelected(false); - isTDHeavyUseLightBox.setSelected(false); } @Override protected void populateSubWebSettingrBean(WebPage webPage) { @@ -95,7 +91,6 @@ public class PageWebSettingPane extends WebSettingPane { isShowAsImageBox.setSelected(webPage.isShowAsImage()); isAutoScaleBox.setSelected(webPage.isAutoScaleWhenEmbeddedInIframe()); isTDHeavyBox.setSelected(webPage.isTDHeavy()); - isTDHeavyUseLightBox.setSelected(webPage.isLightTDHeavy()); } @Override @@ -105,7 +100,6 @@ public class PageWebSettingPane extends WebSettingPane { webPage.setShowAsImage(isShowAsImageBox.isSelected()); webPage.setAutoScaleWhenEmbeddedInIframe(isAutoScaleBox.isSelected()); webPage.setTDHeavy(isTDHeavyBox.isSelected()); - webPage.setLightTDHeavy(isTDHeavyUseLightBox.isSelected()); return webPage; } diff --git a/designer_base/src/com/fr/design/extra/LoginWebBridge.java b/designer_base/src/com/fr/design/extra/LoginWebBridge.java index c1c32b11f..482dde490 100644 --- a/designer_base/src/com/fr/design/extra/LoginWebBridge.java +++ b/designer_base/src/com/fr/design/extra/LoginWebBridge.java @@ -254,7 +254,7 @@ public class LoginWebBridge { String loginResult = login(username, password); if (loginResult.equals(LOGININ)) { updateUserInfo(username, password); - loginSuccess(username); + loginSuccess(username, uiLabel); setUserName(username, uiLabel); } return loginResult; @@ -287,7 +287,7 @@ public class LoginWebBridge { * 关闭窗口并且重新赋值 * @param username */ - public void loginSuccess(String username) { + public void loginSuccess(String username, UILabel uiLabel) { closeWindow(); uiLabel.setText(username); } diff --git a/designer_base/src/com/fr/design/extra/QQLoginWebPane.java b/designer_base/src/com/fr/design/extra/QQLoginWebPane.java index 2d950bb11..5861bb9ed 100644 --- a/designer_base/src/com/fr/design/extra/QQLoginWebPane.java +++ b/designer_base/src/com/fr/design/extra/QQLoginWebPane.java @@ -150,7 +150,6 @@ public class QQLoginWebPane extends JFXPanel { final BooleanProperty confirmationResult = new SimpleBooleanProperty(); // initialize the confirmation dialog final Stage dialog = new Stage(StageStyle.UTILITY); - dialog.setTitle(Inter.getLocText("FR-Designer-BBSLogin_Switch-Account")); dialog.setX(Toolkit.getDefaultToolkit().getScreenSize().getWidth()/2 - DEFAULT_CONFIRM_WIDTH / 2 + DEFAULT_OFFEST); dialog.setY(Toolkit.getDefaultToolkit().getScreenSize().getHeight()/2 + DEFAULT_OFFEST); dialog.setHeight(DEFAULT_CONFIRM_HEIGHT); @@ -162,7 +161,7 @@ public class QQLoginWebPane extends JFXPanel { new Scene( HBoxBuilder.create().styleClass("modal-dialog").children( LabelBuilder.create().text(msg).build(), - ButtonBuilder.create().text(Inter.getLocText("")).defaultButton(true).onAction(new EventHandler() { + ButtonBuilder.create().text(Inter.getLocText("FR-Designer-BBSLogin_Switch-Account")).defaultButton(true).onAction(new EventHandler() { @Override public void handle(ActionEvent actionEvent) { // take action and close the dialog. confirmationResult.set(true); diff --git a/designer_base/src/com/fr/design/extra/plugindependence/DownLoadDependenceUI.java b/designer_base/src/com/fr/design/extra/plugindependence/DownLoadDependenceUI.java index 5b0de740c..eb7af116b 100644 --- a/designer_base/src/com/fr/design/extra/plugindependence/DownLoadDependenceUI.java +++ b/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 {//不选择下载,则不安装图标插件 diff --git a/designer_base/src/com/fr/design/extra/ucenter/Client.java b/designer_base/src/com/fr/design/extra/ucenter/Client.java index eeb6cd57e..d63d48bd6 100644 --- a/designer_base/src/com/fr/design/extra/ucenter/Client.java +++ b/designer_base/src/com/fr/design/extra/ucenter/Client.java @@ -18,8 +18,8 @@ import java.util.Map; */ public class Client extends PHPFunctions{ - public static String UC_IP = "211.149.195.54"; - public static String UC_API = SiteCenter.getInstance().acquireUrlByKind("bbs.ucapi"); + public static String UC_IP = ""; + public static String UC_API = ""; public static String UC_CONNECT = ""; public static String UC_KEY = "Rc85U37411p4zdvcedm8D4t4D3l9Sa42H0kd98Gbd82aA99a61S2Z5LbQ9u430M0"; public static String UC_APPID = "4"; @@ -86,6 +86,8 @@ public class Client extends PHPFunctions{ sep = "&"; } String $postdata = uc_api_requestdata(module, action, str.toString(), ""); + UC_API = SiteCenter.getInstance().acquireUrlByKind("bbs.ucapi"); + UC_IP = SiteCenter.getInstance().acquireUrlByKind("bbs.ip"); return uc_fopen2(UC_API + "/index.php", 500000, $postdata, "", true, UC_IP, 20, true); } diff --git a/designer_base/src/com/fr/design/fun/DesignerFrameUpButtonProvider.java b/designer_base/src/com/fr/design/fun/DesignerFrameUpButtonProvider.java new file mode 100644 index 000000000..b6a86ae81 --- /dev/null +++ b/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); +} diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractDsinFrameUpButtonProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractDsinFrameUpButtonProvider.java new file mode 100644 index 000000000..bd1f70829 --- /dev/null +++ b/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(); + } +} diff --git a/designer_base/src/com/fr/design/gui/icontainer/UIScrollPane.java b/designer_base/src/com/fr/design/gui/icontainer/UIScrollPane.java index 62a580c38..5c71efc7a 100644 --- a/designer_base/src/com/fr/design/gui/icontainer/UIScrollPane.java +++ b/designer_base/src/com/fr/design/gui/icontainer/UIScrollPane.java @@ -15,7 +15,7 @@ public class UIScrollPane extends JScrollPane { private static final long serialVersionUID = 1L; public UIScrollPane(Component c) { - super(c, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + super(c, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); this.setHorizontalScrollBar(createHorizontalScrollBar()); this.getVerticalScrollBar().setUnitIncrement(30); this.getVerticalScrollBar().setBlockIncrement(30); diff --git a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java index a1f5f16a4..329b63155 100644 --- a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java +++ b/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(); diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java index 8478e2500..58060d91a 100644 --- a/designer_base/src/com/fr/design/mainframe/JTemplate.java +++ b/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> 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> ex public boolean acceptToolbarItem(Class clazz) { return true; } + + /** + * 加载插件中的按钮 + * @return 按钮组 + */ + public UIButton[] createExtraButtons() { + Set 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; + } } \ No newline at end of file diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 1d5cd101a..2dfb2b8cd 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -94,6 +94,10 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh if(rowChart == null) { continue; } + + //初始化图表模型图片 + initChartsDemoImage(rowChart); + String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); Icon icon = IOUtils.readIcon(iconPath); child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]); @@ -101,6 +105,14 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh return child; } + private static void initChartsDemoImage(Chart[] rowChart) { + int rowChartsCount = rowChart.length; + for (int j = 0; j < rowChartsCount; j++) { + //此时,为图片生成模型数据 + rowChart[j].createSlotImage(); + } + } + private synchronized static void envChanged() { classManager = null; } diff --git a/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java b/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java index 8f4df6e74..20b12d888 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java +++ b/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%