From e51f5286469e0c02b38ac11b5071146c71dc319f Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Mon, 5 Jun 2017 16:42:07 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=AF=94=E8=BE=83?= =?UTF-8?q?=EF=BC=9A=2010.0=20>=209.0=201.10=20>=201.9=201.1.2=20>=201.1.1?= =?UTF-8?q?=201.1.1=20>=201.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/extra/PluginHelper.java | 70 ++++++++++++++++++- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/designer_base/src/com/fr/design/extra/PluginHelper.java b/designer_base/src/com/fr/design/extra/PluginHelper.java index 5180af88f1..d160e1c9c1 100644 --- a/designer_base/src/com/fr/design/extra/PluginHelper.java +++ b/designer_base/src/com/fr/design/extra/PluginHelper.java @@ -8,7 +8,6 @@ import com.fr.general.*; import com.fr.general.http.HttpClient; import com.fr.plugin.Plugin; import com.fr.plugin.PluginConfigManager; -import com.fr.stable.plugin.PluginConstants; import com.fr.plugin.PluginLoader; import com.fr.plugin.PluginManagerHelper; import com.fr.plugin.dependence.PluginDependence; @@ -18,11 +17,15 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.EncodeConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import com.fr.stable.plugin.PluginConstants; import com.fr.stable.project.ProjectConstants; import com.fr.stable.xml.XMLTools; import javax.swing.*; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URLDecoder; import java.util.ArrayList; @@ -42,6 +45,8 @@ public class PluginHelper { public static final String DEPENDENCE_DOWNLOAD_PATH = System.getProperty("user.dir") + "/download/dependence"; public static final String TEMP_FILE = "temp.zip"; public static final String CONNECTION_404 = "404"; + + private static final String LOW_VERSION = "0"; /** * 下载插件 @@ -337,7 +342,66 @@ public class PluginHelper { * @return 当前插件比老的插件版本高则返回true,否则返回false */ public static boolean isNewThan(Plugin plugin, Plugin oldPlugin) { - return ComparatorUtils.compare(plugin.getVersion(), oldPlugin.getVersion()) >= 0; + + return compareVersion(plugin.getVersion(), oldPlugin.getVersion()) >= 0; + } + + private static int compareVersion(String version1, String version2) { + + if (StringUtils.isBlank(version1)) { + version1 = LOW_VERSION; + } + if (StringUtils.isBlank(version2)) { + version2 = LOW_VERSION; + } + //1.1.1类型 + String[] v1 = parseVersion(version1); + String[] v2 = parseVersion(version2); + return compareVersion(v1, v2); + } + + private static int compareVersion(String[] v1, String[] v2) { + //v1,v2都是1.1.1类型的数组 + int result = 0; + int tempResult; + for (int i = 0; i < v1.length; i++) { + if (i >= v2.length) { + //一直没分出大小,v2用完了,v1大 + result = 1; + break; + } + tempResult = compareIntStr(v1[i], v2[i]); + if (tempResult != 0) { + //分出大小,停止后续比较 + result = tempResult; + break; + } + } + //循环完了v1,如果还没比出大小 + if (result == 0 && v2.length > v1.length) { + result = -1; + } + return result; + } + + private static int compareIntStr(String s1, String s2) { + + return Integer.parseInt(s1) - Integer.parseInt(s2); + } + + private static String[] parseVersion(String versionStr) { + + char c; + StringBuilder sBuilder = new StringBuilder(); + for (int i = 0; i < versionStr.length(); i++) { + c = versionStr.charAt(i); + if (Character.isDigit(c)) { + sBuilder.append(c); + } else if (c == '.') { + sBuilder.append("-"); + } + } + return sBuilder.toString().split("-"); } private static String sendInstalledPluginInfo(final Plugin plugin) { From f18b20cd96bf6cb86ca5e0fc7968eda974949d12 Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Mon, 5 Jun 2017 16:47:52 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=AF=94=E8=BE=83=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/extra/PluginHelper.java | 60 +------------------ 1 file changed, 1 insertion(+), 59 deletions(-) diff --git a/designer_base/src/com/fr/design/extra/PluginHelper.java b/designer_base/src/com/fr/design/extra/PluginHelper.java index d160e1c9c1..1230cbfae6 100644 --- a/designer_base/src/com/fr/design/extra/PluginHelper.java +++ b/designer_base/src/com/fr/design/extra/PluginHelper.java @@ -46,7 +46,6 @@ public class PluginHelper { public static final String TEMP_FILE = "temp.zip"; public static final String CONNECTION_404 = "404"; - private static final String LOW_VERSION = "0"; /** * 下载插件 @@ -343,67 +342,10 @@ public class PluginHelper { */ public static boolean isNewThan(Plugin plugin, Plugin oldPlugin) { - return compareVersion(plugin.getVersion(), oldPlugin.getVersion()) >= 0; + return plugin.versionCompareTo(oldPlugin) >= 0; } - private static int compareVersion(String version1, String version2) { - - if (StringUtils.isBlank(version1)) { - version1 = LOW_VERSION; - } - if (StringUtils.isBlank(version2)) { - version2 = LOW_VERSION; - } - //1.1.1类型 - String[] v1 = parseVersion(version1); - String[] v2 = parseVersion(version2); - return compareVersion(v1, v2); - } - private static int compareVersion(String[] v1, String[] v2) { - //v1,v2都是1.1.1类型的数组 - int result = 0; - int tempResult; - for (int i = 0; i < v1.length; i++) { - if (i >= v2.length) { - //一直没分出大小,v2用完了,v1大 - result = 1; - break; - } - tempResult = compareIntStr(v1[i], v2[i]); - if (tempResult != 0) { - //分出大小,停止后续比较 - result = tempResult; - break; - } - } - //循环完了v1,如果还没比出大小 - if (result == 0 && v2.length > v1.length) { - result = -1; - } - return result; - } - - private static int compareIntStr(String s1, String s2) { - - return Integer.parseInt(s1) - Integer.parseInt(s2); - } - - private static String[] parseVersion(String versionStr) { - - char c; - StringBuilder sBuilder = new StringBuilder(); - for (int i = 0; i < versionStr.length(); i++) { - c = versionStr.charAt(i); - if (Character.isDigit(c)) { - sBuilder.append(c); - } else if (c == '.') { - sBuilder.append("-"); - } - } - return sBuilder.toString().split("-"); - } - private static String sendInstalledPluginInfo(final Plugin plugin) { if (StableUtils.isDebug()) { return "debug status"; From 5dda04e93b7a2e83a057d5abd171a02e18b41316 Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 6 Jun 2017 16:13:36 +0800 Subject: [PATCH 3/7] =?UTF-8?q?REPORT-2561=20=E5=A4=A7=E5=B1=8F-=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E6=97=B6=E9=92=9F=E6=8F=92=E4=BB=B6=EF=BC=8C=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E8=A1=A8=E5=B7=A6=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../properties/WidgetPropertyTable.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java b/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java index f69771a54a..46f48befae 100644 --- a/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java +++ b/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java @@ -26,12 +26,13 @@ import com.fr.general.ComparatorUtils; public class WidgetPropertyTable extends AbstractPropertyTable { private FormDesigner designer; + private static final int LEFT_COLUMN_WIDTH = 97; // "属性名"列的宽度 public WidgetPropertyTable(FormDesigner designer) { super(); setDesigner(designer); } - + public static ArrayList getCreatorPropertyGroup(FormDesigner designer, XCreator source) { ArrayList groups = new ArrayList(); ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, source); @@ -86,10 +87,12 @@ public class WidgetPropertyTable extends AbstractPropertyTable { setModel(model); this.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); TableColumn tc = this.getColumn(this.getColumnName(0)); - tc.setPreferredWidth(30); + tc.setPreferredWidth(LEFT_COLUMN_WIDTH); + tc.setMinWidth(LEFT_COLUMN_WIDTH); + tc.setMaxWidth(LEFT_COLUMN_WIDTH); this.repaint(); } - + private void setDesigner(FormDesigner designer) { this.designer = designer; } @@ -97,8 +100,8 @@ public class WidgetPropertyTable extends AbstractPropertyTable { /** * 单元格tooltip - * 属性名悬浮提示 - * + * 属性名悬浮提示 + * * @param 鼠标点击事件 * @return 单元格tooltip */ @@ -110,11 +113,11 @@ public class WidgetPropertyTable extends AbstractPropertyTable { } return null; } - + /** * 待说明 */ public void firePropertyEdit() { designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_EDITED); } -} \ No newline at end of file +} From d70e9db8be9647ffe3fec3266d6ae11191017963 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 8 Jun 2017 17:32:35 +0800 Subject: [PATCH 4/7] =?UTF-8?q?REPORT-2561=20=E5=A4=A7=E5=B1=8F-=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E6=97=B6=E9=92=9F=E6=8F=92=E4=BB=B6=EF=BC=8C=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E8=A1=A8=E5=B7=A6=E7=A7=BB=EF=BC=8C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/properties/WidgetPropertyTable.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java b/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java index 46f48befae..32fc44df63 100644 --- a/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java +++ b/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java @@ -27,6 +27,7 @@ public class WidgetPropertyTable extends AbstractPropertyTable { private FormDesigner designer; private static final int LEFT_COLUMN_WIDTH = 97; // "属性名"列的宽度 + private static final int RIGHT_COLUMN_WIDTH = 138; // "属性值"列的宽度 public WidgetPropertyTable(FormDesigner designer) { super(); @@ -85,11 +86,13 @@ public class WidgetPropertyTable extends AbstractPropertyTable { } TableModel model = new BeanTableModel(); setModel(model); - this.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); TableColumn tc = this.getColumn(this.getColumnName(0)); - tc.setPreferredWidth(LEFT_COLUMN_WIDTH); tc.setMinWidth(LEFT_COLUMN_WIDTH); tc.setMaxWidth(LEFT_COLUMN_WIDTH); + TableColumn tcRight = this.getColumn(this.getColumnName(1)); + tcRight.setMinWidth(RIGHT_COLUMN_WIDTH); + tcRight.setMaxWidth(RIGHT_COLUMN_WIDTH); + this.repaint(); } From 3f655e7a0f0aa4d6ffe59e27a285f3bebfb2973a Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 9 Jun 2017 17:21:15 +0800 Subject: [PATCH 5/7] =?UTF-8?q?REPORT-2561=20=E5=A4=A7=E5=B1=8F-=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E6=97=B6=E9=92=9F=E6=8F=92=E4=BB=B6=EF=BC=8C=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E8=A1=A8=E5=B7=A6=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../properties/WidgetPropertyTable.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java b/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java index 32fc44df63..07621fc260 100644 --- a/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java +++ b/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java @@ -27,7 +27,6 @@ public class WidgetPropertyTable extends AbstractPropertyTable { private FormDesigner designer; private static final int LEFT_COLUMN_WIDTH = 97; // "属性名"列的宽度 - private static final int RIGHT_COLUMN_WIDTH = 138; // "属性值"列的宽度 public WidgetPropertyTable(FormDesigner designer) { super(); @@ -86,16 +85,21 @@ public class WidgetPropertyTable extends AbstractPropertyTable { } TableModel model = new BeanTableModel(); setModel(model); + this.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); TableColumn tc = this.getColumn(this.getColumnName(0)); tc.setMinWidth(LEFT_COLUMN_WIDTH); tc.setMaxWidth(LEFT_COLUMN_WIDTH); - TableColumn tcRight = this.getColumn(this.getColumnName(1)); - tcRight.setMinWidth(RIGHT_COLUMN_WIDTH); - tcRight.setMaxWidth(RIGHT_COLUMN_WIDTH); this.repaint(); } + private void setRightColumnWidth(boolean automode) { + int rightColumnWidth = this.getWidth() - LEFT_COLUMN_WIDTH; + TableColumn tcRight = this.getColumn(this.getColumnName(1)); + tcRight.setMinWidth(automode ? 0 : rightColumnWidth); + tcRight.setMaxWidth(automode ? this.getWidth() : rightColumnWidth); + } + private void setDesigner(FormDesigner designer) { this.designer = designer; } @@ -117,6 +121,13 @@ public class WidgetPropertyTable extends AbstractPropertyTable { return null; } + @Override + public void columnMarginChanged(javax.swing.event.ChangeEvent e) { + setRightColumnWidth(false); + super.columnMarginChanged(e); + setRightColumnWidth(true); + } + /** * 待说明 */ From 6213784e43bab3455bfd1e11e7c0a5379bca4267 Mon Sep 17 00:00:00 2001 From: eason-skx Date: Thu, 15 Jun 2017 15:08:54 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SeriesCondition/dlp/DataLabelPane.java | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java index 7d8b6c8ce1..3bad0eefd6 100644 --- a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java +++ b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java @@ -111,34 +111,9 @@ public class DataLabelPane extends TooltipContentsPane { } protected JPanel createJPanel4Position() { - // 标签位置:上下左右中. - bottomButton = new UIRadioButton(Inter.getLocText("StyleAlignment-Bottom")); - leftButton = new UIRadioButton(Inter.getLocText("StyleAlignment-Left")); - rigtButton = new UIRadioButton(Inter.getLocText("StyleAlignment-Right")); - topButton = new UIRadioButton(Inter.getLocText("StyleAlignment-Top")); - centerButton = new UIRadioButton(Inter.getLocText("Center")); - - ButtonGroup bg = new ButtonGroup(); - bg.add(bottomButton); - bg.add(leftButton); - bg.add(rigtButton); - bg.add(topButton); - bg.add(centerButton); - topButton.setSelected(true); - - JPanel buttonPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); - buttonPane.add(new UILabel(Inter.getLocText(new String[]{"Label", "Layout"}) + ":")); - buttonPane.add(bottomButton); - buttonPane.add(leftButton); - buttonPane.add(rigtButton); - buttonPane.add(topButton); - buttonPane.add(centerButton); - - return buttonPane; + return null; } - - public void populate(AttrContents seriesAttrContents) { super.populate(seriesAttrContents); String dataLabel = seriesAttrContents.getSeriesLabel(); From de3fbb5cabd0ca2ca9b076b9c06b91e1bc46ad9e Mon Sep 17 00:00:00 2001 From: eason-skx Date: Thu, 15 Jun 2017 15:27:32 +0800 Subject: [PATCH 7/7] pmd --- .../design/chart/series/SeriesCondition/dlp/DataLabelPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java index 3bad0eefd6..3a200ee3ce 100644 --- a/designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java +++ b/designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java @@ -96,7 +96,7 @@ public class DataLabelPane extends TooltipContentsPane { } delimiterBox.setPreferredSize(new Dimension(70, 20)); JPanel boxPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); - boxPane.add(new UILabel(Inter.getLocText("Form-Delimiter") + ":")); + boxPane.add(new UILabel(Inter.getLocText("FR-Designer_Dismenber") + ":")); boxPane.add(delimiterBox); return boxPane; }