From c8a1ab412dbff603249b46b36d118c3cac4ada88 Mon Sep 17 00:00:00 2001 From: fr_shine Date: Wed, 16 Nov 2016 16:50:54 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=97=A5=E6=96=87=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E4=B8=8B=EF=BC=8C=E8=B0=83=E6=8E=92=E7=89=88=E5=92=8Ctooltip?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/gui/ChartDataPane.java | 3 +++ .../chart/gui/data/NormalChartDataPane.java | 2 +- .../chart/gui/data/TableDataPane.java | 2 +- .../CategoryPlotTableDataContentPane.java | 2 +- .../table/SeriesNameUseFieldValuePane.java | 9 ++++---- .../data/table/SeriesTypeUseComboxPane.java | 2 +- .../chart/gui/type/ChartTabPane.java | 23 +++++++++++++++++++ 7 files changed, 35 insertions(+), 8 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartDataPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartDataPane.java index 7fc3c79d93..464d6aaf96 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartDataPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartDataPane.java @@ -15,6 +15,9 @@ import javax.swing.*; import java.awt.*; public class ChartDataPane extends AbstractChartAttrPane { + + public static final int LABEL_WIDTH = 85; + public static final int LABEL_HEIGHT = 20; protected DataContentsPane contentsPane; protected AttributeChangeListener listener; diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java index d5aa2d93ec..cae7afc39a 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java @@ -57,7 +57,7 @@ public class NormalChartDataPane extends DataContentsPane { JPanel northPane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE,0)); northPane.add(jcb, BorderLayout.CENTER); UILabel label1 = new UILabel(Inter.getLocText("Chart-Data_Resource") + ":", SwingConstants.RIGHT); - label1.setPreferredSize(new Dimension(75,20)); + label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT)); northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); this.add(northPane, BorderLayout.NORTH); this.add(cardPane, BorderLayout.CENTER); diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java index 2bed0cb2d4..3b6c71ef1e 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java @@ -32,7 +32,7 @@ public class TableDataPane extends FurtherBasicBeanPane{ private void initDataPane() { UILabel label = new BoldFontTextLabel(Inter.getLocText("Chart-DS_TableData") + ":", SwingConstants.RIGHT) ; - label.setPreferredSize(new Dimension(75,20)); + label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT)); tableDataPane = new DatabaseTableDataPane(label) { @Override protected void userEvent() { diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java index 3f1e532681..a8c1bc1f87 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java @@ -42,7 +42,7 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa JPanel categoryPane = new JPanel(new BorderLayout(4,0)); categoryPane.setBorder(BorderFactory.createMatteBorder(0, 0, 6, 1, getBackground())); UILabel label1 = new BoldFontTextLabel(Inter.getLocText("FR-Chart-Category_Name") + ":", SwingConstants.RIGHT) ; - label1.setPreferredSize(new Dimension(75,20)); + label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT)); categoryCombox.setPreferredSize(new Dimension(100,20)); categoryCombox.addItem(Inter.getLocText("Chart-Use_None")); diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java index 2d5099db4d..1ef6972a96 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java @@ -11,6 +11,7 @@ import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; @@ -76,12 +77,12 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane { this.setLayout(new BorderLayout(4, LayoutConstants.VGAP_MEDIUM)); JPanel northPane = new JPanel(new BorderLayout(4, 0)); UILabel label1 = new UILabel(Inter.getLocText("ChartF-Series_Name_From") + ":", SwingConstants.RIGHT); - label1.setPreferredSize(new Dimension(75, 20)); + label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT)); northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1)); this.add(northPane, BorderLayout.NORTH); diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java index 85e7e693c4..40fc6fe55e 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.chart.gui.type; import com.fr.chart.chartattr.Chart; import com.fr.design.dialog.MultiTabPane; +import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.mainframe.chart.gui.style.legend.AutoSelectedPane; import com.fr.general.ComparatorUtils; import com.fr.stable.StringUtils; @@ -15,6 +16,7 @@ import java.awt.*; public abstract class ChartTabPane extends MultiTabPane { private static final long serialVersionUID = 8633385688766835240L; + private boolean setTooltip = true; @Override protected void initLayout() { @@ -26,6 +28,27 @@ public abstract class ChartTabPane extends MultiTabPane { this.add(centerPane, BorderLayout.CENTER); } + //日文环境下,显示不全的,用tooltip + private void setSomeTooltipText() { + this.setVisible(true); + for(int i = 0, size = paneList.size(); i button.getSize().getWidth()) { + button.setToolTipText(tooltip); + } + } + } + + @Override + public void paint(Graphics g) { + super.paint(g); + if(setTooltip) { + setSomeTooltipText(); + setTooltip = false; + } + } + @Override public boolean accept(Object ob) { return false; From 5b1134f2370a3afd8056a0d6a561a02634e2ae9b Mon Sep 17 00:00:00 2001 From: fr_shine Date: Wed, 16 Nov 2016 16:53:31 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=97=A0=E6=84=8F=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java index 40fc6fe55e..a715643e0b 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java @@ -30,7 +30,6 @@ public abstract class ChartTabPane extends MultiTabPane { //日文环境下,显示不全的,用tooltip private void setSomeTooltipText() { - this.setVisible(true); for(int i = 0, size = paneList.size(); i Date: Thu, 17 Nov 2016 12:55:41 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=85=B1=E4=BA=AB=E8=BF=9C=E7=A8=8B=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/env/RemoteEnv.java | 46 ++++++++++++++++++- .../mainframe/FormWidgetDetailPane.java | 6 --- .../fr/design/mainframe/ShareWidgetPane.java | 17 +++---- 3 files changed, 53 insertions(+), 16 deletions(-) diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index 6aff74d7ca..ab9cc6f4d7 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -22,6 +22,7 @@ import com.fr.file.CacheManager; import com.fr.file.DatasourceManager; import com.fr.file.DatasourceManagerProvider; import com.fr.file.filetree.FileNode; +import com.fr.form.share.ShareConstants; import com.fr.general.*; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; @@ -31,8 +32,6 @@ import com.fr.plugin.Plugin; import com.fr.plugin.PluginLicense; import com.fr.plugin.PluginLicenseManager; import com.fr.plugin.PluginLoader; -import com.fr.plugin.dependence.PluginServiceCreator; -import com.fr.plugin.dependence.PluginServiceManager; import com.fr.stable.*; import com.fr.stable.file.XMLFileManagerProvider; import com.fr.stable.project.ProjectConstants; @@ -2105,4 +2104,47 @@ public class RemoteEnv implements Env { public void checkAndRegisterLic(FileNode node, Plugin plugin) throws Exception { } + + @Override + public File[] loadREUFile() throws Exception { + File target = new File(CacheManager.getProviderInstance().getCacheDirectory(), + "fr_share"); + StableUtils.deleteFile(target); + StableUtils.mkdirs(target); + File cacheDir = null; + File zip = null; + try { + HashMap para = new HashMap(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_read_reufile"); + para.put("current_uid", this.createUserID()); + para.put("currentUsername", this.getUser()); + + HttpClient client = createHttpMethod(para); + InputStream input = client.getResponseStream(); + zip = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), "share.zip"); + cacheDir = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), ShareConstants.DIR_SHARE_CACHE); + StableUtils.deleteFile(cacheDir); + StableUtils.mkdirs(cacheDir); + StableUtils.makesureFileExist(zip); + FileOutputStream out = new FileOutputStream(zip); + IOUtils.copyBinaryTo(input, out); + out.flush(); + out.close(); + IOUtils.unzip(zip, cacheDir.getAbsolutePath(), EncodeConstants.ENCODING_GBK);//先解压到临时目录 + if (cacheDir.exists() && cacheDir.isDirectory()) { + return cacheDir.listFiles(new FilenameFilter() { + public boolean accept(File file, String s) { + return s.endsWith("reu"); + } + }); + } + + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage()); + } finally { + StableUtils.deleteFile(zip); + } + return null; + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java index 5beea605c8..4922d8b114 100644 --- a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -2,11 +2,6 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.base.FRContext; -import com.fr.design.dialog.BasicPane; -import com.fr.design.dialog.UIDialog; -import com.fr.design.extra.PluginWebBridge; -import com.fr.design.extra.ShopDialog; -import com.fr.design.extra.WebManagerPaneFactory; import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; @@ -99,7 +94,6 @@ public class FormWidgetDetailPane extends FormDockView{ reuWidgetPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); reuWidgetPanel.setBorder(null); if (elCaseBindInfoList == null) { - elCaseBindInfoList = new ElCaseBindInfo[0]; if (sw != null) { sw.cancel(true); } diff --git a/designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java b/designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java index cd04300bf1..3965511355 100644 --- a/designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java +++ b/designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java @@ -14,15 +14,16 @@ public class ShareWidgetPane extends JPanel { public ShareWidgetPane(ElCaseBindInfo[] elCaseBindInfoList, boolean isEdit) { this.setBorder(BorderFactory.createEmptyBorder(10, 3, 0, 0));// 设置面板的边框 ,距离上、左、下、右 的距离 - int rowCount = (elCaseBindInfoList.length + 1) / 2; - this.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 10)); - for (ElCaseBindInfo rbModuleInfo : elCaseBindInfoList) { - ShareWidgetButton widgetButton = new ShareWidgetButton(rbModuleInfo); - widgetButton.setElementCaseEdit(isEdit); - this.add(widgetButton); + if (elCaseBindInfoList != null) { + int rowCount = (elCaseBindInfoList.length + 1) / 2; + this.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 10)); + for (ElCaseBindInfo rbModuleInfo : elCaseBindInfoList) { + ShareWidgetButton widgetButton = new ShareWidgetButton(rbModuleInfo); + widgetButton.setElementCaseEdit(isEdit); + this.add(widgetButton); + } + this.setPreferredSize(new Dimension(240, rowCount * 80)); } - this.setPreferredSize(new Dimension(240, rowCount * 80)); - } } \ No newline at end of file From a8923863400d82eeeef055577702ad7c000d9fbe Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 17 Nov 2016 13:01:19 +0800 Subject: [PATCH 4/4] PMD --- designer_base/src/com/fr/env/RemoteEnv.java | 2 +- .../src/com/fr/design/mainframe/FormWidgetDetailPane.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index ab9cc6f4d7..85fa191302 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -2145,6 +2145,6 @@ public class RemoteEnv implements Env { } finally { StableUtils.deleteFile(zip); } - return null; + return new File[0]; } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java index 4922d8b114..bcc1400beb 100644 --- a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -14,6 +14,7 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.share.ShareConstants; import com.fr.form.share.ShareLoader; import com.fr.form.ui.ElCaseBindInfo; +import com.fr.general.FRLogger; import com.fr.general.Inter; import com.fr.general.SiteCenter; import com.fr.stable.StringUtils; @@ -227,7 +228,7 @@ public class FormWidgetDetailPane extends FormDockView{ try { Desktop.getDesktop().browse(new URI(url)); } catch (IOException exp) { - JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); + JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer_Set_default_browser")); FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); } catch (URISyntaxException exp) { FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); @@ -303,7 +304,7 @@ public class FormWidgetDetailPane extends FormDockView{ JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_OK")); } catch (IOException e) { JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Error")); - e.printStackTrace(); + FRLogger.getLogger().error(e.getMessage(), e); } } @@ -312,7 +313,7 @@ public class FormWidgetDetailPane extends FormDockView{ try { ShareLoader.getLoader().refreshModule(); } catch (Exception e) { - e.printStackTrace(); + FRLogger.getLogger().error(e.getMessage(), e); } }