From 03a3ffe770f91258e5c8f7a2db00ce66a80ce5b9 Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Tue, 22 Aug 2017 09:43:43 +0800 Subject: [PATCH 01/30] =?UTF-8?q?PFC-607=20=E6=8F=92=E4=BB=B6=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=88=A0=E9=99=A4=E6=9B=B4=E6=96=B0=E4=B8=8D=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E6=94=AF=E6=8C=81=20=E6=B7=BB=E5=8A=A0=E6=89=93?= =?UTF-8?q?=E5=8C=85=E5=89=8D=E9=A2=84=E5=A4=84=E7=90=86=EF=BC=8C=E5=9C=A8?= =?UTF-8?q?=E8=BF=99=E4=B8=AA=E6=97=B6=E5=80=99=E5=81=9A=E5=8A=A0=E5=AF=86?= =?UTF-8?q?=E3=80=81=E8=87=AA=E5=8A=A8=E6=B7=BB=E5=8A=A0currentAPILevel?= =?UTF-8?q?=E7=AD=89class=E6=96=87=E4=BB=B6=E7=9A=84=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/fun/ExportToolBarProvider.java | 5 +++-- .../com/fr/design/chart/fun/IndependentChartUIProvider.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/designer_base/src/com/fr/design/fun/ExportToolBarProvider.java b/designer_base/src/com/fr/design/fun/ExportToolBarProvider.java index 4e53e96dd2..cfcfd2586f 100644 --- a/designer_base/src/com/fr/design/fun/ExportToolBarProvider.java +++ b/designer_base/src/com/fr/design/fun/ExportToolBarProvider.java @@ -1,6 +1,6 @@ package com.fr.design.fun; -import com.fr.plugin.injectable.SpecialLevel; +import com.fr.stable.fun.mark.API; import com.fr.stable.fun.mark.Mutable; import javax.swing.*; @@ -8,9 +8,10 @@ import javax.swing.*; /** * 导出菜单设计器端拓展,用于控制该菜单是否在web端显示 */ +@API(level = ExportToolBarProvider.CURRENT_LEVEL) public interface ExportToolBarProvider extends Mutable{ - String XML_TAG = SpecialLevel.ExportToolBarProvider.getTagName(); + String XML_TAG = "ExportToolBarProvider"; int CURRENT_LEVEL = 1; diff --git a/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java b/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java index 290e22eaac..68efd13c78 100644 --- a/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java +++ b/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java @@ -12,8 +12,8 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; -import com.fr.plugin.injectable.SpecialLevel; import com.fr.stable.fun.Level; +import com.fr.stable.fun.mark.API; /** * Created by eason on 14/12/29. @@ -21,9 +21,10 @@ import com.fr.stable.fun.Level; * @since 8.0 * 自定义图表类型设设计界面接口 */ +@API(level = IndependentChartUIProvider.CURRENT_API_LEVEL) public interface IndependentChartUIProvider extends Level { - String XML_TAG = SpecialLevel.IndependentChartUIProvider.getTagName(); + String XML_TAG = "IndependentChartUIProvider"; int CURRENT_API_LEVEL = 3; From a8dc0b036c98acac03deb792824124cdfdcde712 Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Tue, 22 Aug 2017 10:13:32 +0800 Subject: [PATCH 02/30] =?UTF-8?q?PFC-607=20=E6=8F=92=E4=BB=B6=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=88=A0=E9=99=A4=E6=9B=B4=E6=96=B0=E4=B8=8D=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E6=94=AF=E6=8C=81=20=E4=B8=8D=E5=90=88=E8=A7=84?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3=E7=B1=BB=E4=B8=8D=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/fun/ExportToolBarProvider.java | 5 ++--- .../com/fr/design/chart/fun/IndependentChartUIProvider.java | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/designer_base/src/com/fr/design/fun/ExportToolBarProvider.java b/designer_base/src/com/fr/design/fun/ExportToolBarProvider.java index cfcfd2586f..4e53e96dd2 100644 --- a/designer_base/src/com/fr/design/fun/ExportToolBarProvider.java +++ b/designer_base/src/com/fr/design/fun/ExportToolBarProvider.java @@ -1,6 +1,6 @@ package com.fr.design.fun; -import com.fr.stable.fun.mark.API; +import com.fr.plugin.injectable.SpecialLevel; import com.fr.stable.fun.mark.Mutable; import javax.swing.*; @@ -8,10 +8,9 @@ import javax.swing.*; /** * 导出菜单设计器端拓展,用于控制该菜单是否在web端显示 */ -@API(level = ExportToolBarProvider.CURRENT_LEVEL) public interface ExportToolBarProvider extends Mutable{ - String XML_TAG = "ExportToolBarProvider"; + String XML_TAG = SpecialLevel.ExportToolBarProvider.getTagName(); int CURRENT_LEVEL = 1; diff --git a/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java b/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java index 68efd13c78..290e22eaac 100644 --- a/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java +++ b/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java @@ -12,8 +12,8 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; +import com.fr.plugin.injectable.SpecialLevel; import com.fr.stable.fun.Level; -import com.fr.stable.fun.mark.API; /** * Created by eason on 14/12/29. @@ -21,10 +21,9 @@ import com.fr.stable.fun.mark.API; * @since 8.0 * 自定义图表类型设设计界面接口 */ -@API(level = IndependentChartUIProvider.CURRENT_API_LEVEL) public interface IndependentChartUIProvider extends Level { - String XML_TAG = "IndependentChartUIProvider"; + String XML_TAG = SpecialLevel.IndependentChartUIProvider.getTagName(); int CURRENT_API_LEVEL = 3; From f4ff6dd948fabf847be13937634683d28ab3a9f9 Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 22 Aug 2017 16:37:01 +0800 Subject: [PATCH 03/30] =?UTF-8?q?REPORT-3850=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E9=80=80=E5=87=BA=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=90=8E=E7=95=8C=E9=9D=A2=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E4=BB=8D=E6=98=BE=E7=A4=BA=E6=9D=83=E9=99=90=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/ExitAuthorityEditAction.java | 62 ++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java b/designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java index 238e703f19..dfb7f1dd68 100644 --- a/designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java +++ b/designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java @@ -1 +1,61 @@ -package com.fr.design.actions; import com.fr.base.BaseUtils; import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.DesignModelAdapter; import com.fr.design.designer.TargetComponent; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.*; import com.fr.general.Inter; /** * Author : daisy * Date: 13-9-2 * Time: 下午3:36 */ public class ExitAuthorityEditAction extends TemplateComponentAction { public ExitAuthorityEditAction(TargetComponent t) { super(t); this.setName(Inter.getLocText(new String[]{"Exit", "DashBoard-Potence", "Edit"})); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/exit_authority_edit.png")); } public void prepare4Undo() { } public boolean executeActionReturnUndoRecordNeeded() { TargetComponent tc = getEditingComponent(); if (tc == null) { return false; } if (BaseUtils.isAuthorityEditing()) { BaseUtils.setAuthorityEditing(false); WestRegionContainerPane.getInstance().replaceDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); EastRegionContainerPane.getInstance().replaceDownPane(tc.getEastDownPane()); EastRegionContainerPane.getInstance().replaceUpPane(tc.getEastUpPane()); DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus()); DesignerContext.getDesignerFrame().needToAddAuhtorityPaint(); DesignerContext.getDesignerFrame().refreshDottedLine(); fireAuthorityStateToNomal(); } return true; } /** * 退出权限编辑时,将所有的做过权限编辑的状态,作为一个状态赋给报、报表主体 */ private void fireAuthorityStateToNomal() { java.util.List> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); for (int i = 0; i < opendedTemplate.size(); i++) { //如果在权限编辑时做过操作,则将做过的操作作为一个整体状态赋给正在报表 if (opendedTemplate.get(i).isDoSomethingInAuthority()) { opendedTemplate.get(i).fireAuthorityStateToNomal(); } } } } \ No newline at end of file +package com.fr.design.actions; + +import com.fr.base.BaseUtils; +import com.fr.design.data.datapane.TableDataTreePane; +import com.fr.design.DesignModelAdapter; +import com.fr.design.designer.TargetComponent; +import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.mainframe.*; +import com.fr.general.Inter; + +/** + * Author : daisy + * Date: 13-9-2 + * Time: 下午3:36 + */ +public class ExitAuthorityEditAction extends TemplateComponentAction { + + public ExitAuthorityEditAction(TargetComponent t) { + super(t); + this.setName(Inter.getLocText(new String[]{"Exit", "DashBoard-Potence", "Edit"})); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/exit_authority_edit.png")); + } + + + public void prepare4Undo() { + + } + + public boolean executeActionReturnUndoRecordNeeded() { + TargetComponent tc = getEditingComponent(); + if (tc == null) { + return false; + } + + if (BaseUtils.isAuthorityEditing()) { + BaseUtils.setAuthorityEditing(false); + WestRegionContainerPane.getInstance().replaceDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); + HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane(); + DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus()); + DesignerContext.getDesignerFrame().needToAddAuhtorityPaint(); + DesignerContext.getDesignerFrame().refreshDottedLine(); + + fireAuthorityStateToNomal(); + } + return true; + } + + + /** + * 退出权限编辑时,将所有的做过权限编辑的状态,作为一个状态赋给报、报表主体 + */ + private void fireAuthorityStateToNomal() { + java.util.List> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); + for (int i = 0; i < opendedTemplate.size(); i++) { + //如果在权限编辑时做过操作,则将做过的操作作为一个整体状态赋给正在报表 + if (opendedTemplate.get(i).isDoSomethingInAuthority()) { + opendedTemplate.get(i).fireAuthorityStateToNomal(); + } + } + } +} \ No newline at end of file From 72d14d396ba3eccd5caaeec64c29e7d62e5ac5e7 Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 23 Aug 2017 09:48:53 +0800 Subject: [PATCH 04/30] =?UTF-8?q?REPORT-4005=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=20=E8=AE=BE=E7=BD=AE=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=8F=90=E4=BA=A4=E5=85=A5=E5=BA=93=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/ElementCasePaneDelegate.java | 3 +++ .../write/submit/SmartInsertDBManipulationPane.java | 9 +++------ designer/src/com/fr/poly/creator/ECBlockPane.java | 3 +++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java index c5bd1e9525..17eb281543 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -48,6 +48,9 @@ public class ElementCasePaneDelegate extends ElementCasePane { @Override public void selectionChanged(SelectionEvent e) { + if (!isEditable()) { + return; + } //在编辑权限,所以要更新权限编辑面板 if (BaseUtils.isAuthorityEditing()) { AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(ElementCasePaneDelegate.this); diff --git a/designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index e80d89c364..4c5cdb4e2f 100644 --- a/designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -34,10 +34,7 @@ import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.ElementCasePane; -import com.fr.design.mainframe.JTemplate; -import com.fr.design.mainframe.JWorkBook; +import com.fr.design.mainframe.*; import com.fr.design.selection.SelectionEvent; import com.fr.design.selection.SelectionListener; import com.fr.general.Inter; @@ -196,11 +193,11 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { /* * 当前的ReportPane不可编辑,不可切换Sheet,加GridSelectionChangeListener */ - ePane.setSelection(NO_SELECTION); ePane.setEditable(false); + ePane.setSelection(NO_SELECTION); ePane.getGrid().setNotShowingTableSelectPane(false); - BasicDialog dlg = bPane.showWindow(SwingUtilities.getWindowAncestor(SmartInsertDBManipulationPane.this)); + BasicDialog dlg = bPane.showWindow(DesignerContext.getDesignerFrame()); dlg.setModal(false); dlg.setVisible(true); diff --git a/designer/src/com/fr/poly/creator/ECBlockPane.java b/designer/src/com/fr/poly/creator/ECBlockPane.java index edd93ce9ac..ba65847673 100644 --- a/designer/src/com/fr/poly/creator/ECBlockPane.java +++ b/designer/src/com/fr/poly/creator/ECBlockPane.java @@ -52,6 +52,9 @@ public class ECBlockPane extends PolyElementCasePane { @Override public void selectionChanged(SelectionEvent e) { + if (!isEditable()) { + return; + } if (BaseUtils.isAuthorityEditing()) { if (designer.getSelection().getEditingElementCasePane() == null) { EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION_DISABLED); From f1a5ff9d81b69a6d5e1638a02a4ec814e35b2fc6 Mon Sep 17 00:00:00 2001 From: hzzz Date: Wed, 23 Aug 2017 11:19:10 +0800 Subject: [PATCH 05/30] =?UTF-8?q?=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modes/JavaScriptTokenMaker.java | 188 +++++++++--------- .../com/fr/design/images/buttonicon/run24.png | Bin 389 -> 942 bytes .../com/fr/design/images/buttonicon/runs.png | Bin 412 -> 482 bytes .../src/com/fr/design/images/m_edit/paste.png | Bin 258 -> 214 bytes 4 files changed, 94 insertions(+), 94 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/JavaScriptTokenMaker.java b/designer_base/src/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/JavaScriptTokenMaker.java index bc750a84d7..3511931ff0 100644 --- a/designer_base/src/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/JavaScriptTokenMaker.java +++ b/designer_base/src/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/JavaScriptTokenMaker.java @@ -78,10 +78,10 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { public static final int YYINITIAL = 0; public static final int E4X_CDATA = 13; - /** + /** * Translates characters to character classes */ - private static final String ZZ_CMAP_PACKED = + private static final String ZZ_CMAP_PACKED = "\11\0\1\73\1\2\1\0\1\1\1\11\22\0\1\73\1\36\1\75"+ "\1\12\1\15\1\35\1\40\1\105\2\104\1\17\1\30\1\27\1\24"+ "\1\25\1\16\1\5\7\7\2\4\1\41\1\74\1\31\1\32\1\34"+ @@ -92,12 +92,12 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { "\1\65\1\72\1\51\1\47\1\50\1\10\1\70\1\62\1\71\1\66"+ "\1\106\1\111\1\33\1\26\1\42\uff81\0"; - /** + /** * Translates characters to character classes */ private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); - /** + /** * Translates DFA states to action switch labels. */ private static final int [] ZZ_ACTION = zzUnpackAction(); @@ -145,7 +145,7 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { } - /** + /** * Translates a state to a row index in the transition table */ private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); @@ -246,7 +246,7 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { return j; } - /** + /** * The transition table of the DFA */ private static final int [] ZZ_TRANS = zzUnpackTrans(); @@ -1095,7 +1095,7 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { * Token type specifying we're in a JavaScript documentation comment. */ private static final int INTERNAL_IN_JS_COMMENT_DOCUMENTATION = -9; - + /** * Token type specifying we're in an invalid multi-line JS string. */ @@ -1179,7 +1179,7 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { static { - jsVersion = "1.0"; + jsVersion = "7.0"; e4xSupported = true; } @@ -1248,7 +1248,7 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { /** * Returns the closest {@link TokenTypes "standard" token type} for a given * "internal" token type (e.g. one whose value is < 0). - * + * */ @Override public int getClosestStandardTokenTypeForInternalType(int type) { @@ -1411,10 +1411,10 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { /** * Returns whether features for a specific JS version should be honored * while highlighting. - * - * @param version JavaScript version required + * + * @param version JavaScript version required * @return Whether the JavaScript version is the same or greater than - * version required. + * version required. */ public static boolean isJavaScriptCompatible(String version) { return jsVersion.compareTo(version) >= 0; @@ -1463,11 +1463,11 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { * Resets the scanner to read from a new input stream. * Does not close the old reader. * - * All internal variables are reset, the old input stream + * All internal variables are reset, the old input stream * cannot be reused (internal buffer is discarded and lost). * Lexical state is set to YY_INITIAL. * - * @param reader the new input stream + * @param reader the new input stream */ public final void yyreset(java.io.Reader reader) { // 's' has been updated. @@ -1510,7 +1510,7 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { this(new java.io.InputStreamReader(in)); } - /** + /** * Unpacks the compressed character translation table. * * @param packed the packed character translation table @@ -1571,7 +1571,7 @@ public final void yybegin(int newState) { /** * Returns the character at position pos from the * matched text. - * + * * It is equivalent to yytext().charAt(pos), but faster * * @param pos the position of the character to fetch. @@ -1616,7 +1616,7 @@ public final void yybegin(int newState) { } throw new Error(message); - } + } /** @@ -1663,13 +1663,13 @@ public final void yybegin(int newState) { zzAction = -1; zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; - + zzState = zzLexicalState; zzForAction: { while (true) { - + if (zzCurrentPosL < zzEndReadL) zzInput = zzBufferL[zzCurrentPosL++]; else if (zzAtEOF) { @@ -1712,27 +1712,27 @@ public final void yybegin(int newState) { zzMarkedPos = zzMarkedPosL; switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { - case 34: + case 34: { start = zzMarkedPos-1; yybegin(E4X_INATTR_SINGLE); } case 73: break; - case 33: + case 33: { start = zzMarkedPos-1; yybegin(E4X_INATTR_DOUBLE); } case 74: break; - case 36: + case 36: { addToken(Token.ERROR_NUMBER_FORMAT); } case 75: break; - case 71: + case 71: { addToken(Token.RESERVED_WORD_2); } case 76: break; - case 26: + case 26: { addToken(start,zzStartRead-1, Token.MARKUP_DTD); addEndToken(e4x_inInternalDtd ? INTERNAL_E4X_DTD_INTERNAL : INTERNAL_E4X_DTD); return firstToken; } case 77: break; - case 15: + case 15: { /* Line ending in '\' => continue to next line. */ if (validJSString) { addToken(start,zzStartRead, Token.LITERAL_CHAR); @@ -1745,15 +1745,15 @@ public final void yybegin(int newState) { return firstToken; } case 78: break; - case 3: + case 3: { addToken(Token.WHITESPACE); } case 79: break; - case 17: + case 17: { addToken(start,zzStartRead-1, Token.COMMENT_MULTILINE); addEndToken(INTERNAL_IN_JS_MLC); return firstToken; } case 80: break; - case 41: + case 41: { int start = zzStartRead; int operatorLen = yycharat(0)=='+' ? 2 : 1; int yylen = yylength(); // Cache before first addToken() invalidates it @@ -1772,226 +1772,226 @@ public final void yybegin(int newState) { // Scanning will continue at "<" as operator } case 81: break; - case 64: + case 64: { addToken(Token.FUNCTION); } case 82: break; - case 49: + case 49: { int temp=zzStartRead; addToken(start,zzStartRead-1, Token.COMMENT_DOCUMENTATION); addToken(temp,zzMarkedPos-1, Token.COMMENT_MARKUP); start = zzMarkedPos; } case 83: break; - case 44: + case 44: { /* Skip all escaped chars. */ } case 84: break; - case 11: + case 11: { addToken(start,zzStartRead-1, Token.ERROR_STRING_DOUBLE); addNullToken(); return firstToken; } case 85: break; - case 68: + case 68: { start = zzStartRead; e4x_prevState = zzLexicalState; yybegin(E4X_COMMENT); } case 86: break; - case 60: + case 60: { int temp=zzStartRead; yybegin(E4X); addToken(start,zzStartRead-1, Token.MARKUP_CDATA); addToken(temp,zzMarkedPos-1, Token.MARKUP_CDATA_DELIMITER); } case 87: break; - case 58: + case 58: { int count = yylength(); addToken(zzStartRead,zzStartRead+1, Token.MARKUP_TAG_DELIMITER); addToken(zzMarkedPos-(count-2), zzMarkedPos-1, Token.MARKUP_TAG_NAME); yybegin(E4X_INTAG); } case 88: break; - case 46: + case 46: { /* Invalid latin-1 character \xXX */ validJSString = false; } case 89: break; - case 61: + case 61: { addToken(Token.COMMENT_MULTILINE); } case 90: break; - case 52: + case 52: { start = zzMarkedPos-2; yybegin(E4X_PI); } case 91: break; - case 35: + case 35: { yybegin(E4X_INTAG); addToken(start,zzStartRead, Token.MARKUP_TAG_ATTRIBUTE_VALUE); } case 92: break; - case 13: + case 13: { int type = validJSString ? Token.LITERAL_STRING_DOUBLE_QUOTE : Token.ERROR_STRING_DOUBLE; addToken(start,zzStartRead, type); yybegin(YYINITIAL); } case 93: break; - case 19: + case 19: { addToken(start,zzStartRead-1, Token.COMMENT_EOL); addNullToken(); return firstToken; } case 94: break; - case 23: + case 23: { yybegin(YYINITIAL, LANG_INDEX_DEFAULT); addToken(Token.IDENTIFIER); } case 95: break; - case 45: + case 45: { /* Invalid Unicode character \\uXXXX */ validJSString = false; } case 96: break; - case 70: + case 70: { int temp = zzStartRead; addToken(start,zzStartRead-1, Token.MARKUP_DTD); start = temp; e4x_prevState = zzLexicalState; yybegin(E4X_COMMENT); } case 97: break; - case 63: + case 63: { if(e4xSupported){ addToken(Token.RESERVED_WORD);} else {addToken(Token.IDENTIFIER);} } case 98: break; - case 59: + case 59: { int temp = zzMarkedPos; addToken(start,zzStartRead+2, Token.MARKUP_COMMENT); start = temp; yybegin(e4x_prevState); } case 99: break; - case 7: + case 7: { addToken(Token.OPERATOR); } case 100: break; - case 53: + case 53: { yybegin(E4X); addToken(start,zzStartRead+1, Token.MARKUP_PROCESSING_INSTRUCTION); } case 101: break; - case 48: + case 48: { yybegin(YYINITIAL); addToken(start,zzStartRead+1, Token.COMMENT_DOCUMENTATION); } case 102: break; - case 18: + case 18: { addToken(start,zzStartRead-1, Token.COMMENT_DOCUMENTATION); addEndToken(INTERNAL_IN_JS_COMMENT_DOCUMENTATION); return firstToken; } case 103: break; - case 25: + case 25: { addToken(start,zzStartRead-1, Token.MARKUP_PROCESSING_INSTRUCTION); addEndToken(INTERNAL_E4X_MARKUP_PROCESSING_INSTRUCTION); return firstToken; } case 104: break; - case 5: + case 5: { addToken(Token.IDENTIFIER); } case 105: break; - case 42: + case 42: { addToken(isE4xSupported() ? Token.MARKUP_TAG_ATTRIBUTE : Token.ERROR_IDENTIFIER); } case 106: break; - case 65: + case 65: { int temp=zzStartRead; addToken(start,zzStartRead-1, Token.COMMENT_EOL); addHyperlinkToken(temp,zzMarkedPos-1, Token.COMMENT_EOL); start = zzMarkedPos; } case 107: break; - case 55: + case 55: { start = zzMarkedPos-3; yybegin(JS_DOCCOMMENT); } case 108: break; - case 9: + case 9: { start = zzMarkedPos-1; validJSString = true; yybegin(JS_STRING); } case 109: break; - case 51: + case 51: { start = zzMarkedPos-2; e4x_inInternalDtd = false; yybegin(E4X_DTD); } case 110: break; - case 24: + case 24: { addToken(start,zzStartRead-1, Token.MARKUP_COMMENT); addEndToken(INTERNAL_IN_E4X_COMMENT - e4x_prevState); return firstToken; } case 111: break; - case 10: + case 10: { start = zzMarkedPos-1; validJSString = true; yybegin(JS_CHAR); } case 112: break; - case 28: + case 28: { e4x_inInternalDtd = true; } case 113: break; - case 67: + case 67: { int temp=zzStartRead; addToken(start,zzStartRead-1, Token.COMMENT_DOCUMENTATION); addHyperlinkToken(temp,zzMarkedPos-1, Token.COMMENT_DOCUMENTATION); start = zzMarkedPos; } case 114: break; - case 40: + case 40: { start = zzMarkedPos-2; yybegin(JS_MLC); } case 115: break; - case 38: + case 38: { addToken(Token.LITERAL_NUMBER_HEXADECIMAL); } case 116: break; - case 72: + case 72: { addToken(Token.MARKUP_CDATA_DELIMITER); start = zzMarkedPos; yybegin(E4X_CDATA); } case 117: break; - case 31: + case 31: { addToken(Token.MARKUP_TAG_DELIMITER); /* Not valid but we'll still accept it */ } case 118: break; - case 2: + case 2: { addToken(Token.ERROR_IDENTIFIER); } case 119: break; - case 69: + case 69: { int temp=zzStartRead; addToken(start,zzStartRead-1, Token.MARKUP_COMMENT); addHyperlinkToken(temp,zzMarkedPos-1, Token.MARKUP_COMMENT); start = zzMarkedPos; } case 120: break; - case 32: + case 32: { yybegin(E4X); addToken(Token.MARKUP_TAG_DELIMITER); } case 121: break; - case 22: + case 22: { addToken(Token.MARKUP_ENTITY_REFERENCE); } case 122: break; - case 56: + case 56: { if(isJavaScriptCompatible("1.7")){ addToken(Token.RESERVED_WORD);} else {addToken(Token.IDENTIFIER);} } case 123: break; - case 62: + case 62: { addToken(Token.LITERAL_BOOLEAN); } case 124: break; - case 4: + case 4: { addNullToken(); return firstToken; } case 125: break; - case 43: + case 43: { addToken(Token.RESERVED_WORD); } case 126: break; - case 47: + case 47: { yybegin(YYINITIAL); addToken(start,zzStartRead+1, Token.COMMENT_MULTILINE); } case 127: break; - case 57: + case 57: { addToken(Token.DATA_TYPE); } case 128: break; - case 21: + case 21: { addToken(Token.MARKUP_TAG_DELIMITER); yybegin(E4X_INTAG); } case 129: break; - case 8: + case 8: { addToken(Token.SEPARATOR); } case 130: break; - case 30: + case 30: { addToken(Token.MARKUP_TAG_ATTRIBUTE); } case 131: break; - case 66: + case 66: { int temp=zzStartRead; addToken(start,zzStartRead-1, Token.COMMENT_DOCUMENTATION); addToken(temp,zzMarkedPos-1, Token.COMMENT_KEYWORD); start = zzMarkedPos; } case 132: break; - case 16: + case 16: { int type = validJSString ? Token.LITERAL_CHAR : Token.ERROR_CHAR; addToken(start,zzStartRead, type); yybegin(YYINITIAL); } case 133: break; - case 39: + case 39: { start = zzMarkedPos-2; yybegin(JS_EOL_COMMENT); } case 134: break; - case 20: + case 20: { addEndToken(INTERNAL_E4X); return firstToken; } case 135: break; - case 12: + case 12: { /* Line ending in '\' => continue to next line. */ if (validJSString) { addToken(start,zzStartRead, Token.LITERAL_STRING_DOUBLE_QUOTE); @@ -2004,18 +2004,18 @@ public final void yybegin(int newState) { return firstToken; } case 136: break; - case 37: + case 37: { addToken(Token.LITERAL_NUMBER_FLOAT); } case 137: break; - case 50: + case 50: { int count = yylength(); addToken(zzStartRead,zzStartRead, Token.MARKUP_TAG_DELIMITER); addToken(zzMarkedPos-(count-1), zzMarkedPos-1, Token.MARKUP_TAG_NAME); yybegin(E4X_INTAG); } case 138: break; - case 54: + case 54: { boolean highlightedAsRegex = false; if (firstToken==null) { addToken(Token.REGEX); @@ -2039,27 +2039,27 @@ public final void yybegin(int newState) { } } case 139: break; - case 27: + case 27: { if (!e4x_inInternalDtd) { yybegin(E4X); addToken(start,zzStartRead, Token.MARKUP_DTD); } } case 140: break; - case 6: + case 6: { addToken(Token.LITERAL_NUMBER_DECIMAL_INT); } case 141: break; - case 29: + case 29: { e4x_inInternalDtd = false; } case 142: break; - case 14: + case 14: { addToken(start,zzStartRead-1, Token.ERROR_CHAR); addNullToken(); return firstToken; } case 143: break; - case 1: - { + case 1: + { } case 144: break; - default: + default: if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { zzAtEOF = true; switch (zzLexicalState) { @@ -2122,7 +2122,7 @@ public final void yybegin(int newState) { default: return null; } - } + } else { zzScanError(ZZ_NO_MATCH); } diff --git a/designer_base/src/com/fr/design/images/buttonicon/run24.png b/designer_base/src/com/fr/design/images/buttonicon/run24.png index 8628e02a66496ffae31c4348d8a28f1e6546094b..8ebe92439eba1ae9355d11b8cc1477dcd782cd0f 100644 GIT binary patch literal 942 zcmV;f15x~mP)Px&Xh}ptR9Fe^S4&J2Q4~EbQ_43&DdjhyeB=|6Par{y3y{QUbmM|Vcd~%QB{3#S z0udKzi0&jBiNVB$!b%chfgxBBCB{VXZ}_7iLJQIgZE0u584#FHhoMc;jjw6uoqO*) z_spF;eSIp3MrpH?5t;l7dn&amKB1Zq{>9vrfN#4dM1`+nZixVuI-rUT^1lc+xf*JY z`~MJBK+ut#=jc8635KTbvQttJ=_6RM{CGBWDXCO$xuggDnVd_yVz-s#UZ3jOu>dyE zFL%yQxSa?|1^5g7IhPYb_%n$oE|N^+n@jkBoBy>6h!byM#R@bWBXB6mH=P4hG-|rs z8@W7QePi}W<(pBl0!nuPnu6M40aR+xLAtf8H&PS@$dM7&afFUNMxf;_2#ppD`*FM7 zSdGrda>{8?p$T$J1$IRNo_e68qXVtIttc-qM{#i_bUOCV*)caa2b0N!_V!v-R8$~z zf2m>*C<+kBWkGLmFFHFr(b(9C*w|Qs+h8!Pi7F~8LPJ9Xj3K?A;2KeWcvS&+WCn&uM&#K-E zIKxszRw49CfFq^|6T=@dIr3S^;sGsM=J960gw=SX2k(~2D*+4<0$bV{JZ!lQ+tSZ1 z7SYVLx{62l?||8p3|bp0@(Q6>0=T6PvJ~?=BW~7Tz~HMsFpTgZ#Z~7<{YAK3Zj|IE zB7W%V`d%T-yNM)!N_ToR)3SR&_-Gr{zh)2>pUmzDfiTZZzzq$Sla3>Fx*Nv4biC+) zj&MDR@q=|>h+v41W{PjYrc}|y8I=R>t6rJI(#i}}3Px$KS@MER5%f(lD$sDFc8P>6eU!d;Sm6-W1JR6%D~LZ8+3y=U&gjngw!ndef{o#=P-8Q$5p-O2~hX8lXL4~xlE(B*v8id zpqLQ;n-If40Lw^h1p58sE5_ia3Hdi5j^nR3$Wfz_(WEiTa=nYg054H3xoZctL^Sl= zP6eJfyyhGt0Jz|szXR|n&(l{OXarC(W7Q)TjvdEYNGV4E)fD}=2-!cs5kQ@(ILorx zuH(%2{V}SUpuJaNd7MWlWwHtN?igws%%VQ@zMww6J-Eq~J~AeBMj#r;ZH6tU7S zG5wjkxC>Z)l#^TNB$*@?OL_0yb}~u@bkyn8S}Zn#dMU3GI9Tt3#VB`1Imz-l5gW%f zMNB2|7tj@W^rdfr#)|SLCu-b)BAFai0bf39OnF7~SJhy~=}8EJASmGAQ3&PkF-1(?SL y$6bp3zD7CH>S)=^@RCwBATz=@r0tN<#cm@K1TTJZT*H^EUBW%?_ zAd52*qZtHPxw(aahTL6o_@)4|I3v&n|3M6Q9dWz{ocziKrhk8b{fgoe7MOyaS6<>Z zKtNFu?h+mei8DZ^3W@=Qz=!+yk-5qYs{9Nn1`zTBE|(JR1zdoj7mmIVW4QcI5YE>X zde2}j@e0!bY+jgqo|A!vlbvBoAOiy@D+9y#-wX_sj|u_}WnhRvk49`@#x-@gW*7h& zlCz$H;XpbABYG?$;RVQ=VSEv81_p#CQwn0tO}q3c;uWz*t~5UyUREm;9$F gDZ`?P5C8};0Er|rmgH#&P5=M^07*qoM6N<$f=c02u>b%7 From 92eae9b352b9c52939d448140368619441c12fb4 Mon Sep 17 00:00:00 2001 From: hzzz Date: Wed, 23 Aug 2017 11:24:36 +0800 Subject: [PATCH 06/30] tmp --- .../modes/JavaScriptTokenMaker.java | 188 +++++++++--------- 1 file changed, 94 insertions(+), 94 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/JavaScriptTokenMaker.java b/designer_base/src/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/JavaScriptTokenMaker.java index 3511931ff0..bc750a84d7 100644 --- a/designer_base/src/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/JavaScriptTokenMaker.java +++ b/designer_base/src/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/JavaScriptTokenMaker.java @@ -78,10 +78,10 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { public static final int YYINITIAL = 0; public static final int E4X_CDATA = 13; - /** + /** * Translates characters to character classes */ - private static final String ZZ_CMAP_PACKED = + private static final String ZZ_CMAP_PACKED = "\11\0\1\73\1\2\1\0\1\1\1\11\22\0\1\73\1\36\1\75"+ "\1\12\1\15\1\35\1\40\1\105\2\104\1\17\1\30\1\27\1\24"+ "\1\25\1\16\1\5\7\7\2\4\1\41\1\74\1\31\1\32\1\34"+ @@ -92,12 +92,12 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { "\1\65\1\72\1\51\1\47\1\50\1\10\1\70\1\62\1\71\1\66"+ "\1\106\1\111\1\33\1\26\1\42\uff81\0"; - /** + /** * Translates characters to character classes */ private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); - /** + /** * Translates DFA states to action switch labels. */ private static final int [] ZZ_ACTION = zzUnpackAction(); @@ -145,7 +145,7 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { } - /** + /** * Translates a state to a row index in the transition table */ private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); @@ -246,7 +246,7 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { return j; } - /** + /** * The transition table of the DFA */ private static final int [] ZZ_TRANS = zzUnpackTrans(); @@ -1095,7 +1095,7 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { * Token type specifying we're in a JavaScript documentation comment. */ private static final int INTERNAL_IN_JS_COMMENT_DOCUMENTATION = -9; - + /** * Token type specifying we're in an invalid multi-line JS string. */ @@ -1179,7 +1179,7 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { static { - jsVersion = "7.0"; + jsVersion = "1.0"; e4xSupported = true; } @@ -1248,7 +1248,7 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { /** * Returns the closest {@link TokenTypes "standard" token type} for a given * "internal" token type (e.g. one whose value is < 0). - * + * */ @Override public int getClosestStandardTokenTypeForInternalType(int type) { @@ -1411,10 +1411,10 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { /** * Returns whether features for a specific JS version should be honored * while highlighting. - * - * @param version JavaScript version required + * + * @param version JavaScript version required * @return Whether the JavaScript version is the same or greater than - * version required. + * version required. */ public static boolean isJavaScriptCompatible(String version) { return jsVersion.compareTo(version) >= 0; @@ -1463,11 +1463,11 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { * Resets the scanner to read from a new input stream. * Does not close the old reader. * - * All internal variables are reset, the old input stream + * All internal variables are reset, the old input stream * cannot be reused (internal buffer is discarded and lost). * Lexical state is set to YY_INITIAL. * - * @param reader the new input stream + * @param reader the new input stream */ public final void yyreset(java.io.Reader reader) { // 's' has been updated. @@ -1510,7 +1510,7 @@ public class JavaScriptTokenMaker extends AbstractJFlexCTokenMaker { this(new java.io.InputStreamReader(in)); } - /** + /** * Unpacks the compressed character translation table. * * @param packed the packed character translation table @@ -1571,7 +1571,7 @@ public final void yybegin(int newState) { /** * Returns the character at position pos from the * matched text. - * + * * It is equivalent to yytext().charAt(pos), but faster * * @param pos the position of the character to fetch. @@ -1616,7 +1616,7 @@ public final void yybegin(int newState) { } throw new Error(message); - } + } /** @@ -1663,13 +1663,13 @@ public final void yybegin(int newState) { zzAction = -1; zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; - + zzState = zzLexicalState; zzForAction: { while (true) { - + if (zzCurrentPosL < zzEndReadL) zzInput = zzBufferL[zzCurrentPosL++]; else if (zzAtEOF) { @@ -1712,27 +1712,27 @@ public final void yybegin(int newState) { zzMarkedPos = zzMarkedPosL; switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { - case 34: + case 34: { start = zzMarkedPos-1; yybegin(E4X_INATTR_SINGLE); } case 73: break; - case 33: + case 33: { start = zzMarkedPos-1; yybegin(E4X_INATTR_DOUBLE); } case 74: break; - case 36: + case 36: { addToken(Token.ERROR_NUMBER_FORMAT); } case 75: break; - case 71: + case 71: { addToken(Token.RESERVED_WORD_2); } case 76: break; - case 26: + case 26: { addToken(start,zzStartRead-1, Token.MARKUP_DTD); addEndToken(e4x_inInternalDtd ? INTERNAL_E4X_DTD_INTERNAL : INTERNAL_E4X_DTD); return firstToken; } case 77: break; - case 15: + case 15: { /* Line ending in '\' => continue to next line. */ if (validJSString) { addToken(start,zzStartRead, Token.LITERAL_CHAR); @@ -1745,15 +1745,15 @@ public final void yybegin(int newState) { return firstToken; } case 78: break; - case 3: + case 3: { addToken(Token.WHITESPACE); } case 79: break; - case 17: + case 17: { addToken(start,zzStartRead-1, Token.COMMENT_MULTILINE); addEndToken(INTERNAL_IN_JS_MLC); return firstToken; } case 80: break; - case 41: + case 41: { int start = zzStartRead; int operatorLen = yycharat(0)=='+' ? 2 : 1; int yylen = yylength(); // Cache before first addToken() invalidates it @@ -1772,226 +1772,226 @@ public final void yybegin(int newState) { // Scanning will continue at "<" as operator } case 81: break; - case 64: + case 64: { addToken(Token.FUNCTION); } case 82: break; - case 49: + case 49: { int temp=zzStartRead; addToken(start,zzStartRead-1, Token.COMMENT_DOCUMENTATION); addToken(temp,zzMarkedPos-1, Token.COMMENT_MARKUP); start = zzMarkedPos; } case 83: break; - case 44: + case 44: { /* Skip all escaped chars. */ } case 84: break; - case 11: + case 11: { addToken(start,zzStartRead-1, Token.ERROR_STRING_DOUBLE); addNullToken(); return firstToken; } case 85: break; - case 68: + case 68: { start = zzStartRead; e4x_prevState = zzLexicalState; yybegin(E4X_COMMENT); } case 86: break; - case 60: + case 60: { int temp=zzStartRead; yybegin(E4X); addToken(start,zzStartRead-1, Token.MARKUP_CDATA); addToken(temp,zzMarkedPos-1, Token.MARKUP_CDATA_DELIMITER); } case 87: break; - case 58: + case 58: { int count = yylength(); addToken(zzStartRead,zzStartRead+1, Token.MARKUP_TAG_DELIMITER); addToken(zzMarkedPos-(count-2), zzMarkedPos-1, Token.MARKUP_TAG_NAME); yybegin(E4X_INTAG); } case 88: break; - case 46: + case 46: { /* Invalid latin-1 character \xXX */ validJSString = false; } case 89: break; - case 61: + case 61: { addToken(Token.COMMENT_MULTILINE); } case 90: break; - case 52: + case 52: { start = zzMarkedPos-2; yybegin(E4X_PI); } case 91: break; - case 35: + case 35: { yybegin(E4X_INTAG); addToken(start,zzStartRead, Token.MARKUP_TAG_ATTRIBUTE_VALUE); } case 92: break; - case 13: + case 13: { int type = validJSString ? Token.LITERAL_STRING_DOUBLE_QUOTE : Token.ERROR_STRING_DOUBLE; addToken(start,zzStartRead, type); yybegin(YYINITIAL); } case 93: break; - case 19: + case 19: { addToken(start,zzStartRead-1, Token.COMMENT_EOL); addNullToken(); return firstToken; } case 94: break; - case 23: + case 23: { yybegin(YYINITIAL, LANG_INDEX_DEFAULT); addToken(Token.IDENTIFIER); } case 95: break; - case 45: + case 45: { /* Invalid Unicode character \\uXXXX */ validJSString = false; } case 96: break; - case 70: + case 70: { int temp = zzStartRead; addToken(start,zzStartRead-1, Token.MARKUP_DTD); start = temp; e4x_prevState = zzLexicalState; yybegin(E4X_COMMENT); } case 97: break; - case 63: + case 63: { if(e4xSupported){ addToken(Token.RESERVED_WORD);} else {addToken(Token.IDENTIFIER);} } case 98: break; - case 59: + case 59: { int temp = zzMarkedPos; addToken(start,zzStartRead+2, Token.MARKUP_COMMENT); start = temp; yybegin(e4x_prevState); } case 99: break; - case 7: + case 7: { addToken(Token.OPERATOR); } case 100: break; - case 53: + case 53: { yybegin(E4X); addToken(start,zzStartRead+1, Token.MARKUP_PROCESSING_INSTRUCTION); } case 101: break; - case 48: + case 48: { yybegin(YYINITIAL); addToken(start,zzStartRead+1, Token.COMMENT_DOCUMENTATION); } case 102: break; - case 18: + case 18: { addToken(start,zzStartRead-1, Token.COMMENT_DOCUMENTATION); addEndToken(INTERNAL_IN_JS_COMMENT_DOCUMENTATION); return firstToken; } case 103: break; - case 25: + case 25: { addToken(start,zzStartRead-1, Token.MARKUP_PROCESSING_INSTRUCTION); addEndToken(INTERNAL_E4X_MARKUP_PROCESSING_INSTRUCTION); return firstToken; } case 104: break; - case 5: + case 5: { addToken(Token.IDENTIFIER); } case 105: break; - case 42: + case 42: { addToken(isE4xSupported() ? Token.MARKUP_TAG_ATTRIBUTE : Token.ERROR_IDENTIFIER); } case 106: break; - case 65: + case 65: { int temp=zzStartRead; addToken(start,zzStartRead-1, Token.COMMENT_EOL); addHyperlinkToken(temp,zzMarkedPos-1, Token.COMMENT_EOL); start = zzMarkedPos; } case 107: break; - case 55: + case 55: { start = zzMarkedPos-3; yybegin(JS_DOCCOMMENT); } case 108: break; - case 9: + case 9: { start = zzMarkedPos-1; validJSString = true; yybegin(JS_STRING); } case 109: break; - case 51: + case 51: { start = zzMarkedPos-2; e4x_inInternalDtd = false; yybegin(E4X_DTD); } case 110: break; - case 24: + case 24: { addToken(start,zzStartRead-1, Token.MARKUP_COMMENT); addEndToken(INTERNAL_IN_E4X_COMMENT - e4x_prevState); return firstToken; } case 111: break; - case 10: + case 10: { start = zzMarkedPos-1; validJSString = true; yybegin(JS_CHAR); } case 112: break; - case 28: + case 28: { e4x_inInternalDtd = true; } case 113: break; - case 67: + case 67: { int temp=zzStartRead; addToken(start,zzStartRead-1, Token.COMMENT_DOCUMENTATION); addHyperlinkToken(temp,zzMarkedPos-1, Token.COMMENT_DOCUMENTATION); start = zzMarkedPos; } case 114: break; - case 40: + case 40: { start = zzMarkedPos-2; yybegin(JS_MLC); } case 115: break; - case 38: + case 38: { addToken(Token.LITERAL_NUMBER_HEXADECIMAL); } case 116: break; - case 72: + case 72: { addToken(Token.MARKUP_CDATA_DELIMITER); start = zzMarkedPos; yybegin(E4X_CDATA); } case 117: break; - case 31: + case 31: { addToken(Token.MARKUP_TAG_DELIMITER); /* Not valid but we'll still accept it */ } case 118: break; - case 2: + case 2: { addToken(Token.ERROR_IDENTIFIER); } case 119: break; - case 69: + case 69: { int temp=zzStartRead; addToken(start,zzStartRead-1, Token.MARKUP_COMMENT); addHyperlinkToken(temp,zzMarkedPos-1, Token.MARKUP_COMMENT); start = zzMarkedPos; } case 120: break; - case 32: + case 32: { yybegin(E4X); addToken(Token.MARKUP_TAG_DELIMITER); } case 121: break; - case 22: + case 22: { addToken(Token.MARKUP_ENTITY_REFERENCE); } case 122: break; - case 56: + case 56: { if(isJavaScriptCompatible("1.7")){ addToken(Token.RESERVED_WORD);} else {addToken(Token.IDENTIFIER);} } case 123: break; - case 62: + case 62: { addToken(Token.LITERAL_BOOLEAN); } case 124: break; - case 4: + case 4: { addNullToken(); return firstToken; } case 125: break; - case 43: + case 43: { addToken(Token.RESERVED_WORD); } case 126: break; - case 47: + case 47: { yybegin(YYINITIAL); addToken(start,zzStartRead+1, Token.COMMENT_MULTILINE); } case 127: break; - case 57: + case 57: { addToken(Token.DATA_TYPE); } case 128: break; - case 21: + case 21: { addToken(Token.MARKUP_TAG_DELIMITER); yybegin(E4X_INTAG); } case 129: break; - case 8: + case 8: { addToken(Token.SEPARATOR); } case 130: break; - case 30: + case 30: { addToken(Token.MARKUP_TAG_ATTRIBUTE); } case 131: break; - case 66: + case 66: { int temp=zzStartRead; addToken(start,zzStartRead-1, Token.COMMENT_DOCUMENTATION); addToken(temp,zzMarkedPos-1, Token.COMMENT_KEYWORD); start = zzMarkedPos; } case 132: break; - case 16: + case 16: { int type = validJSString ? Token.LITERAL_CHAR : Token.ERROR_CHAR; addToken(start,zzStartRead, type); yybegin(YYINITIAL); } case 133: break; - case 39: + case 39: { start = zzMarkedPos-2; yybegin(JS_EOL_COMMENT); } case 134: break; - case 20: + case 20: { addEndToken(INTERNAL_E4X); return firstToken; } case 135: break; - case 12: + case 12: { /* Line ending in '\' => continue to next line. */ if (validJSString) { addToken(start,zzStartRead, Token.LITERAL_STRING_DOUBLE_QUOTE); @@ -2004,18 +2004,18 @@ public final void yybegin(int newState) { return firstToken; } case 136: break; - case 37: + case 37: { addToken(Token.LITERAL_NUMBER_FLOAT); } case 137: break; - case 50: + case 50: { int count = yylength(); addToken(zzStartRead,zzStartRead, Token.MARKUP_TAG_DELIMITER); addToken(zzMarkedPos-(count-1), zzMarkedPos-1, Token.MARKUP_TAG_NAME); yybegin(E4X_INTAG); } case 138: break; - case 54: + case 54: { boolean highlightedAsRegex = false; if (firstToken==null) { addToken(Token.REGEX); @@ -2039,27 +2039,27 @@ public final void yybegin(int newState) { } } case 139: break; - case 27: + case 27: { if (!e4x_inInternalDtd) { yybegin(E4X); addToken(start,zzStartRead, Token.MARKUP_DTD); } } case 140: break; - case 6: + case 6: { addToken(Token.LITERAL_NUMBER_DECIMAL_INT); } case 141: break; - case 29: + case 29: { e4x_inInternalDtd = false; } case 142: break; - case 14: + case 14: { addToken(start,zzStartRead-1, Token.ERROR_CHAR); addNullToken(); return firstToken; } case 143: break; - case 1: - { + case 1: + { } case 144: break; - default: + default: if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { zzAtEOF = true; switch (zzLexicalState) { @@ -2122,7 +2122,7 @@ public final void yybegin(int newState) { default: return null; } - } + } else { zzScanError(ZZ_NO_MATCH); } From 21c24a4c6e3af9ef2e17bcd8dcd43d4561bcbbf4 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Wed, 23 Aug 2017 14:59:30 +0800 Subject: [PATCH 07/30] =?UTF-8?q?=E5=A4=84=E7=90=86=E8=B6=85=E9=93=BE?= =?UTF-8?q?=E5=92=8C=E6=9D=A1=E4=BB=B6=E6=98=BE=E7=A4=BA=E7=9A=84todo?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E8=AD=A6=E6=88=92=E7=BA=BF=E5=92=8C?= =?UTF-8?q?=E9=97=B4=E9=9A=94=E8=83=8C=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartHyperLinkPane.java | 23 +-- .../ChartConditionNameObjectCreator.java | 84 -------- .../ChartHyperlinkNameObjectCreartor.java | 84 -------- .../VanChartConditionAttrContentPane.java | 12 +- .../other/VanChartListControlPane.java | 12 +- .../background/AlertLineListControlPane.java | 116 +++++++++++ .../background/BackgroundListControlPane.java | 121 ++++++++++++ .../BackgroundNameObjectCreator.java | 47 +++++ .../background/ChartNameObjectCreator.java | 52 +++++ .../background/VanChartAlertValuePane.java | 12 +- .../background/VanChartAxisAreaPane.java | 182 ++---------------- .../VanChartCustomIntervalBackgroundPane.java | 13 +- 12 files changed, 376 insertions(+), 382 deletions(-) delete mode 100644 designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java delete mode 100644 designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java create mode 100644 designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java create mode 100644 designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java create mode 100644 designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java create mode 100644 designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java index f533aa6a7c..ba44d0f01f 100644 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java @@ -9,6 +9,7 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.chart.javascript.ChartEmailPane; import com.fr.design.designer.TargetComponent; import com.fr.design.fun.HyperlinkProvider; +import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.imenutable.UIMenuNameableCreator; @@ -25,7 +26,6 @@ import com.fr.js.ParameterJavaScript; import com.fr.js.ReportletHyperlink; import com.fr.js.WebHyperlink; import com.fr.plugin.chart.attr.plot.VanChartPlot; -import com.fr.plugin.chart.designer.other.ChartHyperlinkNameObjectCreartor; import com.fr.plugin.chart.designer.other.HyperlinkMapFactory; import com.fr.stable.ListMap; import com.fr.stable.Nameable; @@ -89,7 +89,6 @@ public class VanChartHyperLinkPane extends UIListControlPane { } public void populate(TargetComponent elementCasePane) { -// hyperlinkGroupPaneActionProvider.populate(this, elementCasePane); } /** @@ -128,12 +127,11 @@ public class VanChartHyperLinkPane extends UIListControlPane { // paneMap.put(nc.getHyperlink(), nc.getUpdatePane()); } - //todo@mengao 去掉UIMenuNameableCreator java.util.List list = refreshList(paneMap); - ChartHyperlinkNameObjectCreartor[] creators= new ChartHyperlinkNameObjectCreartor[list.size()]; + NameObjectCreator[] creators= new NameObjectCreator[list.size()]; for(int i = 0; list != null && i < list.size(); i++) { UIMenuNameableCreator uiMenuNameableCreator = list.get(i); - creators[i] = new ChartHyperlinkNameObjectCreartor(uiMenuNameableCreator.getObj(),uiMenuNameableCreator.getName(), uiMenuNameableCreator.getClass(), uiMenuNameableCreator.getPaneClazz()); + creators[i] = new NameObjectCreator(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj().getClass(), uiMenuNameableCreator.getPaneClazz()); } @@ -147,7 +145,7 @@ public class VanChartHyperLinkPane extends UIListControlPane { if(javaScript != null && javaScript.getJavaScript() != null) { JavaScript script = javaScript.getJavaScript(); UIMenuNameableCreator uiMenuNameableCreator= new UIMenuNameableCreator(javaScript.getName(), script, getUseMap(paneMap, script.getClass())); - nameObjects.add(new NameObject(uiMenuNameableCreator.getName(), uiMenuNameableCreator)); + nameObjects.add(new NameObject(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj())); } } @@ -182,9 +180,9 @@ public class VanChartHyperLinkPane extends UIListControlPane { nameGroup.clear(); for(int i = 0; i < nameables.length; i++) { - UIMenuNameableCreator menu = (UIMenuNameableCreator)((NameObject)nameables[i]).getObject(); - NameJavaScript nameJava = new NameJavaScript(menu.getName(), (JavaScript)menu.getObj()); - nameJava.setName(nameables[i].getName()); + JavaScript javaScript = (JavaScript)((NameObject)nameables[i]).getObject(); + String name = nameables[i].getName(); + NameJavaScript nameJava = new NameJavaScript(name,javaScript); nameGroup.addNameHyperlink(nameJava); } @@ -231,11 +229,4 @@ public class VanChartHyperLinkPane extends UIListControlPane { return null; } - protected Object getob2Populate (Object ob2Populate) { - if (ob2Populate == null) { - return ob2Populate; - } - return ((UIMenuNameableCreator)ob2Populate).getObj(); - - } } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java deleted file mode 100644 index caa06d5961..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.fr.plugin.chart.designer.other; - -import com.fr.base.chart.BasePlot; -import com.fr.chart.chartattr.Plot; -import com.fr.chart.chartglyph.ConditionAttr; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.controlpane.NameObjectCreator; -import com.fr.design.gui.controlpane.UnrepeatedNameHelper; -import com.fr.design.gui.ilist.ListModelElement; -import com.fr.general.Inter; -import com.fr.general.NameObject; -import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator; -import com.fr.stable.Nameable; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; - -/** - * Created by mengao on 2017/8/18. - */ -public class ChartConditionNameObjectCreator extends NameObjectCreator { - private BasePlot plot; - private ConditionUIMenuNameableCreator conditionUIMenuNameableCreator; - - public ChartConditionNameObjectCreator(BasePlot plot, String menuName, Class clazz, Class updatePane) { - super(menuName, clazz, updatePane); - this.plot = plot; - } - - /** - * create Nameable - * - * @param helper - * @return - */ - public Nameable createNameable(UnrepeatedNameHelper helper) { - Constructor constructor = null; - try { - constructor = clazzOfInitCase.getConstructor(Plot.class, String.class, Object.class, Class.class); - ConditionUIMenuNameableCreator conditionUIMenuNameableCreator = constructor.newInstance(plot, Inter.getLocText("Chart-Condition_Attributes"), new ConditionAttr(), getUpdatePane()); - return new NameObject(helper.createUnrepeatedName(this.menuName()), conditionUIMenuNameableCreator); - - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (InstantiationException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @param ob - * @return - */ - public Object acceptObject2Populate(Object ob) { - if (ob instanceof NameObject) { - ob = ((NameObject) ob).getObject(); - } - if (clazzOfObject != null && clazzOfObject.isInstance(ob)) { - doSthChanged4Icon(ob); - conditionUIMenuNameableCreator = (ConditionUIMenuNameableCreator) ((ConditionUIMenuNameableCreator) ob).clone(); - return ob; - } - - return null; - } - - /** - * save update bean - * - * @param wrapper - * @param bean - */ - public void saveUpdatedBean(ListModelElement wrapper, Object bean) { - conditionUIMenuNameableCreator.setObj(bean); - ((NameObject) wrapper.wrapper).setObject(conditionUIMenuNameableCreator); - } - - -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java b/designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java deleted file mode 100644 index bc8ea431e6..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.fr.plugin.chart.designer.other; - -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.controlpane.NameObjectCreator; -import com.fr.design.gui.controlpane.UnrepeatedNameHelper; -import com.fr.design.gui.ilist.ListModelElement; -import com.fr.design.gui.imenutable.UIMenuNameableCreator; -import com.fr.general.NameObject; -import com.fr.stable.Nameable; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; - -/** - * Created by mengao on 2017/8/21. - */ -public class ChartHyperlinkNameObjectCreartor extends NameObjectCreator { - private Object object; - private UIMenuNameableCreator uIMenuNameableCreator; - - - public ChartHyperlinkNameObjectCreartor(Object object, String menuName, Class clazz, Class updatePane) { - super(menuName, clazz, updatePane); - this.object = object; - - } - - /** - * create Nameable - * - * @param helper - * @return - */ - public Nameable createNameable(UnrepeatedNameHelper helper) { - Constructor constructor = null; - try { - constructor = clazzOfInitCase.getConstructor(String.class, Object.class, Class.class); - UIMenuNameableCreator uIMenuNameableCreator = constructor.newInstance(menuName, object, getUpdatePane()); - return new NameObject(helper.createUnrepeatedName(this.menuName()), uIMenuNameableCreator); - - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (InstantiationException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @param ob - * @return - */ - public Object acceptObject2Populate(Object ob) { - if (ob instanceof NameObject) { - ob = ((NameObject) ob).getObject(); - } - if (clazzOfObject != null && clazzOfObject.isInstance(ob)) { - doSthChanged4Icon(ob); - uIMenuNameableCreator = ((UIMenuNameableCreator) ob).clone(); - if (uIMenuNameableCreator.getObj() != null && object.getClass().isInstance(uIMenuNameableCreator.getObj())) { - return ob; - } - } - - return null; - } - - /** - * save update bean - * - * @param wrapper - * @param bean - */ - public void saveUpdatedBean(ListModelElement wrapper, Object bean) { - uIMenuNameableCreator.setObj(bean); - ((NameObject) wrapper.wrapper).setObject(uIMenuNameableCreator); - } - - -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java index 5f80ae17ed..9baf215081 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java @@ -6,14 +6,10 @@ import com.fr.chart.chartglyph.ConditionCollection; import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.imenutable.UIMenuNameableCreator; -import com.fr.general.Inter; import com.fr.general.NameObject; -import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator; import com.fr.stable.Nameable; import java.awt.*; -import java.util.ArrayList; -import java.util.List; /** * Created by Mitisky on 16/5/20. @@ -41,17 +37,11 @@ public class VanChartConditionAttrContentPane extends AbstractConditionAttrConte this.setLayout(new BorderLayout()); this.add(conditionPane, BorderLayout.CENTER); - //todo@mango - List list = new ArrayList(); - - list.add(new ConditionUIMenuNameableCreator(plot, Inter.getLocText("Chart-Condition_Attributes"), new ConditionAttr(), showPane)); - NameObject[] nameables = new NameObject[collection.getConditionAttrSize()]; for(int i = 0; i < collection.getConditionAttrSize(); i++) { - ConditionUIMenuNameableCreator c =new ConditionUIMenuNameableCreator(plot, collection.getConditionAttr(i).getName(), collection.getConditionAttr(i), showPane); - nameables[i]=(new NameObject(c.getName(),c)); + nameables[i]=(new NameObject(collection.getConditionAttr(i).getName(),collection.getConditionAttr(i))); } conditionPane.populate(nameables); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java index 6ab1078e5d..0d357d9664 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java @@ -6,14 +6,13 @@ import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionCollection; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.UIListControlPane; -import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.design.mainframe.DesignerContext; import com.fr.general.Inter; import com.fr.general.NameObject; import com.fr.plugin.chart.attr.plot.VanChartPlot; -import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator; import com.fr.stable.Nameable; import java.lang.reflect.Constructor; @@ -36,7 +35,7 @@ public class VanChartListControlPane extends UIListControlPane { @Override public NameableCreator[] createNameableCreators() { - return new ChartConditionNameObjectCreator[]{new ChartConditionNameObjectCreator(this.plot, Inter.getLocText("Condition_Attributes"), ConditionUIMenuNameableCreator.class, ChartTypeInterfaceManager.getInstance().getPlotConditionPane((Plot) plot).getClass())}; + return new NameObjectCreator[]{new NameObjectCreator(Inter.getLocText("Condition_Attributes"), ConditionAttr.class, ChartTypeInterfaceManager.getInstance().getPlotConditionPane((Plot) plot).getClass())}; } @@ -77,10 +76,6 @@ public class VanChartListControlPane extends UIListControlPane { return Inter.getLocText("Condition_Attributes"); } - protected Object getob2Populate(Object ob2Populate) { - return ((ConditionUIMenuNameableCreator) ob2Populate).getObj(); - - } /** * Update. @@ -91,8 +86,7 @@ public class VanChartListControlPane extends UIListControlPane { cc.clearConditionAttr(); for (int i = 0; i < nameables.length; i++) { - UIMenuNameableCreator uiMenuNameableCreator = (UIMenuNameableCreator) ((NameObject) nameables[i]).getObject(); - ConditionAttr ca = (ConditionAttr) uiMenuNameableCreator.getObj(); + ConditionAttr ca = (ConditionAttr) ((NameObject) nameables[i]).getObject(); ca.setName(nameables[i].getName()); cc.addConditionAttr(ca); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java new file mode 100644 index 0000000000..f79ac7f0ad --- /dev/null +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java @@ -0,0 +1,116 @@ +package com.fr.plugin.chart.designer.style.background; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.gui.controlpane.UIListControlPane; +import com.fr.design.mainframe.DesignerContext; +import com.fr.general.ComparatorUtils; +import com.fr.general.Inter; +import com.fr.general.NameObject; +import com.fr.plugin.chart.attr.DefaultAxisHelper; +import com.fr.plugin.chart.attr.axis.VanChartAlertValue; +import com.fr.plugin.chart.attr.axis.VanChartAxis; +import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; +import com.fr.stable.Nameable; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by mengao on 2017/8/22. + */ +public class AlertLineListControlPane extends UIListControlPane { + + + @Override + public void saveSettings() { + if (isPopulating) { + return; + } + update((VanChartPlot) plot); + DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); + } + + @Override + public NameableCreator[] createNameableCreators() { + return new ChartNameObjectCreator[]{new ChartNameObjectCreator(new String[]{Inter.getLocText("ChartF-X_Axis"), Inter.getLocText("ChartF-Y_Axis")}, + Inter.getLocText("Plugin-ChartF_AlertLine"), VanChartAlertValue.class, VanChartAlertValuePane.class)}; + } + + @Override + protected String title4PopupWindow() { + return Inter.getLocText("Plugin-ChartF_AlertLine"); + } + + protected String getAddItemText() { + return Inter.getLocText("Plugin-ChartF_AlertLine"); + } + + public void populate(Plot plot) { + this.plot = plot; + VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; + List xAxisList = rectanglePlot.getXAxisList(); + List yAxisList = rectanglePlot.getYAxisList(); + String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList); + + ChartNameObjectCreator[] creators = {new ChartNameObjectCreator(axisNames, Inter.getLocText("Plugin-ChartF_AlertLine"), VanChartAlertValue.class, VanChartAlertValuePane.class)}; + + refreshNameableCreator(creators); + + java.util.List nameObjects = new ArrayList(); + + for (VanChartAxis axis : xAxisList) { + List values = axis.getAlertValues(); + for (VanChartAlertValue alertValue : values) { + alertValue.setAxisNamesArray(axisNames); + alertValue.setAxisName(axis.getAxisName()); + nameObjects.add(new NameObject(alertValue.getAlertPaneSelectName(), alertValue)); + } + } + + for (VanChartAxis axis : yAxisList) { + List values = axis.getAlertValues(); + for (VanChartAlertValue alertValue : values) { + alertValue.setAxisNamesArray(axisNames); + alertValue.setAxisName(axis.getAxisName()); + nameObjects.add(new NameObject(alertValue.getAlertPaneSelectName(), alertValue)); + } + } + + populate(nameObjects.toArray(new NameObject[nameObjects.size()])); + doLayout(); + } + + public void update(Plot plot) { + + Nameable[] nameables = this.update(); + + VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; + List xAxisList = rectanglePlot.getXAxisList(); + List yAxisList = rectanglePlot.getYAxisList(); + + for (VanChartAxis axis : xAxisList) { + List axisAlerts = new ArrayList(); + for (int i = 0; i < nameables.length; i++) { + VanChartAlertValue value = (VanChartAlertValue) ((NameObject) nameables[i]).getObject(); + if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) { + value.setAlertPaneSelectName(nameables[i].getName()); + axisAlerts.add(value); + } + } + axis.setAlertValues(axisAlerts); + } + for (VanChartAxis axis : yAxisList) { + List axisAlerts = new ArrayList(); + for (int i = 0; i < nameables.length; i++) { + VanChartAlertValue value = (VanChartAlertValue) ((NameObject) nameables[i]).getObject(); + if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) { + value.setAlertPaneSelectName(nameables[i].getName()); + axisAlerts.add(value); + } + } + axis.setAlertValues(axisAlerts); + } + } +} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java new file mode 100644 index 0000000000..5d502e08bb --- /dev/null +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java @@ -0,0 +1,121 @@ +package com.fr.plugin.chart.designer.style.background; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.gui.controlpane.UIListControlPane; +import com.fr.design.mainframe.DesignerContext; +import com.fr.general.ComparatorUtils; +import com.fr.general.Inter; +import com.fr.general.NameObject; +import com.fr.plugin.chart.attr.DefaultAxisHelper; +import com.fr.plugin.chart.attr.axis.VanChartAlertValue; +import com.fr.plugin.chart.attr.axis.VanChartAxis; +import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; +import com.fr.plugin.chart.base.VanChartCustomIntervalBackground; +import com.fr.stable.Nameable; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by mengao on 2017/8/22. + */ +public class BackgroundListControlPane extends UIListControlPane { + + @Override + public void saveSettings() { + if (isPopulating) { + return; + } + update((VanChartPlot) plot, false); + DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); + } + + @Override + public NameableCreator[] createNameableCreators() { + return new BackgroundNameObjectCreator[]{new BackgroundNameObjectCreator(new String[]{Inter.getLocText("ChartF-X_Axis"), Inter.getLocText("ChartF-Y_Axis")}, + Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), VanChartAlertValue.class, VanChartAlertValuePane.class)}; + } + + @Override + protected String title4PopupWindow() { + return Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"); + } + + @Override + public String getAddItemText() { + return Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"); + } + + public void populate(Plot plot) { + this.plot = plot; + VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; + List xAxisList = rectanglePlot.getXAxisList(); + List yAxisList = rectanglePlot.getYAxisList(); + String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList); + + BackgroundNameObjectCreator[] creators = {new BackgroundNameObjectCreator(axisNames, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), VanChartCustomIntervalBackground.class, VanChartCustomIntervalBackgroundPane.class)}; + + refreshNameableCreator(creators); + + java.util.List nameObjects = new ArrayList(); + + + for (VanChartAxis axis : xAxisList) { + List customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray(); + for (VanChartCustomIntervalBackground background : customIntervalBackgrounds) { + background.setAxisNamesArray(axisNames); + background.setAxisName(axis.getAxisName()); + nameObjects.add(new NameObject(background.getCustomIntervalBackgroundSelectName(), background)); + } + + } + for (VanChartAxis axis : yAxisList) { + List customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray(); + for (VanChartCustomIntervalBackground background : customIntervalBackgrounds) { + background.setAxisNamesArray(axisNames); + background.setAxisName(axis.getAxisName()); + nameObjects.add(new NameObject(background.getCustomIntervalBackgroundSelectName(), background)); + } + } + populate(nameObjects.toArray(new NameObject[nameObjects.size()])); + doLayout(); + } + + public void update(Plot plot, boolean isDefaultIntervalBackground) { + + Nameable[] nameables = this.update(); + + VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; + List xAxisList = rectanglePlot.getXAxisList(); + List yAxisList = rectanglePlot.getYAxisList(); + + for (VanChartAxis axis : xAxisList) { + List axisCustomBackground = new ArrayList(); + if (!isDefaultIntervalBackground) { + for (int i = 0; i < nameables.length; i++) { + VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground) ((NameObject) nameables[i]).getObject(); + if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) { + value.setCustomIntervalBackgroundSelectName(nameables[i].getName()); + axisCustomBackground.add(value); + } + } + } + axis.setCustomIntervalBackgroundArray(axisCustomBackground); + } + for (VanChartAxis axis : yAxisList) { + List axisCustomBackground = new ArrayList(); + if (!isDefaultIntervalBackground) { + for (int i = 0; i < nameables.length; i++) { + VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground) ((NameObject) nameables[i]).getObject(); + if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) { + value.setCustomIntervalBackgroundSelectName(nameables[i].getName()); + axisCustomBackground.add(value); + } + } + } + axis.setCustomIntervalBackgroundArray(axisCustomBackground); + } + } +} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java new file mode 100644 index 0000000000..b1c2e683b7 --- /dev/null +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java @@ -0,0 +1,47 @@ +package com.fr.plugin.chart.designer.style.background; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.controlpane.UnrepeatedNameHelper; +import com.fr.general.NameObject; +import com.fr.plugin.chart.base.VanChartCustomIntervalBackground; +import com.fr.stable.Nameable; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; + +/** + * Created by mengao on 2017/8/23. + */ +public class BackgroundNameObjectCreator extends ChartNameObjectCreator { + public BackgroundNameObjectCreator(Object object, String menuName, Class clazz, Class updatePane) { + super(object, menuName, clazz, updatePane); + } + + /** + * create Nameable + * + * @param helper + * @return + */ + public Nameable createNameable(UnrepeatedNameHelper helper) { + Constructor constructor = null; + try { + constructor = clazzOfInitCase.getConstructor(); + VanChartCustomIntervalBackground vanChartCustomIntervalBackground = constructor.newInstance(); + vanChartCustomIntervalBackground.setAxisNamesArray((String[]) object); + vanChartCustomIntervalBackground.setAxisName(((String[]) object)[0]); + return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartCustomIntervalBackground); + + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } + return null; + } + +} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java new file mode 100644 index 0000000000..7bb1c50357 --- /dev/null +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java @@ -0,0 +1,52 @@ +package com.fr.plugin.chart.designer.style.background; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.controlpane.NameObjectCreator; +import com.fr.design.gui.controlpane.UnrepeatedNameHelper; +import com.fr.general.NameObject; +import com.fr.plugin.chart.attr.axis.VanChartAlertValue; +import com.fr.stable.Nameable; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; + +/** + * Created by mengao on 2017/8/21. + */ +public class ChartNameObjectCreator extends NameObjectCreator { + protected Object object; + + + public ChartNameObjectCreator(Object object, String menuName, Class clazz, Class updatePane) { + super(menuName, clazz, updatePane); + this.object = object; + + } + + /** + * create Nameable + * + * @param helper + * @return + */ + public Nameable createNameable(UnrepeatedNameHelper helper) { + Constructor constructor = null; + try { + constructor = clazzOfInitCase.getConstructor(); + VanChartAlertValue vanChartAlertValue = constructor.newInstance(); + vanChartAlertValue.setAxisNamesArray((String[]) object); + vanChartAlertValue.setAxisName(((String[]) object)[0]); + return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartAlertValue); + + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java index 7e1144e75c..f89d056eab 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java @@ -46,6 +46,8 @@ public class VanChartAlertValuePane extends BasicBeanPane { private UIComboBox fontName; private ColorSelectBox fontColor; + private VanChartAlertValue chartAlertValue; + public VanChartAlertValuePane(){ initComponents(); } @@ -134,6 +136,7 @@ public class VanChartAlertValuePane extends BasicBeanPane { } public void populateBean(VanChartAlertValue chartAlertValue){ + this.chartAlertValue =chartAlertValue; alertAxis = new UIButtonGroup(chartAlertValue.getAxisNamesArray(), chartAlertValue.getAxisNamesArray()); alertAxis.setSelectedItem(chartAlertValue.getAxisName()); alertAxis.addChangeListener(new ChangeListener() { @@ -166,7 +169,9 @@ public class VanChartAlertValuePane extends BasicBeanPane { } @Override - public void updateBean(VanChartAlertValue chartAlertValue) { + public void updateBean(VanChartAlertValue chartAlertValue) {} + + public VanChartAlertValue updateBean(){ chartAlertValue.setAxisName(alertAxis.getSelectedItem().toString()); chartAlertValue.setAlertValueFormula(new Formula(alertValue.updateBean())); @@ -191,9 +196,6 @@ public class VanChartAlertValuePane extends BasicBeanPane { } else { chartAlertValue.setAlertPosition(alertTextPosition.getSelectedIndex() == 0 ? Constants.LEFT : Constants.RIGHT); } - } - - public VanChartAlertValue updateBean(){ - return null; + return chartAlertValue; } } \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java index f2ca9ce33b..dc65aeb1f1 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java @@ -2,30 +2,21 @@ package com.fr.plugin.chart.designer.style.background; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.frpane.UICorrelationComboBoxPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.style.color.ColorSelectBox; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.plugin.chart.VanChartAttrHelper; -import com.fr.plugin.chart.attr.DefaultAxisHelper; -import com.fr.plugin.chart.attr.axis.VanChartAlertValue; -import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; -import com.fr.plugin.chart.base.VanChartCustomIntervalBackground; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.plugin.chart.designer.component.VanChartUIMenuNameableCreator; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.List; /** * 样式-背景-绘图区背景-坐标轴图表特有(间隔背景、网格线、警戒线) @@ -36,14 +27,14 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ protected ColorSelectBox horizontalGridLine; protected ColorSelectBox verticalGridLine; - protected UICorrelationComboBoxPane alertLine; + protected AlertLineListControlPane alertLine; private UIButtonGroup isDefaultIntervalBackground; private JPanel centerPane; private CardLayout cardLayout; protected ColorSelectBox horizontalColorBackground; private ColorSelectBox verticalColorBackground; - protected UICorrelationComboBoxPane customIntervalBackground; + protected BackgroundListControlPane customIntervalBackground; public VanChartAxisAreaPane(){ initComponents(); @@ -82,8 +73,10 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ } protected JPanel createAlertLinePane(){ - alertLine = new UICorrelationComboBoxPane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"),alertLine); + alertLine = new AlertLineListControlPane(); + JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"),alertLine); + alertLine.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); + return panel; } protected JPanel createIntervalPane(double[] row, double[] col){ @@ -92,7 +85,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ verticalColorBackground = new ColorSelectBox(100); Component[][] components = getIntervalPaneComponents(); JPanel defaultPane = TableLayoutHelper.createTableLayoutPane(components, row, col); - customIntervalBackground = new UICorrelationComboBoxPane(); + customIntervalBackground = new BackgroundListControlPane(); cardLayout = new CardLayout(); centerPane = new JPanel(cardLayout); @@ -107,7 +100,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ JPanel intervalPane = new JPanel(new BorderLayout(0, 6)); intervalPane.add(isDefaultIntervalBackground, BorderLayout.NORTH); intervalPane.add(centerPane, BorderLayout.CENTER); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"),intervalPane); + JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"),intervalPane); + intervalPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); + return panel; } protected Component[][] getIntervalPaneComponents() { @@ -132,18 +127,16 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ public void populateBean(Plot plot){ VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot)plot; - List xAxisList = rectanglePlot.getXAxisList(); - List yAxisList = rectanglePlot.getYAxisList(); - String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList); + populateGridLine(rectanglePlot); - populateAlert(xAxisList, yAxisList, axisNames); + alertLine.populate(plot); isDefaultIntervalBackground.setSelectedIndex(rectanglePlot.isDefaultIntervalBackground() ? 0 : 1); horizontalColorBackground.setSelectObject(rectanglePlot.getDefaultYAxis().getDefaultIntervalBackgroundColor()); verticalColorBackground.setSelectObject(rectanglePlot.getDefaultXAxis().getDefaultIntervalBackgroundColor()); - populateCustomIntervalBackground(xAxisList, yAxisList, axisNames); + customIntervalBackground.populate(plot); checkCardPane(); } @@ -152,97 +145,13 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ verticalGridLine.setSelectObject(rectanglePlot.getDefaultXAxis().getMainGridColor()); } - protected Class getAlertPaneClass() { - return VanChartAlertValuePane.class; - } - - protected void setAlertDemoAxisName(VanChartAlertValue demo, String[] axisNames) { - demo.setAxisName(axisNames[0]); - } - - private void populateAlert(List xAxisList, List yAxisList, String[] axisNames){ - List menuList = new ArrayList(); - VanChartAlertValue demo = new VanChartAlertValue(); - demo.setAxisNamesArray(axisNames); - setAlertDemoAxisName(demo, axisNames); - menuList.add(new VanChartUIMenuNameableCreator(Inter.getLocText("Plugin-ChartF_AlertLine"), demo, getAlertPaneClass())); - - alertLine.refreshMenuAndAddMenuAction(menuList); - - List list = new ArrayList(); - - for(VanChartAxis axis: xAxisList){ - List values = axis.getAlertValues(); - for(VanChartAlertValue alertValue : values) { - alertValue.setAxisNamesArray(axisNames); - alertValue.setAxisName(axis.getAxisName()); - list.add(new VanChartUIMenuNameableCreator(alertValue.getAlertPaneSelectName(), alertValue, getAlertPaneClass())); - } - } - - for(VanChartAxis axis: yAxisList){ - List values = axis.getAlertValues(); - for(VanChartAlertValue alertValue : values) { - alertValue.setAxisNamesArray(axisNames); - alertValue.setAxisName(axis.getAxisName()); - list.add(new VanChartUIMenuNameableCreator(alertValue.getAlertPaneSelectName(), alertValue, getAlertPaneClass())); - } - } - - alertLine.populateBean(list); - alertLine.doLayout(); - } - - protected Class getIntervalPaneClass() { - return VanChartCustomIntervalBackgroundPane.class; - } - - protected void setCustomIntervalBackgroundDemoAxisName(VanChartCustomIntervalBackground demo, String[] axisNames) { - demo.setAxisName(axisNames[0]); - } - - private void populateCustomIntervalBackground(List xAxisList, List yAxisList, String[] axisNames){ - List menuList = new ArrayList(); - VanChartCustomIntervalBackground demo = new VanChartCustomIntervalBackground(); - demo.setAxisNamesArray(axisNames); - setCustomIntervalBackgroundDemoAxisName(demo, axisNames); - menuList.add(new VanChartUIMenuNameableCreator(Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), demo, getIntervalPaneClass())); - - customIntervalBackground.refreshMenuAndAddMenuAction(menuList); - - List list = new ArrayList(); - - for(VanChartAxis axis: xAxisList){ - List customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray(); - for(VanChartCustomIntervalBackground background : customIntervalBackgrounds){ - background.setAxisNamesArray(axisNames); - background.setAxisName(axis.getAxisName()); - list.add(new VanChartUIMenuNameableCreator(background.getCustomIntervalBackgroundSelectName(), background, getIntervalPaneClass())); - } - - } - - for(VanChartAxis axis: yAxisList){ - List customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray(); - for(VanChartCustomIntervalBackground background : customIntervalBackgrounds){ - background.setAxisNamesArray(axisNames); - background.setAxisName(axis.getAxisName()); - list.add(new VanChartUIMenuNameableCreator(background.getCustomIntervalBackgroundSelectName(), background, getIntervalPaneClass())); - } - } - - customIntervalBackground.populateBean(list); - customIntervalBackground.doLayout(); - } public void updateBean(Plot plot){ VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot)plot; - List xAxisList = rectanglePlot.getXAxisList(); - List yAxisList = rectanglePlot.getYAxisList(); updateGirdLine(rectanglePlot); - updateAlert(xAxisList, yAxisList); + alertLine.update(plot); rectanglePlot.setIsDefaultIntervalBackground(isDefaultIntervalBackground.getSelectedIndex() == 0); if(rectanglePlot.isDefaultIntervalBackground()){ @@ -252,7 +161,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ rectanglePlot.getDefaultYAxis().setDefaultIntervalBackgroundColor(null); rectanglePlot.getDefaultXAxis().setDefaultIntervalBackgroundColor(null); } - updateCustomIntervalBackground(xAxisList, yAxisList); + customIntervalBackground.update(plot,isDefaultIntervalBackground.getSelectedIndex() == 0); } protected void updateGirdLine(VanChartRectanglePlot rectanglePlot) { @@ -260,34 +169,6 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ rectanglePlot.getDefaultXAxis().setMainGridColor(verticalGridLine.getSelectObject()); } - private void updateAlert(List xAxisList, List yAxisList){ - - List alertList = alertLine.updateBean(); - - for(VanChartAxis axis : xAxisList){ - List axisAlerts = new ArrayList(); - for(UIMenuNameableCreator creator : alertList) { - VanChartAlertValue value = (VanChartAlertValue)creator.getObj(); - if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())){ - value.setAlertPaneSelectName(creator.getName()); - axisAlerts.add(value); - } - } - axis.setAlertValues(axisAlerts); - } - for(VanChartAxis axis : yAxisList){ - List axisAlerts = new ArrayList(); - for(UIMenuNameableCreator creator : alertList) { - VanChartAlertValue value = (VanChartAlertValue)creator.getObj(); - if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName()) || yAxisEquals(value.getAxisName(), axis.getAxisName())){ - value.setAlertPaneSelectName(creator.getName()); - axisAlerts.add(value); - } - } - axis.setAlertValues(axisAlerts); - } - } - /** * Y軸和雷達圖的極軸也是相等的 * @param axisName @@ -299,39 +180,6 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ ComparatorUtils.equals(VanChartAttrHelper.RADAR_Y_AXIS_PREFIX, axisName); } - private void updateCustomIntervalBackground(List xAxisList, List yAxisList){ - - List customList = customIntervalBackground.updateBean(); - - for(VanChartAxis axis : xAxisList){ - List axisCustomBackground = new ArrayList(); - if(isDefaultIntervalBackground.getSelectedIndex() == 1){//tab选中间隔背景,则置所有自定义间隔背景为空数组 - for(UIMenuNameableCreator creator : customList) { - VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground)creator.getObj(); - if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())){ - value.setCustomIntervalBackgroundSelectName(creator.getName()); - axisCustomBackground.add(value); - } - } - } - axis.setCustomIntervalBackgroundArray(axisCustomBackground); - } - for(VanChartAxis axis : yAxisList){ - List axisCustomBackground = new ArrayList(); - if(isDefaultIntervalBackground.getSelectedIndex() == 1){//tab选中间隔背景,则置所有自定义间隔背景为空数组 - for(UIMenuNameableCreator creator : customList) { - VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground)creator.getObj(); - if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())){ - value.setCustomIntervalBackgroundSelectName(creator.getName()); - axisCustomBackground.add(value); - } - } - } - axis.setCustomIntervalBackgroundArray(axisCustomBackground); - } - } - - public Plot updateBean(){ return null; } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java index a2db0a3c27..0a3d39f9c3 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java @@ -32,6 +32,8 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane Date: Wed, 23 Aug 2017 16:44:41 +0800 Subject: [PATCH 08/30] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...anChartBubblePlotTableDataContentPane.java | 1 + .../component/VanChartHyperLinkPane.java | 32 ++++----- .../BackgroundNameObjectCreator.java | 9 +-- .../background/ChartNameObjectCreator.java | 9 +-- .../background/VanChartAlertValuePane.java | 3 - .../background/VanChartAxisAreaPane.java | 65 ++++++++++--------- .../VanChartCustomIntervalBackgroundPane.java | 8 +-- 7 files changed, 61 insertions(+), 66 deletions(-) diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java index f9cda412e5..b4a28ed12e 100644 --- a/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java @@ -65,6 +65,7 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon JPanel north = TableLayoutHelper.createTableLayoutPane(components_north,rowSize_north,columnSize_north); north.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15)); JPanel filterPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),dataScreeningPane); + dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); Component[][] components = new Component[][]{ new Component[]{north}, diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java index ba44d0f01f..59e92c7b84 100644 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java @@ -112,7 +112,7 @@ public class VanChartHyperLinkPane extends UIListControlPane { if (isPopulating) { return; } - update((VanChartPlot)plot); + update((VanChartPlot) plot); } public void populate(Plot plot) { @@ -124,12 +124,12 @@ public class VanChartHyperLinkPane extends UIListControlPane { for (HyperlinkProvider provider : providers) { NameableCreator nc = provider.createHyperlinkCreator(); //todo@shine9.0 - // paneMap.put(nc.getHyperlink(), nc.getUpdatePane()); + // paneMap.put(nc.getHyperlink(), nc.getUpdatePane()); } java.util.List list = refreshList(paneMap); - NameObjectCreator[] creators= new NameObjectCreator[list.size()]; - for(int i = 0; list != null && i < list.size(); i++) { + NameObjectCreator[] creators = new NameObjectCreator[list.size()]; + for (int i = 0; list != null && i < list.size(); i++) { UIMenuNameableCreator uiMenuNameableCreator = list.get(i); creators[i] = new NameObjectCreator(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj().getClass(), uiMenuNameableCreator.getPaneClazz()); @@ -140,11 +140,11 @@ public class VanChartHyperLinkPane extends UIListControlPane { java.util.List nameObjects = new ArrayList(); NameJavaScriptGroup nameGroup = populateHotHyperLink(plot); - for(int i = 0; nameGroup != null && i < nameGroup.size(); i++) { + for (int i = 0; nameGroup != null && i < nameGroup.size(); i++) { NameJavaScript javaScript = nameGroup.getNameHyperlink(i); - if(javaScript != null && javaScript.getJavaScript() != null) { + if (javaScript != null && javaScript.getJavaScript() != null) { JavaScript script = javaScript.getJavaScript(); - UIMenuNameableCreator uiMenuNameableCreator= new UIMenuNameableCreator(javaScript.getName(), script, getUseMap(paneMap, script.getClass())); + UIMenuNameableCreator uiMenuNameableCreator = new UIMenuNameableCreator(javaScript.getName(), script, getUseMap(paneMap, script.getClass())); nameObjects.add(new NameObject(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj())); } @@ -158,7 +158,7 @@ public class VanChartHyperLinkPane extends UIListControlPane { return plot.getHotHyperLink(); } - protected HashMap getHyperlinkMap(Plot plot){ + protected HashMap getHyperlinkMap(Plot plot) { return HyperlinkMapFactory.getHyperlinkMap(plot); } @@ -179,10 +179,10 @@ public class VanChartHyperLinkPane extends UIListControlPane { NameJavaScriptGroup nameGroup = new NameJavaScriptGroup(); nameGroup.clear(); - for(int i = 0; i < nameables.length; i++) { - JavaScript javaScript = (JavaScript)((NameObject)nameables[i]).getObject(); + for (int i = 0; i < nameables.length; i++) { + JavaScript javaScript = (JavaScript) ((NameObject) nameables[i]).getObject(); String name = nameables[i].getName(); - NameJavaScript nameJava = new NameJavaScript(name,javaScript); + NameJavaScript nameJava = new NameJavaScript(name, javaScript); nameGroup.addNameHyperlink(nameJava); } @@ -217,13 +217,13 @@ public class VanChartHyperLinkPane extends UIListControlPane { } protected Class getUseMap(HashMap map, Object key) { - if(map.get(key) != null){ - return (Class)map.get(key); + if (map.get(key) != null) { + return (Class) map.get(key); } //引擎在这边放了个provider,当前表单对象 - for(Object tempKey : map.keySet()){ - if(((Class)tempKey).isAssignableFrom((Class)key)){ - return (Class)map.get(tempKey); + for (Object tempKey : map.keySet()) { + if (((Class) tempKey).isAssignableFrom((Class) key)) { + return (Class) map.get(tempKey); } } return null; diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java index b1c2e683b7..bf5c6cf668 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java @@ -2,6 +2,7 @@ package com.fr.plugin.chart.designer.style.background; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.controlpane.UnrepeatedNameHelper; +import com.fr.general.FRLogger; import com.fr.general.NameObject; import com.fr.plugin.chart.base.VanChartCustomIntervalBackground; import com.fr.stable.Nameable; @@ -33,13 +34,13 @@ public class BackgroundNameObjectCreator extends ChartNameObjectCreator { return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartCustomIntervalBackground); } catch (NoSuchMethodException e) { - e.printStackTrace(); + FRLogger.getLogger().error(e.getMessage(), e); } catch (IllegalAccessException e) { - e.printStackTrace(); + FRLogger.getLogger().error(e.getMessage(), e); } catch (InstantiationException e) { - e.printStackTrace(); + FRLogger.getLogger().error(e.getMessage(), e); } catch (InvocationTargetException e) { - e.printStackTrace(); + FRLogger.getLogger().error(e.getMessage(), e); } return null; } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java index 7bb1c50357..227efeea8c 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java @@ -3,6 +3,7 @@ package com.fr.plugin.chart.designer.style.background; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.UnrepeatedNameHelper; +import com.fr.general.FRLogger; import com.fr.general.NameObject; import com.fr.plugin.chart.attr.axis.VanChartAlertValue; import com.fr.stable.Nameable; @@ -39,13 +40,13 @@ public class ChartNameObjectCreator extends NameObjectCreator { return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartAlertValue); } catch (NoSuchMethodException e) { - e.printStackTrace(); + FRLogger.getLogger().error(e.getMessage(), e); } catch (IllegalAccessException e) { - e.printStackTrace(); + FRLogger.getLogger().error(e.getMessage(), e); } catch (InstantiationException e) { - e.printStackTrace(); + FRLogger.getLogger().error(e.getMessage(), e); } catch (InvocationTargetException e) { - e.printStackTrace(); + FRLogger.getLogger().error(e.getMessage(), e); } return null; } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java index f89d056eab..ec934be6fe 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java @@ -168,9 +168,6 @@ public class VanChartAlertValuePane extends BasicBeanPane { fontColor.setSelectObject(chartAlertValue.getAlertFont().getForeground()); } - @Override - public void updateBean(VanChartAlertValue chartAlertValue) {} - public VanChartAlertValue updateBean(){ chartAlertValue.setAxisName(alertAxis.getSelectedItem().toString()); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java index dc65aeb1f1..d29726d019 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java @@ -21,7 +21,7 @@ import java.awt.event.ActionListener; /** * 样式-背景-绘图区背景-坐标轴图表特有(间隔背景、网格线、警戒线) */ -public class VanChartAxisAreaPane extends BasicBeanPane{ +public class VanChartAxisAreaPane extends BasicBeanPane { private static final long serialVersionUID = -1880497996650835504L; protected ColorSelectBox horizontalGridLine; @@ -36,50 +36,50 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ private ColorSelectBox verticalColorBackground; protected BackgroundListControlPane customIntervalBackground; - public VanChartAxisAreaPane(){ + public VanChartAxisAreaPane() { initComponents(); } - protected void initComponents(){ + protected void initComponents() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = { f }; - double[] rowSize = {p,p,p}; + double[] columnSize = {f}; + double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ - new Component[]{createGridLinePane(new double[]{p,p,p}, new double[]{p,f})}, + new Component[]{createGridLinePane(new double[]{p, p, p}, new double[]{p, f})}, new Component[]{createAlertLinePane()}, - new Component[]{createIntervalPane(new double[]{p,p,p,p}, new double[]{p,f})}, + new Component[]{createIntervalPane(new double[]{p, p, p, p}, new double[]{p, f})}, }; JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); this.setLayout(new BorderLayout()); - this.add(panel,BorderLayout.CENTER); + this.add(panel, BorderLayout.CENTER); } - private JPanel createGridLinePane(double[] row, double[] col){ + private JPanel createGridLinePane(double[] row, double[] col) { horizontalGridLine = new ColorSelectBox(100); verticalGridLine = new ColorSelectBox(100); Component[][] components = getGridLinePaneComponents(); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("ChartF-Grid_Line"),panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("ChartF-Grid_Line"), panel); } protected Component[][] getGridLinePaneComponents() { return new Component[][]{ - new Component[]{null,null}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")),horizontalGridLine}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")),verticalGridLine}, + new Component[]{null, null}, + new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")), horizontalGridLine}, + new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")), verticalGridLine}, }; } - protected JPanel createAlertLinePane(){ + protected JPanel createAlertLinePane() { alertLine = new AlertLineListControlPane(); - JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"),alertLine); - alertLine.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); + JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"), alertLine); + alertLine.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15)); return panel; } - protected JPanel createIntervalPane(double[] row, double[] col){ + protected JPanel createIntervalPane(double[] row, double[] col) { isDefaultIntervalBackground = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_IntervalBackground"), Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")}); horizontalColorBackground = new ColorSelectBox(100); verticalColorBackground = new ColorSelectBox(100); @@ -100,33 +100,33 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ JPanel intervalPane = new JPanel(new BorderLayout(0, 6)); intervalPane.add(isDefaultIntervalBackground, BorderLayout.NORTH); intervalPane.add(centerPane, BorderLayout.CENTER); - JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"),intervalPane); - intervalPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); + JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"), intervalPane); + intervalPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15)); return panel; } protected Component[][] getIntervalPaneComponents() { return new Component[][]{ - new Component[]{null,null}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")),horizontalColorBackground}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")),verticalColorBackground}, + new Component[]{null, null}, + new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")), horizontalColorBackground}, + new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")), verticalColorBackground}, }; } - private void checkCardPane(){ - if(isDefaultIntervalBackground.getSelectedIndex() == 0){ + private void checkCardPane() { + if (isDefaultIntervalBackground.getSelectedIndex() == 0) { cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_IntervalBackground")); } else { cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")); } } - protected String title4PopupWindow(){ + protected String title4PopupWindow() { return ""; } - public void populateBean(Plot plot){ - VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot)plot; + public void populateBean(Plot plot) { + VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; populateGridLine(rectanglePlot); @@ -146,22 +146,22 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ } - public void updateBean(Plot plot){ - VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot)plot; + public void updateBean(Plot plot) { + VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; updateGirdLine(rectanglePlot); alertLine.update(plot); rectanglePlot.setIsDefaultIntervalBackground(isDefaultIntervalBackground.getSelectedIndex() == 0); - if(rectanglePlot.isDefaultIntervalBackground()){ + if (rectanglePlot.isDefaultIntervalBackground()) { rectanglePlot.getDefaultYAxis().setDefaultIntervalBackgroundColor(horizontalColorBackground.getSelectObject()); rectanglePlot.getDefaultXAxis().setDefaultIntervalBackgroundColor(verticalColorBackground.getSelectObject()); } else { rectanglePlot.getDefaultYAxis().setDefaultIntervalBackgroundColor(null); rectanglePlot.getDefaultXAxis().setDefaultIntervalBackgroundColor(null); } - customIntervalBackground.update(plot,isDefaultIntervalBackground.getSelectedIndex() == 0); + customIntervalBackground.update(plot, isDefaultIntervalBackground.getSelectedIndex() == 0); } protected void updateGirdLine(VanChartRectanglePlot rectanglePlot) { @@ -171,6 +171,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ /** * Y軸和雷達圖的極軸也是相等的 + * * @param axisName * @param valueAxisName * @return @@ -180,7 +181,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ ComparatorUtils.equals(VanChartAttrHelper.RADAR_Y_AXIS_PREFIX, axisName); } - public Plot updateBean(){ + public Plot updateBean() { return null; } } \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java index 0a3d39f9c3..bf6bb46950 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java @@ -34,9 +34,6 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane Date: Wed, 23 Aug 2017 19:32:56 +0800 Subject: [PATCH 09/30] =?UTF-8?q?9.0=E7=95=8C=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/gui/ChangeConfigPane.java | 6 ++--- .../chart/gui/data/ChartDataFilterPane.java | 12 +++++++++ .../report/AbstractReportDataContentPane.java | 12 +++++++-- .../BubblePlotReportDataContentPane.java | 1 + ...goryPlotMoreCateReportDataContentPane.java | 3 ++- .../CategoryPlotReportDataContentPane.java | 1 + .../MeterPlotReportDataContentPane.java | 9 ++----- .../table/BubblePlotTableDataContentPane.java | 16 ++++++------ .../table/MeterPlotTableDataContentPane.java | 25 +++++++++++-------- .../table/PiePlotTableDataContentPane.java | 7 +++--- .../data/table/SeriesTypeUseComboxPane.java | 1 + ...anChartBubblePlotTableDataContentPane.java | 19 ++++++-------- .../component/GanttReportDataContentPane.java | 3 ++- .../MultiPiePlotTableDataContentPane.java | 18 ++++++++----- 14 files changed, 80 insertions(+), 53 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java index 1f1f5a9f94..e2986a3035 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java @@ -113,20 +113,20 @@ public class ChangeConfigPane extends BasicBeanPane { } }; styleAttrPane.setPreferredSize(new Dimension(WIDTH, (int) styleAttrPane.getPreferredSize().getHeight())); - return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-Chart_Character")+":", styleAttrPane); + return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-Chart_Character"), styleAttrPane); } private JPanel createButtonBackgroundColorPane(){ colorSelectBox4button = new ColorSelectBoxWithOutTransparent(WIDTH); - return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Background") + ":", colorSelectBox4button); + return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Background"), colorSelectBox4button); } private JPanel createButtonConfigPane() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {p, f}; - double[] rowSize = {p,p,p}; + double[] rowSize = {p,p}; Component[][] components = new Component[][]{ new Component[]{createTitleStylePane(),null}, new Component[]{createButtonBackgroundColorPane(),null}, diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java index f4a2381e7c..0f09b016b0 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java @@ -59,6 +59,18 @@ public class ChartDataFilterPane extends ThirdTabPane { } } + protected void initLayout() { + this.setLayout(new BorderLayout()); + if (!paneList.isEmpty()) { + JPanel pane = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0)); + if (nameArray.length > 1) { + pane.add(tabPane); + this.add(pane, BorderLayout.NORTH); + } + } + this.add(centerPane, BorderLayout.CENTER); + } + protected List initPaneList(Plot plot, AbstractAttrNoScrollPane parent) { plot4Pane = plot; diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java index 35aa92b37e..2612ae7425 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java @@ -44,8 +44,10 @@ public abstract class AbstractReportDataContentPane extends BasicBeanPane { this.add(cardPane, BorderLayout.CENTER); dataScreeningPane = new ChartDataFilterPane(this.initplot, parent); JPanel panel = new UIExpandablePane(Inter.getLocText("FR-Chart-Data_Filter"), 290, 24, dataScreeningPane); + dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); this.add(panel, BorderLayout.SOUTH); } diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java index b4a28ed12e..756f31ca91 100644 --- a/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java @@ -8,7 +8,6 @@ import com.fr.chart.chartdata.BubbleTableDefinition; import com.fr.design.gui.icombobox.UIComboBox; 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.ChartDataFilterPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; @@ -50,7 +49,7 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {f}; - double[] rowSize = { p, p,p,p}; + double[] rowSize = {p, p}; double[] columnSize_north = {p, f}; double[] rowSize_north = {p, p, p, p}; @@ -62,21 +61,17 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), bubbleSize}, }; - JPanel north = TableLayoutHelper.createTableLayoutPane(components_north,rowSize_north,columnSize_north); - north.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15)); + JPanel north = TableLayout4VanChartHelper.createGapTableLayoutPane(components_north,rowSize_north,columnSize_north); + north.setBorder(BorderFactory.createEmptyBorder(10, 24, 10, 15)); JPanel filterPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),dataScreeningPane); dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); - Component[][] components = new Component[][]{ - new Component[]{north}, - new Component[]{filterPane} - }; - - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); this.setLayout(new BorderLayout()); - this.add(panel, BorderLayout.CENTER); - + this.add(getJSeparator(), BorderLayout.NORTH); + this.add(north, BorderLayout.CENTER); + this.add(filterPane, BorderLayout.SOUTH); + seriesName.addItemListener(tooltipListener); xCombox.addItemListener(tooltipListener); yCombox.addItemListener(tooltipListener); diff --git a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java index 24c85d96e3..68a4f1ae10 100644 --- a/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java @@ -29,7 +29,8 @@ public class GanttReportDataContentPane extends AbstractReportDataContentPane{ this.setLayout(new BorderLayout()); initAllComponent(); JPanel panel = getContentPane(); - panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); + panel.setBorder(BorderFactory.createEmptyBorder(10,24,0,15)); + this.add(getJSeparator(), BorderLayout.NORTH); this.add(panel, BorderLayout.CENTER); this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight())); diff --git a/designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotTableDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotTableDataContentPane.java index a82873aaaa..9436ec6a6a 100644 --- a/designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotTableDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotTableDataContentPane.java @@ -11,12 +11,12 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.itextfield.UITextField; 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.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; @@ -32,7 +32,7 @@ import java.util.List; */ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPane implements UIObserver { private static final int HT = 20; - private static final int WD = 120; + private static final int WD = 100; private UISpinner levelNumEdit; private UITextField nameField; protected UIComboBox value; @@ -103,7 +103,7 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa calculateCombox.reset(); calculateCombox.setPreferredSize(new Dimension(WD, HT)); - components_center[levelNum] = new Component[]{new JSeparator(), null}; + components_center[levelNum] = new Component[]{getJSeparator(), null}; components_center[levelNum+1] = new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), value}; components_center[levelNum+2] = new Component[]{new UILabel(Inter.getLocText("Chart-Summary_Method")), calculateCombox}; @@ -112,7 +112,7 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa registerListener4Center(); - return TableLayoutHelper.createTableLayoutPane(components_center,rowSize_center,columnSize_center); + return TableLayout4VanChartHelper.createGapTableLayoutPane(components_center,rowSize_center,columnSize_center); } @@ -175,11 +175,11 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa Component[][] components_north = new Component[][]{ new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name")), nameField}, - new Component[]{new JSeparator(),null }, + new Component[]{getJSeparator(),null }, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Level_Number")), levelNumEdit}, }; - return TableLayoutHelper.createTableLayoutPane(components_north, rowSize_north, columnSize_north); + return TableLayout4VanChartHelper.createGapTableLayoutPane(components_north, rowSize_north, columnSize_north); } private void refreshCenterPane(){ @@ -357,4 +357,10 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa } return false; } + + protected JSeparator getJSeparator() { + JSeparator jSeparator = new JSeparator(); + jSeparator.setPreferredSize(new Dimension(220, 2)); + return jSeparator; + } } From 561b4dae82d5c33eab1f7d3f83b71034cfb60429 Mon Sep 17 00:00:00 2001 From: fr_shine Date: Wed, 23 Aug 2017 19:57:06 +0800 Subject: [PATCH 10/30] NumberDragBar labelString --- designer_base/src/com/fr/design/gui/style/NumberDragBar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/gui/style/NumberDragBar.java b/designer_base/src/com/fr/design/gui/style/NumberDragBar.java index 013f76e923..0fa223a791 100644 --- a/designer_base/src/com/fr/design/gui/style/NumberDragBar.java +++ b/designer_base/src/com/fr/design/gui/style/NumberDragBar.java @@ -74,7 +74,7 @@ public class NumberDragBar extends JComponent { g2.setColor(isEnabled() ? UIConstants.FONT_COLOR : UIManager.getColor("Label.disabledForeground")); g2.drawString(String.valueOf(minValue), 2, 10); - g2.drawString(String.valueOf(maxValue), width - 20, 10); + g2.drawString(String.valueOf(maxValue), width - 10 * String.valueOf(maxValue).length(), 10); if(minValue < 0) { g2.drawString("0", width / 2 - 2, 10); } From 995599281bd315856976990549ecda30adb16912 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 24 Aug 2017 09:47:41 +0800 Subject: [PATCH 11/30] =?UTF-8?q?REPORT-4115=20=E5=8F=82=E6=95=B0=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E5=90=84=E6=8E=A7=E4=BB=B6=E5=B1=9E=E6=80=A7=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E6=B7=BB=E5=8A=A0=E6=A0=87=E7=AD=BE=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/widget/ui/CheckBoxDefinePane.java | 6 +- .../widget/ui/FieldEditorDefinePane.java | 6 +- .../widget/ui/IframeEditorDefinePane.java | 6 +- .../widget/ui/NumberEditorDefinePane.java | 273 ++++++++---------- .../design/widget/ui/WaterMarkDictPane.java | 6 +- .../gui/itextfield/UIPropertyTextField.java | 47 --- .../widget/ui/FormWidgetCardPane.java | 18 +- .../parameter/RootDesignDefinePane.java | 15 +- .../widget/ui/designer/ButtonDefinePane.java | 23 +- .../ui/designer/CheckBoxDefinePane.java | 13 +- .../ui/designer/ComboBoxDefinePane.java | 6 +- .../ui/designer/ComboCheckBoxDefinePane.java | 6 +- .../ui/designer/DateEditorDefinePane.java | 7 +- .../designer/DirectWriteEditorDefinePane.java | 5 +- .../ui/designer/FieldEditorDefinePane.java | 13 +- .../ui/designer/IframeEditorDefinePane.java | 6 +- .../ui/designer/NumberEditorDefinePane.java | 90 +++--- .../designer/TextFieldEditorDefinePane.java | 11 +- .../TreeComboBoxEditorDefinePane.java | 6 +- .../widget/ui/designer/WaterMarkDictPane.java | 6 +- .../designer/btn/ButtonGroupDefinePane.java | 5 +- 21 files changed, 268 insertions(+), 306 deletions(-) delete mode 100644 designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java diff --git a/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java b/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java index bde3332b46..44d0df7f4a 100644 --- a/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java @@ -3,7 +3,7 @@ package com.fr.design.widget.ui; import com.fr.design.constants.LayoutConstants; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -14,7 +14,7 @@ import javax.swing.*; import java.awt.*; public class CheckBoxDefinePane extends AbstractDataModify { - private UIPropertyTextField text; + private UITextField text; public CheckBoxDefinePane() { this.iniComoponents(); @@ -22,7 +22,7 @@ public class CheckBoxDefinePane extends AbstractDataModify { private void iniComoponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - text = new UIPropertyTextField(); + text = new UITextField(); JPanel panel = new JPanel(new BorderLayout()); panel.add(text, BorderLayout.CENTER); panel.setBorder(BorderFactory.createEmptyBorder(0, 35, 0, 0)); diff --git a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java index ceb3d6476e..054380b4db 100644 --- a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java @@ -5,7 +5,7 @@ import com.fr.design.constants.LayoutConstants; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -24,7 +24,7 @@ public abstract class FieldEditorDefinePane extends Abstr private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30; protected UICheckBox allowBlankCheckBox; // richer:错误信息,是所有控件共有的属性,所以放到这里来 - protected UIPropertyTextField errorMsgTextField; + protected UITextField errorMsgTextField; protected JPanel validatePane; public FieldEditorDefinePane() { @@ -44,7 +44,7 @@ public abstract class FieldEditorDefinePane extends Abstr protected void initErrorMsgPane() { // 错误信息 - errorMsgTextField = new UIPropertyTextField(); + errorMsgTextField = new UITextField(); // // richer:主要为了方便查看比较长的错误信息 errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { diff --git a/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java index 218743c498..7416f314fc 100644 --- a/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java @@ -9,7 +9,7 @@ import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -28,7 +28,7 @@ public class IframeEditorDefinePane extends AbstractDataModify { private static final int P_W = 610; private static final int P_H = 580; - private UIPropertyTextField srcTextField; + private UITextField srcTextField; private ReportletParameterViewPane parameterViewPane; private UICheckBox horizontalCheck; private UICheckBox verticalCheck; @@ -61,7 +61,7 @@ public class IframeEditorDefinePane extends AbstractDataModify { java.awt.Component[][] coms = { {horizontalCheck, null}, {verticalCheck, null}, - {new UILabel(Inter.getLocText("Form-Url")), srcTextField = new UIPropertyTextField()}, + {new UILabel(Inter.getLocText("Form-Url")), srcTextField = new UITextField()}, {new UILabel(Inter.getLocText("FR-Designer_Parameters")), parameterViewPaneButton}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, 45, LayoutConstants.VGAP_LARGE); diff --git a/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java index 45d711e24a..2862ab2ffe 100644 --- a/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java @@ -20,6 +20,7 @@ import javax.swing.text.DefaultFormatter; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ispinner.UIBasicSpinner; +import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -39,113 +40,23 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane private SpinnerNumberModel maxValueModel; private UIBasicSpinner minValueSpinner; private SpinnerNumberModel minValueModel; - private UIBasicSpinner decimalLength; + private UISpinner decimalLength; private JPanel limitNumberPane; private WaterMarkDictPane waterMarkDictPane; - private ActionListener actionListener1 = new ActionListener() { - public void actionPerformed(ActionEvent e) { - if (allowDecimalsCheckBox.isSelected()) { - limitNumberPane.setVisible(true); - } else { - limitNumberPane.setVisible(false); - } - } - }; - - private ActionListener actionListener2 = new ActionListener() { - - @Override - public void actionPerformed(ActionEvent e) { - if (allowNegativeCheckBox.isSelected()) { - minValueModel.setMinimum(-Double.MAX_VALUE); - if (!setMinValueCheckBox.isSelected()) { - maxValueModel.setMinimum(-Double.MAX_VALUE); - } - } else { - minValueModel.setMinimum(0.0); - if (!setMinValueCheckBox.isSelected()) { - maxValueModel.setMinimum(0.0); - } - Double minValue = Double.parseDouble("" + minValueSpinner.getValue()); - Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue()); - if (minValue < 0.0) { - minValueSpinner.setValue(0.0); - } - if (maxValue < 0.0) { - maxValueSpinner.setValue(0.0); - } - } - } - }; - - - public ActionListener actionListener3 = new ActionListener() { - public void actionPerformed(ActionEvent e) { - if (setMaxValueCheckBox.isSelected()) { - maxValueSpinner.setVisible(true); - Double value = new Double(0); - if (setMinValueCheckBox.isSelected()) { - Double minValue = Double.parseDouble("" + minValueSpinner.getValue()); - if (minValue > value) { - value = minValue; - } - } - maxValueSpinner.setValue(value); - } else { - maxValueSpinner.setVisible(false); - minValueModel.setMaximum(Double.MAX_VALUE); - } - } - }; + private ActionListener allowDecimalsListener; + private ActionListener allowNegativeListener ; - private ActionListener actionListener4 = new ActionListener() { - public void actionPerformed(ActionEvent e) { - if (setMinValueCheckBox.isSelected()) { - minValueSpinner.setVisible(true); - Double value = new Double(0); - if (setMaxValueCheckBox.isSelected()) { - Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue()); - if (maxValue < value) { - value = maxValue; - } - } - minValueSpinner.setValue(value); - } else { - minValueSpinner.setVisible(false); - maxValueModel.setMinimum(allowNegativeCheckBox.isSelected() ? (-Double.MAX_VALUE) : new Double(0)); - } - } - }; + public ActionListener setMaxListener; - private ChangeListener changeListener1 = new ChangeListener() { + private ActionListener setMinListener; - @Override - public void stateChanged(ChangeEvent e) { - if (setMaxValueCheckBox.isSelected()) { - if (setMinValueCheckBox.isSelected()) { - minValueModel.setMaximum(Double.parseDouble("" + maxValueSpinner.getValue())); - } - } - } - }; + private ChangeListener maxValueChangeListener; - private ChangeListener changeListener2 = new ChangeListener() { - - @Override - public void stateChanged(ChangeEvent e) { - if (setMinValueCheckBox.isSelected()) { - if (setMaxValueCheckBox.isSelected()) { - maxValueModel.setMinimum(Double.parseDouble("" + minValueSpinner.getValue())); - } - } - } - }; + private ChangeListener minValueChangeListener; public NumberEditorDefinePane() { -// super(); - this.initComponents(); } @@ -160,73 +71,53 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); content.add(waterMarkDictPane, BorderLayout.CENTER); - return content; } public JPanel setValidatePane() { + initListeners(); this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Decimals")); allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - this.decimalLength = new UIBasicSpinner(new SpinnerNumberModel(16, 0, Integer.MAX_VALUE, 1)); - this.decimalLength.setPreferredSize(new Dimension(155, 20)); - - this.allowDecimalsCheckBox.addActionListener(actionListener1); + this.decimalLength = new UISpinner(0, Integer.MAX_VALUE, 1, 16); + this.allowDecimalsCheckBox.addActionListener(allowDecimalsListener); this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Negative")); - this.allowNegativeCheckBox.addActionListener(actionListener2); + this.allowNegativeCheckBox.addActionListener(allowNegativeListener); allowNegativeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Max_Value"), false); setMaxValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); - maxValueSpinner.setPreferredSize(new Dimension(155, 20)); setNotAllowsInvalid(this.maxValueSpinner); - this.maxValueSpinner.setVisible(false); - this.setMaxValueCheckBox.addActionListener(actionListener3); - this.maxValueSpinner.addChangeListener(changeListener1); + this.setMaxValueCheckBox.addActionListener(setMaxListener); + this.maxValueSpinner.addChangeListener(maxValueChangeListener); this.setMinValueCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Min_Value"), false); setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); - minValueSpinner.setPreferredSize(new Dimension(155, 20)); setNotAllowsInvalid(this.minValueSpinner); - this.minValueSpinner.setVisible(false); - this.setMinValueCheckBox.addActionListener(actionListener4); - this.minValueSpinner.addChangeListener(changeListener2); + this.setMinValueCheckBox.addActionListener(setMinListener); + this.minValueSpinner.addChangeListener(minValueChangeListener); UILabel numberLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Double", "Numbers"})); - numberLabel.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); - - JPanel decimalPane = new JPanel(new BorderLayout()); - decimalPane.add(decimalLength, BorderLayout.CENTER); - decimalPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); - JPanel maxValueSpinnerPane = new JPanel(new BorderLayout()); - maxValueSpinnerPane.add(maxValueSpinner, BorderLayout.CENTER); - maxValueSpinnerPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); - JPanel minValueSpinnerPane = new JPanel(new BorderLayout()); - minValueSpinnerPane.add(minValueSpinner, BorderLayout.CENTER); - minValueSpinnerPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); - + limitNumberPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{numberLabel, decimalLength}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ new Component[]{allowDecimalsCheckBox, null}, - new Component[]{numberLabel, decimalPane}, + new Component[]{limitNumberPane, null}, new Component[]{allowNegativeCheckBox, null}, - new Component[]{setMaxValueCheckBox, maxValueSpinnerPane}, - new Component[]{setMinValueCheckBox, minValueSpinnerPane}, + new Component[]{setMaxValueCheckBox, maxValueSpinner}, + new Component[]{setMinValueCheckBox, minValueSpinner}, }; double[] rowSize = {p, p, p, p, p}; double[] columnSize = {p, f}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); - pane.setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 0)); + pane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); return pane; - } @@ -237,28 +128,28 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane this.decimalLength.setValue(e.getMaxDecimalLength()); } else { this.limitNumberPane.setVisible(false); + this.limitNumberPane.setPreferredSize(new Dimension(0,0)); } allowNegativeCheckBox.setSelected(e.isAllowNegative()); if (e.getMaxValue() == Double.MAX_VALUE) { setMaxValueCheckBox.setSelected(false); maxValueSpinner.setValue(new Double(Double.MAX_VALUE)); - maxValueSpinner.setVisible(false); - + maxValueSpinner.setEnabled(false); } else { setMaxValueCheckBox.setSelected(true); - maxValueSpinner.setVisible(true); + maxValueSpinner.setEnabled(true); maxValueSpinner.setValue(new Double(e.getMaxValue())); } if (e.getMinValue() == -Double.MAX_VALUE) { setMinValueCheckBox.setSelected(false); minValueSpinner.setValue(new Double(-Double.MAX_VALUE)); - minValueSpinner.setVisible(false); + minValueSpinner.setEnabled(false); } else { + minValueSpinner.setEnabled(true); setMinValueCheckBox.setSelected(true); - minValueSpinner.setVisible(true); minValueSpinner.setValue(new Double(e.getMinValue())); } this.waterMarkDictPane.populate(e); @@ -270,7 +161,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane NumberEditor ob = new NumberEditor(); ob.setAllowDecimals(allowDecimalsCheckBox.isSelected()); if (allowDecimalsCheckBox.isSelected()) { - ob.setMaxDecimalLength((Integer) this.decimalLength.getValue()); + ob.setMaxDecimalLength((int)this.decimalLength.getValue()); } ob.setAllowNegative(allowNegativeCheckBox.isSelected()); @@ -292,18 +183,108 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane return ob; } - private void checkVisible() { - if (setMinValueCheckBox.isSelected()) { - minValueSpinner.setVisible(true); - } else { - minValueSpinner.setVisible(false); - } - if (setMinValueCheckBox.isSelected()) { - minValueSpinner.setVisible(true); - } else { - minValueSpinner.setVisible(false); + private void initListeners(){ allowDecimalsListener = new ActionListener() { + public void actionPerformed(ActionEvent e) { + if (allowDecimalsCheckBox.isSelected()) { + limitNumberPane.setVisible(true); + limitNumberPane.setPreferredSize(new Dimension(215,20)); + } else { + limitNumberPane.setVisible(false); + limitNumberPane.setPreferredSize(new Dimension(0,0)); + } } + }; + + allowNegativeListener = new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + if (allowNegativeCheckBox.isSelected()) { + minValueModel.setMinimum(-Double.MAX_VALUE); + if (!setMinValueCheckBox.isSelected()) { + maxValueModel.setMinimum(-Double.MAX_VALUE); + } + } else { + minValueModel.setMinimum(0.0); + if (!setMinValueCheckBox.isSelected()) { + maxValueModel.setMinimum(0.0); + } + Double minValue = Double.parseDouble("" + minValueSpinner.getValue()); + Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue()); + if (minValue < 0.0) { + minValueSpinner.setValue(0.0); + } + if (maxValue < 0.0) { + maxValueSpinner.setValue(0.0); + } + } + } + }; + + + setMaxListener = new ActionListener() { + public void actionPerformed(ActionEvent e) { + if (setMaxValueCheckBox.isSelected()) { + maxValueSpinner.setEnabled(true); + Double value = new Double(0); + if (setMinValueCheckBox.isSelected()) { + Double minValue = Double.parseDouble("" + minValueSpinner.getValue()); + if (minValue > value) { + value = minValue; + } + } + maxValueSpinner.setValue(value); + } else { + maxValueSpinner.setEnabled(false); + minValueModel.setMaximum(Double.MAX_VALUE); + } + } + }; + + + setMinListener = new ActionListener() { + public void actionPerformed(ActionEvent e) { + if (setMinValueCheckBox.isSelected()) { + minValueSpinner.setEnabled(true); + Double value = new Double(0); + if (setMaxValueCheckBox.isSelected()) { + Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue()); + if (maxValue < value) { + value = maxValue; + } + } + minValueSpinner.setValue(value); + } else { + minValueSpinner.setEnabled(false); + maxValueModel.setMinimum(allowNegativeCheckBox.isSelected() ? (-Double.MAX_VALUE) : new Double(0)); + } + } + }; + + maxValueChangeListener = new ChangeListener() { + + @Override + public void stateChanged(ChangeEvent e) { + if (setMaxValueCheckBox.isSelected()) { + if (setMinValueCheckBox.isSelected()) { + minValueModel.setMaximum(Double.parseDouble("" + maxValueSpinner.getValue())); + } + } + } + }; + + minValueChangeListener = new ChangeListener() { + + @Override + public void stateChanged(ChangeEvent e) { + if (setMinValueCheckBox.isSelected()) { + if (setMaxValueCheckBox.isSelected()) { + maxValueModel.setMinimum(Double.parseDouble("" + minValueSpinner.getValue())); + } + } + } + }; } private void setNotAllowsInvalid(UIBasicSpinner jspinner) { diff --git a/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java b/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java index 1f38129974..b0668db162 100644 --- a/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java +++ b/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java @@ -1,7 +1,7 @@ package com.fr.design.widget.ui; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.WaterMark; @@ -13,12 +13,12 @@ import java.awt.event.KeyListener; public class WaterMarkDictPane extends JPanel { - private UIPropertyTextField waterMarkTextField; + private UITextField waterMarkTextField; public WaterMarkDictPane() { this.setLayout(new BorderLayout()); - waterMarkTextField = new UIPropertyTextField(); + waterMarkTextField = new UITextField(); UILabel emptyLabel = new UILabel(); emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); diff --git a/designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java b/designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java deleted file mode 100644 index 8a949d4a14..0000000000 --- a/designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.fr.design.gui.itextfield; - -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import javax.swing.text.Document; - - -/** - * Created by ibm on 2017/8/16. - */ -public class UIPropertyTextField extends UITextField{ - - public UIPropertyTextField() { - super(); - } - - public UIPropertyTextField(int columns) { - super(columns); - } - - public UIPropertyTextField(String text, int columns) { - super(text, columns); - } - - public UIPropertyTextField(String text) { - super(text); - } - - public UIPropertyTextField(Document doc, String text, int columns) { - super(doc, text, columns); - } - - protected void initListener() { - if (shouldResponseChangeListener()) { - addFocusListener(new FocusListener() { - @Override - public void focusGained(FocusEvent e) { - } - - @Override - public void focusLost(FocusEvent e) { - attributeChange(); - } - }); - } - } -} diff --git a/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java b/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java index 29327fa1e8..fe5c305ac9 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java +++ b/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java @@ -184,16 +184,16 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { if (widgetBoundPane != null) { widgetBoundPane.populate(); } - if (cellWidget instanceof WScaleLayout) { + Widget innerWidget = cellWidget; + if (cellWidget.acceptType(WScaleLayout.class)) { Widget crBoundsWidget = ((WScaleLayout) cellWidget).getBoundsWidget(); - currentEditorDefinePane.populateBean(((CRBoundsWidget) crBoundsWidget).getWidget()); - } else if(cellWidget instanceof WTitleLayout){ + innerWidget = ((CRBoundsWidget) crBoundsWidget).getWidget(); + } else if(cellWidget.acceptType(WTitleLayout.class)){ CRBoundsWidget crBoundsWidget = ((WTitleLayout) cellWidget).getBodyBoundsWidget(); - currentEditorDefinePane.populateBean(crBoundsWidget.getWidget()); - }else{ - currentEditorDefinePane.populateBean(cellWidget); + innerWidget = crBoundsWidget.getWidget(); } - widgetPropertyPane.populate(cellWidget); + currentEditorDefinePane.populateBean(innerWidget); + widgetPropertyPane.populate(innerWidget); reinitAllListeners(); this.addAttributeChangeListener(listener); } @@ -207,12 +207,12 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { } fireValueChanged(); - if (xCreator instanceof XWScaleLayout) { + if (xCreator.acceptType(XWScaleLayout.class)) { XCreator xCreator1 = xCreator.getEditingChildCreator(); xCreator1.resetData(widget); xCreator.removeAll(); xCreator.add(xCreator1); - }else if(xCreator instanceof XWTitleLayout){ + }else if(xCreator.acceptType(XWTitleLayout.class)){ XCreator xCreator1 = ((XWTitleLayout) xCreator).getXCreator(0); xCreator1.resetData(widget); xCreator.removeAll(); diff --git a/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java b/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java index 2ef0ea974a..ac265cc200 100644 --- a/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java +++ b/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java @@ -9,6 +9,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -29,8 +30,10 @@ public class RootDesignDefinePane extends AbstractDataModify { private XWParameterLayout root; private UISpinner designerWidth; private UICheckBox displayReport; + private UICheckBox useParamsTemplate; private AccessibleBackgroundEditor background; private UIButtonGroup hAlignmentPane; + private UITextField labelNameTextField; public RootDesignDefinePane(XCreator xCreator) { super(xCreator); @@ -69,7 +72,9 @@ public class RootDesignDefinePane extends AbstractDataModify { public JPanel createAdvancePane() { JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + labelNameTextField = new UITextField(); displayReport = new UICheckBox(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery")); + useParamsTemplate = new UICheckBox(Inter.getLocText("FR-Designer_Use_Params_Template")); background = new AccessibleBackgroundEditor(); Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"), @@ -80,12 +85,14 @@ public class RootDesignDefinePane extends AbstractDataModify { , Inter.getLocText("FR-Designer-StyleAlignment_Center"), Inter.getLocText("FR-Designer-StyleAlignment_Right")}); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; - double[] rowSize = {p, p, p}; + double[] rowSize = {p, p, p, p, p}; double[] columnSize = {p, f}; - int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), background}, new Component[]{displayReport, null}, + new Component[]{useParamsTemplate, null}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), hAlignmentPane} }; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10); @@ -101,8 +108,10 @@ public class RootDesignDefinePane extends AbstractDataModify { @Override public void populateBean(WParameterLayout ob) { + labelNameTextField.setText(ob.getLabelName()); background.setValue(ob.getBackground()); displayReport.setSelected(ob.isDelayDisplayContent()); + useParamsTemplate.setSelected(ob.isUseParamsTemplate()); designerWidth.setValue(ob.getDesignWidth()); hAlignmentPane.setSelectedIndex(ob.getPosition()); } @@ -111,8 +120,10 @@ public class RootDesignDefinePane extends AbstractDataModify { @Override public WParameterLayout updateBean() { WParameterLayout wParameterLayout = (WParameterLayout) creator.toData(); + wParameterLayout.setLabelName(labelNameTextField.getText()); wParameterLayout.setDesignWidth((int) designerWidth.getValue()); wParameterLayout.setDelayDisplayContent(displayReport.isSelected()); + wParameterLayout.setUseParamsTemplate(useParamsTemplate.isSelected()); wParameterLayout.setBackground((Background) background.getValue()); wParameterLayout.setPosition(hAlignmentPane.getSelectedIndex()); return wParameterLayout; diff --git a/designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java index 588828255a..ede1d7d295 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java @@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer; import com.fr.design.designer.creator.XCreator; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -17,9 +17,10 @@ import javax.swing.*; import java.awt.*; public abstract class ButtonDefinePane extends AbstractDataModify { - private UIPropertyTextField hotkeysTextField; - private UIPropertyTextField buttonNameTextField; + private UITextField hotkeysTextField; + private UITextField buttonNameTextField; private AccessibleIconEditor iconPane; + protected UITextField labelNameTextField; public ButtonDefinePane(XCreator creator){ @@ -31,18 +32,20 @@ public abstract class ButtonDefinePane extends AbstractDataMod this.setLayout(FRGUIPaneFactory.createBorderLayout()); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double rowSize[] = {p, p, p, p, p, p, p}; + double rowSize[] = {p, p, p, p, p, p, p, p}; double columnSize[] = {p, f}; - int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; iconPane = new AccessibleIconEditor(); - hotkeysTextField = new UIPropertyTextField(); - buttonNameTextField = new UIPropertyTextField(); + hotkeysTextField = new UITextField(); + buttonNameTextField = new UITextField(); + labelNameTextField = new UITextField(); Component[] backgroundCompPane = createBackgroundComp(); Component[] frFont = createFontPane(); UILabel backgroundLabel = new UILabel(Inter.getLocText("FR-Designer_Background")); backgroundLabel.setVerticalAlignment(SwingConstants.TOP); Component[][] n_components = { {new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField}, + {new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, backgroundCompPane, frFont, {new UILabel(Inter.getLocText("FR-Designer_Icon") + ":"), iconPane}, @@ -73,7 +76,8 @@ public abstract class ButtonDefinePane extends AbstractDataMod @Override public void populateBean(T btn) { hotkeysTextField.setText(btn.getHotkeys()); - buttonNameTextField.setText(btn.getLabelName()); + buttonNameTextField.setText(btn.getText()); + labelNameTextField.setText(btn.getLabelName()); iconPane.setValue(btn.getIconName()); populateSubButtonPane(btn); } @@ -86,8 +90,9 @@ public abstract class ButtonDefinePane extends AbstractDataMod public T updateBean() { T btn = updateSubButtonPane(); btn.setHotkeys(hotkeysTextField.getText()); - btn.setLabelName(buttonNameTextField.getText()); + btn.setLabelName(labelNameTextField.getText()); btn.setIconName((String)iconPane.getValue()); + btn.setText(buttonNameTextField.getText()); return btn; } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java index 18f0e0cedc..35f7658354 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java @@ -4,7 +4,7 @@ import com.fr.design.designer.creator.XCreator; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -16,9 +16,10 @@ import javax.swing.*; import java.awt.*; public class CheckBoxDefinePane extends AbstractDataModify { - private UIPropertyTextField text; + private UITextField text; private UISpinner fontSizePane; private FormWidgetValuePane formWidgetValuePane; + protected UITextField labelNameTextField; public CheckBoxDefinePane(XCreator xCreator) { super(xCreator); @@ -27,19 +28,21 @@ public class CheckBoxDefinePane extends AbstractDataModify { private void iniComoponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - text = new UIPropertyTextField(); + text = new UITextField(); fontSizePane = new UISpinner(0, 20, 1, 0); + labelNameTextField = new UITextField(); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Text")), text }, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane }, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}, }; - double[] rowSize = {p, p, p, p, p}; + double[] rowSize = {p, p, p, p, p, p}; double[] columnSize = {p, f}; - int[][] rowCount = {{1, 1},{1, 3},{1, 1}}; + int[][] rowCount = {{1, 1},{1, 1}, {1, 3},{1, 1}}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java index 08f73236a5..829736a651 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java @@ -4,7 +4,7 @@ import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.form.ui.ComboBox; import com.fr.general.Inter; @@ -13,7 +13,7 @@ import java.awt.*; public class ComboBoxDefinePane extends DictEditorDefinePane { private UICheckBox removeRepeatCheckBox; - private UIPropertyTextField waterMarkField; + private UITextField waterMarkField; public ComboBoxDefinePane(XCreator xCreator) { super(xCreator); @@ -26,7 +26,7 @@ public class ComboBoxDefinePane extends DictEditorDefinePane { } public Component[] createWaterMarkPane() { - waterMarkField = new UIPropertyTextField(); + waterMarkField = new UITextField(); return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkField}; } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java index 7a3ed0f224..8bff989368 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java @@ -5,7 +5,7 @@ import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.ComboCheckBox; @@ -17,7 +17,7 @@ import java.awt.*; public class ComboCheckBoxDefinePane extends DictEditorDefinePane { private UICheckBox supportTagCheckBox; private UIButtonGroup returnType; - private UIPropertyTextField waterMarkDictPane; + private UITextField waterMarkDictPane; private UICheckBox removeRepeatCheckBox; public ComboCheckBoxDefinePane(XCreator xCreator) { @@ -31,7 +31,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane } public Component[] createWaterMarkPane() { - waterMarkDictPane = new UIPropertyTextField(); + waterMarkDictPane = new UITextField(); return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}; } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java index ec735a9add..90fb8de972 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java @@ -9,6 +9,7 @@ import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -38,6 +39,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")}); JPanel formatHead = createFormatHead(); - + labelNameTextField = new UITextField(); startDv = new DateValuePane(); endDv = new DateValuePane(); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), formatHead}, new Component[]{new UILabel(Inter.getLocText("FS_Start_Date") + ":"), startDv}, @@ -73,7 +76,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane e double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane }, dicPane, removeRepeatPane, waterMarkComponent, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane} }; - double[] rowSize = {p, p, p, p, p, p,p}; + double[] rowSize = {p, p, p, p, p, p, p, p}; double[] columnSize = {p, f}; - int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1,1},{1,1}}; + int[][] rowCount = {{1, 1},{1, 3},{1, 1},{1, 1},{1,1},{1,1}}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); advancePane.add(panel, BorderLayout.NORTH); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java index ffc45d2664..cc7ecc664e 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java @@ -5,7 +5,7 @@ import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -22,9 +22,11 @@ import java.awt.event.ItemListener; public abstract class FieldEditorDefinePane extends AbstractDataModify { protected UICheckBox allowBlankCheckBox; // richer:错误信息,是所有控件共有的属性,所以放到这里来 - protected UIPropertyTextField errorMsgTextField; + protected UITextField errorMsgTextField; protected JPanel validatePane; protected UISpinner fontSizePane; + protected UITextField labelNameTextField; + public FieldEditorDefinePane(XCreator xCreator) { super(xCreator); @@ -37,10 +39,11 @@ public abstract class FieldEditorDefinePane extends Abstr protected void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); + labelNameTextField = new UITextField(); allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null")); allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); fontSizePane = new UISpinner(0, 20, 1, 0); - errorMsgTextField = new UIPropertyTextField(); + errorMsgTextField = new UITextField(); JPanel contentPane = this.setFirstContentPane(); if (contentPane != null) { UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane); @@ -54,6 +57,7 @@ public abstract class FieldEditorDefinePane extends Abstr this.allowBlankCheckBox.setSelected(ob.isAllowBlank()); this.errorMsgTextField.setText(ob.getErrorMessage()); this.fontSizePane.setValue(ob.getFontSize()); + this.labelNameTextField.setText(ob.getLabelName()); populateSubFieldEditorBean(ob); } @@ -66,12 +70,13 @@ public abstract class FieldEditorDefinePane extends Abstr e.setAllowBlank(this.allowBlankCheckBox.isSelected()); e.setErrorMessage(this.errorMsgTextField.getText()); e.setFontSize((int)fontSizePane.getValue()); + e.setLabelName(labelNameTextField.getText()); return e; } protected void initErrorMsgPane() { // 错误信息 - errorMsgTextField = new UIPropertyTextField(); + errorMsgTextField = new UITextField(); // // richer:主要为了方便查看比较长的错误信息 errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { diff --git a/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java index cbda1a2e3a..fb7399ef88 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java @@ -5,7 +5,7 @@ import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -18,7 +18,7 @@ import java.awt.*; import java.util.List; public class IframeEditorDefinePane extends AbstractDataModify { - private UIPropertyTextField srcTextField; + private UITextField srcTextField; private ReportletParameterViewPane parameterViewPane; private UICheckBox horizontalCheck; private UICheckBox verticalCheck; @@ -44,7 +44,7 @@ public class IframeEditorDefinePane extends AbstractDataModify { Component[][] coms = { { horizontalCheck, null }, { verticalCheck, null }, - { new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UIPropertyTextField() }, + { new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField() }, { new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } }; int[][] rowCount = {{1, 1},{1, 1},{1, 1}, {1, 1}}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java index cc50a01275..9ca625a15b 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java @@ -4,13 +4,13 @@ import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UIBasicSpinner; +import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.form.ui.NumberEditor; import com.fr.general.Inter; -import com.fr.third.fr.pdf.layout.border.Border; import javax.swing.*; import javax.swing.event.ChangeEvent; @@ -24,6 +24,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane public NumberEditorDefinePane(XCreator xCreator){ super(xCreator); } + private FormWidgetValuePane formWidgetValuePane; /** * @@ -37,23 +38,21 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane private SpinnerNumberModel maxValueModel; private UIBasicSpinner minValueSpinner; private SpinnerNumberModel minValueModel; - private com.fr.design.editor.editor.IntegerEditor decimalLength; + private UISpinner decimalLength; private JPanel limitNumberPane; private WaterMarkDictPane waterMarkDictPane; - private ActionListener actionListener1; - - private ActionListener actionListener2; + private ActionListener allowDecimalsListener; + private ActionListener allowNegativeListener ; - private ActionListener actionListener3; + public ActionListener setMaxListener; + private ActionListener setMinListener; - private ActionListener actionListener4 ; + private ChangeListener maxValueChangeListener; - private ChangeListener changeListener1; - - private ChangeListener changeListener2 ; + private ChangeListener minValueChangeListener; public NumberEditorDefinePane() { super(); @@ -73,13 +72,14 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane} }; - double[] rowSize = {p, p, p, p, p}; + double[] rowSize = {p, p, p, p, p, p}; double[] columnSize = {p,f}; - int[][] rowCount = {{1, 3},{1, 1},{1, 1}}; + int[][] rowCount = {{1, 1}, {1, 3},{1, 1},{1, 1}}; JPanel advancePane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); advancePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); @@ -88,17 +88,19 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane } private void initListeners(){ - actionListener1 = new ActionListener() { + allowDecimalsListener = new ActionListener() { public void actionPerformed(ActionEvent e) { if (allowDecimalsCheckBox.isSelected()) { limitNumberPane.setVisible(true); + limitNumberPane.setPreferredSize(new Dimension(215,20)); } else { limitNumberPane.setVisible(false); + limitNumberPane.setPreferredSize(new Dimension(0,0)); } } }; - actionListener2 = new ActionListener() { + allowNegativeListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -125,7 +127,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane }; - actionListener3 = new ActionListener() { + setMaxListener = new ActionListener() { public void actionPerformed(ActionEvent e) { if (setMaxValueCheckBox.isSelected()) { maxValueSpinner.setEnabled(true); @@ -145,7 +147,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane }; - actionListener4 = new ActionListener() { + setMinListener = new ActionListener() { public void actionPerformed(ActionEvent e) { if (setMinValueCheckBox.isSelected()) { minValueSpinner.setEnabled(true); @@ -164,7 +166,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane } }; - changeListener1 = new ChangeListener() { + maxValueChangeListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { @@ -176,7 +178,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane } }; - changeListener2 = new ChangeListener() { + minValueChangeListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { @@ -191,42 +193,42 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane public JPanel setValidatePane() { initListeners(); -// super.addValidatePane(); this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals")); - this.decimalLength = new com.fr.design.editor.editor.IntegerEditor(); - this.decimalLength.setColumns(4); + this.decimalLength = new UISpinner(0, Integer.MAX_VALUE, 1, 16); allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - this.allowDecimalsCheckBox.addActionListener(actionListener1); + this.allowDecimalsCheckBox.addActionListener(allowDecimalsListener); this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative")); - this.allowNegativeCheckBox.addActionListener(actionListener2); + this.allowNegativeCheckBox.addActionListener(allowNegativeListener); allowNegativeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false); setMaxValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); - maxValueSpinner.setPreferredSize(new Dimension(120, 20)); setNotAllowsInvalid(this.maxValueSpinner); - this.setMaxValueCheckBox.addActionListener(actionListener3); - this.maxValueSpinner.addChangeListener(changeListener1); + this.setMaxValueCheckBox.addActionListener(setMaxListener); + this.maxValueSpinner.addChangeListener(maxValueChangeListener); this.setMinValueCheckBox = new UICheckBox(Inter.getLocText("Need_Min_Value"), false); this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); - minValueSpinner.setPreferredSize(new Dimension(120, 20)); setNotAllowsInvalid(this.minValueSpinner); minValueSpinner.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - this.setMinValueCheckBox.addActionListener(actionListener4); + this.setMinValueCheckBox.addActionListener(setMinListener); + this.minValueSpinner.addChangeListener(minValueChangeListener); setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + UILabel numberLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Double", "Numbers"})); + limitNumberPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{numberLabel, decimalLength}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); + double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ new Component[]{allowDecimalsCheckBox, null }, - new Component[]{new UILabel(Inter.getLocText(new String[]{"Double", "Numbers"})), decimalLength }, + new Component[]{limitNumberPane, null}, new Component[]{allowNegativeCheckBox, null}, new Component[]{setMaxValueCheckBox, maxValueSpinner}, new Component[]{setMinValueCheckBox, minValueSpinner}, @@ -235,7 +237,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane double[] columnSize = {p,f}; int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); - panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); + panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); return panel; } @@ -273,7 +275,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane minValueSpinner.setValue(new Double(e.getMinValue())); } formWidgetValuePane.populate(e); -// this.regErrorMsgTextField.setText(e.getRegErrorMessage()); this.waterMarkDictPane.populate(e); } @@ -284,7 +285,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane formWidgetValuePane.update(ob); ob.setAllowDecimals(allowDecimalsCheckBox.isSelected()); if (allowDecimalsCheckBox.isSelected()) { - ob.setMaxDecimalLength(this.decimalLength.getValue()); + ob.setMaxDecimalLength((int)this.decimalLength.getValue()); } ob.setAllowNegative(allowNegativeCheckBox.isSelected()); @@ -306,20 +307,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane return ob; } - private void checkVisible() { - if (setMinValueCheckBox.isSelected()) { - minValueSpinner.setEnabled(true); - } else { - minValueSpinner.setEnabled(false); - } - - if (setMinValueCheckBox.isSelected()) { - minValueSpinner.setEnabled(true); - } else { - minValueSpinner.setEnabled(false); - } - } - private void setNotAllowsInvalid(UIBasicSpinner jspinner) { JComponent editor = jspinner.getEditor(); if (editor instanceof UIBasicSpinner.DefaultEditor) { @@ -331,4 +318,15 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane } } + public Object getValue(UIBasicSpinner jspinner){ + JComponent editor = jspinner.getEditor(); + if (editor instanceof UIBasicSpinner.DefaultEditor) { + JFormattedTextField ftf = ((UIBasicSpinner.DefaultEditor) editor).getTextField(); + ftf.setColumns(10); + JFormattedTextField.AbstractFormatter formatter = ftf.getFormatter(); + return ftf.getValue(); + } + return null; + } + } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java index 46f62dac10..5378c00ed8 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java @@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -18,7 +18,7 @@ import java.awt.event.KeyEvent; public class TextFieldEditorDefinePane extends FieldEditorDefinePane { protected RegPane regPane; - private UIPropertyTextField waterMarkDictPane; + private UITextField waterMarkDictPane; FormWidgetValuePane formWidgetValuePane; public TextFieldEditorDefinePane(XCreator xCreator) { @@ -47,7 +47,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane } }; regPane.addPhoneRegListener(pl); - waterMarkDictPane = new UIPropertyTextField(); + waterMarkDictPane = new UITextField(); waterMarkDictPane.addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { regPane.removePhoneRegListener(pl); @@ -69,13 +69,14 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value"), SwingConstants.LEFT), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark"), SwingConstants.LEFT), waterMarkDictPane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size"), SwingConstants.LEFT), fontSizePane} }; - double[] rowSize = {p, p, p, p, p}; + double[] rowSize = {p, p, p, p, p, p}; double[] columnSize = {p,f}; - int[][] rowCount = {{1, 3},{1, 1},{1, 1}}; + int[][] rowCount = {{1, 1},{1, 3},{1, 1},{1, 1}}; final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 10); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java index 68cac10377..baabdac70e 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java @@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer; import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.form.ui.TreeEditor; import com.fr.general.Inter; @@ -11,14 +11,14 @@ import java.awt.*; public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane { - protected UIPropertyTextField waterMarkDictPane; + protected UITextField waterMarkDictPane; public TreeComboBoxEditorDefinePane(XCreator xCreator) { super(xCreator); } public Component[] createWaterMarkPane(){ - waterMarkDictPane = new UIPropertyTextField(); + waterMarkDictPane = new UITextField(); return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}; } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java b/designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java index 75d6d7d17b..c0ec063af5 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java @@ -1,6 +1,6 @@ package com.fr.design.widget.ui.designer; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.form.ui.WaterMark; @@ -8,12 +8,12 @@ import javax.swing.*; public class WaterMarkDictPane extends JPanel{ - private UIPropertyTextField waterMarkTextField; + private UITextField waterMarkTextField; public WaterMarkDictPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder(0,0,0,0)); - waterMarkTextField = new UIPropertyTextField(); + waterMarkTextField = new UITextField(); this.add(waterMarkTextField); } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java index e0df39eb1b..2cfd8ce3ca 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java @@ -38,14 +38,15 @@ public abstract class ButtonGroupDefinePane extends Field double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictionaryEditor}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_FRFont")), fontSizePane}, new Component[]{buttonGroupDictPane, null} }; - double[] rowSize = {p, p, p, p, p, p}; + double[] rowSize = {p, p, p, p, p, p, p}; double[] columnSize = {p, f}; - int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1, 1}}; + int[][] rowCount = {{1, 1}, {1, 3},{1, 1},{1, 1},{1, 1}}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); advancePane.add(panel, BorderLayout.NORTH); From 0b25393c94764082187e6aa17a41070bbd03794b Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 24 Aug 2017 11:29:04 +0800 Subject: [PATCH 12/30] =?UTF-8?q?REPORT-3789=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E4=B8=8B=E6=8B=89=E6=A0=91=E3=80=81?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E6=A0=91=E6=8E=A7=E4=BB=B6=E6=97=A0=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E6=A0=91=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/DirectWriteEditorDefinePane.java | 2 +- .../ui/TreeComboBoxEditorDefinePane.java | 32 ++++++-- .../widget/ui/TreeEditorDefinePane.java | 25 +++--- .../design/widget/ui/WaterMarkDictPane.java | 9 +-- .../AccessibleTreeModelEditor.java | 80 +++++++++---------- .../widget/wrappers/TreeModelWrapper.java | 78 +++++++++--------- .../TreeComboBoxEditorDefinePane.java | 12 ++- .../ui/designer/TreeEditorDefinePane.java | 30 ++++--- 8 files changed, 150 insertions(+), 118 deletions(-) rename {designer_form => designer_base}/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java (96%) rename {designer_form => designer_base}/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java (97%) diff --git a/designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java index 3d7e335106..2cdc0bc849 100644 --- a/designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java @@ -24,7 +24,7 @@ public abstract class DirectWriteEditorDefinePane e JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false); - directWriteCheckBox.setPreferredSize(new Dimension(100, 30)); + directWriteCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); waterMarkDictPane = new WaterMarkDictPane(); contentPane.add(waterMarkDictPane, BorderLayout.NORTH); diff --git a/designer/src/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java index 3570cc66a5..2a63a5b862 100644 --- a/designer/src/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java @@ -1,19 +1,23 @@ package com.fr.design.widget.ui; -import java.awt.BorderLayout; +import java.awt.*; import javax.swing.BorderFactory; import javax.swing.JPanel; +import com.fr.data.Dictionary; import com.fr.design.data.DataCreatorUI; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itree.refreshabletree.TreeRootPane; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.gui.frpane.TreeSettingPane; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor; import com.fr.form.ui.TreeComboBoxEditor; import com.fr.form.ui.TreeEditor; +import com.fr.general.Inter; public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane { - protected TreeSettingPane treeSettingPane; + protected AccessibleTreeModelEditor treeSettingPane; protected TreeRootPane treeRootPane; public TreeComboBoxEditorDefinePane() { @@ -27,9 +31,22 @@ public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); treeRootPane = new TreeRootPane(); content.add(treeRootPane, BorderLayout.NORTH); - treeSettingPane = new TreeSettingPane(true); return content; } + + @Override + protected JPanel setFirstContentPane() { + treeSettingPane = new AccessibleTreeModelEditor(); + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + JPanel north = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Create_Tree")), treeSettingPane}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); + north.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + JPanel center = super.setFirstContentPane(); + jPanel.add(north, BorderLayout.NORTH); + jPanel.add(center, BorderLayout.CENTER); + return jPanel; + } + + @Override protected String title4PopupWindow() { @@ -38,19 +55,20 @@ public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane @Override protected void populateSubCustomWritableRepeatEditorBean(TreeEditor e) { - treeSettingPane.populate(e); + treeSettingPane.setValue(e.getDictionary()); treeRootPane.populate(e.getTreeAttr()); } @Override protected TreeComboBoxEditor updateSubCustomWritableRepeatEditorBean() { - TreeComboBoxEditor editor = treeSettingPane.updateTreeComboBox(); + TreeComboBoxEditor editor = new TreeComboBoxEditor(); + editor.setDictionary((Dictionary)treeSettingPane.getValue()); editor.setTreeAttr(treeRootPane.update()); return editor; } @Override public DataCreatorUI dataUI() { - return treeSettingPane; + return null; } } \ No newline at end of file diff --git a/designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java index d5bdb2255b..96d83b7b62 100644 --- a/designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java @@ -1,10 +1,13 @@ package com.fr.design.widget.ui; +import com.fr.data.Dictionary; import com.fr.design.data.DataCreatorUI; -import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itree.refreshabletree.TreeRootPane; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor; import com.fr.form.ui.TreeEditor; import com.fr.general.Inter; @@ -16,8 +19,8 @@ import java.awt.*; * richer:tree editor */ public class TreeEditorDefinePane extends FieldEditorDefinePane { - protected TreeSettingPane treeSettingPane; protected TreeRootPane treeRootPane; + private AccessibleTreeModelEditor accessibleTreeModelEditor; private UICheckBox removeRepeatCheckBox; @@ -27,7 +30,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane { @Override protected void populateSubFieldEditorBean(TreeEditor e) { - this.treeSettingPane.populate(e); + this.accessibleTreeModelEditor.setValue(e.getDictionary()); treeRootPane.populate(e.getTreeAttr()); if (this.removeRepeatCheckBox != null) { this.removeRepeatCheckBox.setSelected(e.isRemoveRepeat()); @@ -36,7 +39,8 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane { @Override protected TreeEditor updateSubFieldEditorBean() { - TreeEditor editor = treeSettingPane.updateTreeEditor(); + TreeEditor editor = new TreeEditor(); + editor.setDictionary((Dictionary) accessibleTreeModelEditor.getValue()); editor.setTreeAttr(treeRootPane.update()); if (this.removeRepeatCheckBox != null) { editor.setRemoveRepeat(this.removeRepeatCheckBox.isSelected()); @@ -50,13 +54,17 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane { } protected JPanel setSecondContentPane() { + accessibleTreeModelEditor = new AccessibleTreeModelEditor(); + JPanel createTree = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Create_Tree")), accessibleTreeModelEditor}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); + createTree.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); - contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0(); + JPanel contenter = FRGUIPaneFactory.createBorderLayout_S_Pane(); contentPane.add(contenter,BorderLayout.NORTH); removeRepeatCheckBox = new UICheckBox(Inter.getLocText("Form-Remove_Repeat_Data"), false); - contenter.add(removeRepeatCheckBox); + removeRepeatCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + contenter.add(createTree, BorderLayout.NORTH); + contenter.add(removeRepeatCheckBox, BorderLayout.CENTER); JPanel otherContentPane = this.setThirdContentPane(); if (otherContentPane != null) { contentPane.add(otherContentPane,BorderLayout.CENTER); @@ -69,7 +77,6 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane { content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); treeRootPane = new TreeRootPane(); content.add(treeRootPane, BorderLayout.NORTH); - treeSettingPane = new TreeSettingPane(true); return content; } @@ -80,6 +87,6 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane { @Override public DataCreatorUI dataUI() { - return treeSettingPane; + return null; } } \ No newline at end of file diff --git a/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java b/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java index b0668db162..1bfcb06337 100644 --- a/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java +++ b/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java @@ -20,18 +20,15 @@ public class WaterMarkDictPane extends JPanel { waterMarkTextField = new UITextField(); - UILabel emptyLabel = new UILabel(); - emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); - double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), emptyLabel, waterMarkTextField}, + new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkTextField}, }; double[] rowSize = {p}; - double[] columnSize = {p, p, f}; + double[] columnSize = {p, f}; int[][] rowCount = {{1, 1}}; - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 18, 7); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); this.add(panel, BorderLayout.CENTER); } diff --git a/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java b/designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java similarity index 96% rename from designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java rename to designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java index ef02c9f34a..5ce099c91f 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java +++ b/designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java @@ -1,41 +1,41 @@ -package com.fr.design.mainframe.widget.accessibles; - -import javax.swing.SwingUtilities; - -import com.fr.design.mainframe.widget.wrappers.TreeModelWrapper; -import com.fr.design.dialog.BasicDialog; -import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.gui.frpane.TreeSettingPane; - - -/** - * 用于TreeEdito和TreeComboBox的数据格式设置 - * @since 6.5.3 - */ -public class AccessibleTreeModelEditor extends UneditableAccessibleEditor { - - private TreeSettingPane treeSettingPane; - - public AccessibleTreeModelEditor() { - super(new TreeModelWrapper()); - } - - @Override - protected void showEditorPane() { - if (treeSettingPane == null) { - treeSettingPane = new TreeSettingPane(false); - } - BasicDialog dlg = treeSettingPane.showWindow(SwingUtilities.getWindowAncestor(this)); - treeSettingPane.populate(getValue()); - dlg.addDialogActionListener(new DialogActionAdapter() { - - @Override - public void doOk() { - Object nodeOrDict = treeSettingPane.updateTreeNodeAttrs(); - setValue(nodeOrDict); - fireStateChanged(); - } - }); - dlg.setVisible(true); - } +package com.fr.design.mainframe.widget.accessibles; + +import javax.swing.SwingUtilities; + +import com.fr.design.mainframe.widget.wrappers.TreeModelWrapper; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.gui.frpane.TreeSettingPane; + + +/** + * 用于TreeEdito和TreeComboBox的数据格式设置 + * @since 6.5.3 + */ +public class AccessibleTreeModelEditor extends UneditableAccessibleEditor { + + private TreeSettingPane treeSettingPane; + + public AccessibleTreeModelEditor() { + super(new TreeModelWrapper()); + } + + @Override + protected void showEditorPane() { + if (treeSettingPane == null) { + treeSettingPane = new TreeSettingPane(false); + } + BasicDialog dlg = treeSettingPane.showWindow(SwingUtilities.getWindowAncestor(this)); + treeSettingPane.populate(getValue()); + dlg.addDialogActionListener(new DialogActionAdapter() { + + @Override + public void doOk() { + Object nodeOrDict = treeSettingPane.updateTreeNodeAttrs(); + setValue(nodeOrDict); + fireStateChanged(); + } + }); + dlg.setVisible(true); + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java b/designer_base/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java similarity index 97% rename from designer_form/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java rename to designer_base/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java index 17f9d0c891..1127c2503b 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java +++ b/designer_base/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java @@ -1,40 +1,40 @@ -package com.fr.design.mainframe.widget.wrappers; - -import com.fr.base.TemplateUtils; -import com.fr.data.impl.TreeNodeAttr; -import com.fr.data.impl.TreeNodeWrapper; -import com.fr.design.Exception.ValidationException; -import com.fr.design.designer.properties.Decoder; -import com.fr.design.designer.properties.Encoder; -import com.fr.general.Inter; -import com.fr.general.NameObject; -import com.fr.stable.StringUtils; - -public class TreeModelWrapper implements Encoder, Decoder { - - @Override - public String encode(Object v) { - if (v == null) { - return StringUtils.EMPTY; - } - if (v instanceof TreeNodeAttr[]) { - return TemplateUtils.render(Inter.getLocText("FR-Designer_Total_N_Grade"), new String[]{"N"}, new String[]{((TreeNodeAttr[]) v).length + ""}); - } else if (v instanceof TreeNodeWrapper) { - TreeNodeAttr[] treeNodeAttrs = ((TreeNodeWrapper) v).getTreeNodeAttrs(); - return TemplateUtils.render(Inter.getLocText("FR-Designer_Total_N_Grade"), new String[]{"N"}, new String[]{treeNodeAttrs.length + ""}); - } else if (v instanceof NameObject) { - return Inter.getLocText("FR-Designer_DataTable-Build"); - } else { - return Inter.getLocText("FR-Designer_Auto-Build"); - } - } - - @Override - public Object decode(String txt) { - return null; - } - - @Override - public void validate(String txt) throws ValidationException { - } +package com.fr.design.mainframe.widget.wrappers; + +import com.fr.base.TemplateUtils; +import com.fr.data.impl.TreeNodeAttr; +import com.fr.data.impl.TreeNodeWrapper; +import com.fr.design.Exception.ValidationException; +import com.fr.design.designer.properties.Decoder; +import com.fr.design.designer.properties.Encoder; +import com.fr.general.Inter; +import com.fr.general.NameObject; +import com.fr.stable.StringUtils; + +public class TreeModelWrapper implements Encoder, Decoder { + + @Override + public String encode(Object v) { + if (v == null) { + return StringUtils.EMPTY; + } + if (v instanceof TreeNodeAttr[]) { + return TemplateUtils.render(Inter.getLocText("FR-Designer_Total_N_Grade"), new String[]{"N"}, new String[]{((TreeNodeAttr[]) v).length + ""}); + } else if (v instanceof TreeNodeWrapper) { + TreeNodeAttr[] treeNodeAttrs = ((TreeNodeWrapper) v).getTreeNodeAttrs(); + return TemplateUtils.render(Inter.getLocText("FR-Designer_Total_N_Grade"), new String[]{"N"}, new String[]{treeNodeAttrs.length + ""}); + } else if (v instanceof NameObject) { + return Inter.getLocText("FR-Designer_DataTable-Build"); + } else { + return Inter.getLocText("FR-Designer_Auto-Build"); + } + } + + @Override + public Object decode(String txt) { + return null; + } + + @Override + public void validate(String txt) throws ValidationException { + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java index baabdac70e..fd26c6934f 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java @@ -27,15 +27,13 @@ public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane { return "treecombobox"; } - protected void populateSubDictionaryEditorBean(TreeEditor ob){ - super.populateSubDictionaryEditorBean(ob); - formWidgetValuePane.populate(ob); + protected void populateSubCustomWritableRepeatEditorBean(TreeEditor ob){ + super.populateSubCustomWritableRepeatEditorBean(ob); waterMarkDictPane.setText(ob.getWaterMark()); } - protected TreeEditor updateSubDictionaryEditorBean(){ - TreeEditor editor = super.updateSubDictionaryEditorBean(); - formWidgetValuePane.update(editor); + protected TreeEditor updateSubCustomWritableRepeatEditorBean(){ + TreeEditor editor = super.updateSubCustomWritableRepeatEditorBean(); editor.setWaterMark(waterMarkDictPane.getText()); return editor; } @@ -44,6 +42,6 @@ public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane { @Override public DataCreatorUI dataUI() { - return treeSettingPane; + return null; } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java index 6edfe78c77..100fb2800e 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java @@ -1,14 +1,16 @@ package com.fr.design.widget.ui.designer; +import com.fr.data.Dictionary; import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.creator.XCreator; -import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itree.refreshabletree.TreeRootPane; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor; import com.fr.form.ui.TreeEditor; import com.fr.general.Inter; @@ -19,20 +21,21 @@ import java.awt.*; /* * richer:tree editor */ -public class TreeEditorDefinePane extends DictEditorDefinePane { - protected TreeSettingPane treeSettingPane; +public class TreeEditorDefinePane extends CustomWritableRepeatEditorPane { protected TreeRootPane treeRootPane; private UICheckBox mutiSelect; private UICheckBox loadAsync; private UICheckBox returnLeaf; private UICheckBox returnPath; + private AccessibleTreeModelEditor accessibleTreeModelEditor; public TreeEditorDefinePane(XCreator xCreator) { super(xCreator); treeRootPane = new TreeRootPane(); - treeSettingPane = new TreeSettingPane(true); } + + public JPanel createOtherPane() { mutiSelect = new UICheckBox(Inter.getLocText("Tree-Mutiple_Selection_Or_Not")); loadAsync = new UICheckBox(Inter.getLocText("Widget-Load_By_Async")); @@ -58,9 +61,16 @@ public class TreeEditorDefinePane extends DictEditorDefinePane { return "tree"; } - protected void populateSubDictionaryEditorBean(TreeEditor e){ + + protected Component[] createDictPane(){ + accessibleTreeModelEditor = new AccessibleTreeModelEditor(); + return new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), accessibleTreeModelEditor}; + } + + @Override + protected void populateSubCustomWritableRepeatEditorBean(TreeEditor e) { + accessibleTreeModelEditor.setValue(e.getDictionary()); formWidgetValuePane.populate(e); - treeSettingPane.populate(e); treeRootPane.populate(e.getTreeAttr()); mutiSelect.setSelected(e.isMultipleSelection()); loadAsync.setSelected(e.isAjax()); @@ -68,7 +78,9 @@ public class TreeEditorDefinePane extends DictEditorDefinePane { returnPath.setSelected(e.isReturnFullPath()); } - protected TreeEditor updateSubDictionaryEditorBean(){ + + @Override + protected TreeEditor updateSubCustomWritableRepeatEditorBean() { TreeEditor editor = (TreeEditor)creator.toData(); formWidgetValuePane.update(editor); editor.setTreeAttr(treeRootPane.update()); @@ -76,12 +88,12 @@ public class TreeEditorDefinePane extends DictEditorDefinePane { editor.setAjax(loadAsync.isSelected()); editor.setSelectLeafOnly(returnLeaf.isSelected()); editor.setReturnFullPath(returnPath.isSelected()); + editor.setDictionary((Dictionary) accessibleTreeModelEditor.getValue()); return editor; } - @Override public DataCreatorUI dataUI() { - return treeSettingPane; + return null; } } \ No newline at end of file From ee0c86589c37429a08ed54814b38c55756f8d2de Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 24 Aug 2017 13:35:55 +0800 Subject: [PATCH 13/30] fix --- .../mainframe/MobileParaWidgetTable.java | 154 ++++++++++-------- 1 file changed, 88 insertions(+), 66 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java index e32ba8cc53..57402df94f 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java @@ -1,12 +1,41 @@ package com.fr.design.mainframe; -import com.fr.design.designer.creator.XCreator; -import com.fr.design.designer.creator.XLayoutContainer; -import com.fr.design.designer.creator.XWParameterLayout; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Component; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.geom.RoundRectangle2D; +import java.util.EventObject; + +import javax.swing.AbstractCellEditor; +import javax.swing.BorderFactory; +import javax.swing.JTable; +import javax.swing.ListSelectionModel; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.JTableHeader; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableColumn; +import javax.swing.table.TableModel; + import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itable.GroupRenderer; import com.fr.design.gui.itable.HeaderRenderer; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWParameterLayout; import com.fr.form.ui.Label; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WParameterLayout; @@ -14,18 +43,6 @@ import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.stable.StringUtils; -import javax.swing.*; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import javax.swing.table.*; -import java.awt.*; -import java.awt.event.FocusAdapter; -import java.awt.event.FocusEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.geom.RoundRectangle2D; -import java.util.EventObject; - /** * MobileParaWidgetTable主要显示参数面板容器的控件列表,与MobileWidgetTable的区别就是该表多了UITextField这一列 * Created with IntelliJ IDEA. @@ -36,12 +53,11 @@ import java.util.EventObject; */ class MobileParaWidgetTable extends JTable { - private final int WIDGET_NAME_COLUMN = 1; private FormDesigner designer; - private String[][] cellData; - private String[] headers = {Inter.getLocText("Form-Widget_Name")}; + private String[][] cellData ; + private String[] headers = {Inter.getLocText("FR-Utils_Label"), Inter.getLocText("Form-Widget_Name")}; private static final int WIDGET_TABLE_ROW_HEIGHT = 22; - private static final int UITEXTFIELD_WIDTH = 40; + private static final int UITEXTFIELD_WIDTH = 0; private UILabel moveComponent = new UILabel(); // 作为拖动时候随鼠标移动的那个半透明控件 private int selectedRow = -1; private int selectedColumn = -1; @@ -55,11 +71,13 @@ class MobileParaWidgetTable extends JTable { this.setDefaultEditor(Object.class, new MobileCellEditor()); TableModel defaultModel = new BeanTableModel(); this.setModel(defaultModel); - this.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); + this.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); TableColumn tc = this.getColumn(this.getColumnName(0)); + tc.setMinWidth(UITEXTFIELD_WIDTH); + tc.setMaxWidth(UITEXTFIELD_WIDTH); tc.setPreferredWidth(UITEXTFIELD_WIDTH); this.repaint(); - this.setDefaultRenderer(Object.class, new MobileWidgetTableCellRenderer()); + this.setDefaultRenderer(Object.class,new MobileWidgetTableCellRenderer()); refreshData(); this.addMouseListener(mouseAdapter); this.addMouseMotionListener(mouseAdapter); @@ -96,12 +114,12 @@ class MobileParaWidgetTable extends JTable { */ @Override public void mouseReleased(MouseEvent e) { - if (!draging) { + if(!draging){ return; } draging = false; moveComponent.setVisible(false); - int toIndex = e.getY() < GAP ? 0 : (int) Math.rint((e.getY() - GAP) / WIDGET_TABLE_ROW_HEIGHT) + 1; + int toIndex = e.getY() < GAP ? 0 : (int)Math.rint((e.getY() - GAP)/WIDGET_TABLE_ROW_HEIGHT) + 1; //当鼠标放开时,将选中的容器调整至新的顺序 ((WParameterLayout) designer.getParaComponent().toData()).adjustOrder(selectedRow, toIndex); //拿取排序后表格数据,然后重绘表格 @@ -119,13 +137,13 @@ class MobileParaWidgetTable extends JTable { public void mouseMoved(MouseEvent e) { int overColumn = e.getX() < getColumnModel().getColumn(0).getWidth() ? 0 : 1; // 判断当前鼠标在哪一列 int overRow = -1; - for (int i = 0; i < getRowCount(); i++) { + for (int i = 0;i < getRowCount();i++) { if (e.getY() > i * WIDGET_TABLE_ROW_HEIGHT && e.getY() <= (i + 1) * WIDGET_TABLE_ROW_HEIGHT) { overRow = i; //判断当前鼠标在哪一行 } } //如果鼠标移动到当前选中的行列上面的时候,并且不能在第一列 - if (overRow == selectedRow && overColumn == selectedColumn && overColumn != 0) { + if (overRow == selectedRow && overColumn == selectedColumn && overColumn !=0) { //把当前选中的那一列行的光标改成(除了第一列)移动样式MOVE_CURSOR setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); } else { @@ -140,31 +158,34 @@ class MobileParaWidgetTable extends JTable { */ @Override public void mouseDragged(MouseEvent e) { - int width = getColumnModel().getColumn(0).getWidth(); - setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); - draging = true; - moveComponent.setText(getValueAt(selectedRow, selectedColumn).toString()); - moveComponent.setLocation(getColumnModel().getColumn(0).getWidth(), e.getY() - GAP); - moveComponent.setSize(new Dimension(width, WIDGET_TABLE_ROW_HEIGHT)); - moveComponent.setVisible(true); - moveComponent.setForeground(Color.lightGray); - moveComponent.setBorder(BorderFactory.createLineBorder(Color.lightGray)); + int width = getColumnModel().getColumn(1).getWidth(); + //如果点击选中的是第二列,就可以拖动 + if (selectedColumn == 1){ + setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); + draging = true; + moveComponent.setText(getValueAt(selectedRow, selectedColumn).toString()); + moveComponent.setLocation(getColumnModel().getColumn(0).getWidth(), e.getY() - GAP); + moveComponent.setSize(new Dimension(width, WIDGET_TABLE_ROW_HEIGHT)); + moveComponent.setVisible(true); + moveComponent.setForeground(Color.lightGray); + moveComponent.setBorder(BorderFactory.createLineBorder(Color.lightGray)); + } } /** - * 设置鼠标单击时处理的事件 + * 设置鼠标单击时处理的事件(单击第二列的控件列表进入控件属性表) * @param e */ @Override public void mouseClicked(MouseEvent e) { - if (getSelectedRow() != -1 && getSelectedColumn() == 0) { + if(getSelectedRow() != -1 && getSelectedColumn() == 1){ String widgetName = cellData[getSelectedRow()][getSelectedColumn()]; - if (StringUtils.isNotEmpty(widgetName)) { + if (StringUtils.isNotEmpty(widgetName)){ int count = getEditingDesigner().getParaComponent().getComponentCount(); - for (int i = 0; i < count; i++) { - XCreator xCreator = (XCreator) getEditingDesigner().getParaComponent().getComponent(i); + for (int i = 0; i < count; i++){ + XCreator xCreator = (XCreator)getEditingDesigner().getParaComponent().getComponent(i); Widget widget = xCreator.toData(); - if (!widget.acceptType(Label.class) && ComparatorUtils.equals(widgetName, widget.getWidgetName())) { + if (!widget.acceptType(Label.class) && ComparatorUtils.equals(widgetName,widget.getWidgetName())) { //设置选中的component,这句代码控制点击之后跳转到相应component属性表 getEditingDesigner().getSelectionModel().setSelectedCreator(xCreator); } @@ -185,12 +206,12 @@ class MobileParaWidgetTable extends JTable { } }; - public MobileParaWidgetTable getInstance() { + public MobileParaWidgetTable getInstance(){ return this; } - private FormDesigner getEditingDesigner() { - return designer; + private FormDesigner getEditingDesigner(){ + return designer; } /** @@ -210,7 +231,7 @@ class MobileParaWidgetTable extends JTable { /** * 重新get排序后的数据 */ - public void refreshData() { + public void refreshData(){ cellData = getData(); } @@ -219,10 +240,10 @@ class MobileParaWidgetTable extends JTable { * * @return String[][] 二维数组,[0][0]widgetTag, [0][1]widgetName */ - private String[][] getData() { + private String[][] getData(){ XLayoutContainer paraContainer = designer.getParaComponent(); - if (paraContainer == null || !paraContainer.acceptType(XWParameterLayout.class)) { - return new String[0][1]; + if(paraContainer == null || !paraContainer.acceptType(XWParameterLayout.class)){ + return new String[0][0]; } WParameterLayout para = (WParameterLayout) (paraContainer.toData()); @@ -232,14 +253,14 @@ class MobileParaWidgetTable extends JTable { /** * 自定义的tableRender类 */ - private class MobileWidgetTableCellRenderer extends DefaultTableCellRenderer { + private class MobileWidgetTableCellRenderer extends DefaultTableCellRenderer{ @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - if (column == 0) { + if (column == 0){ UITextField uiTableTextField; - if (getSelectedColumn() == column && getSelectedRow() == row) { + if (getSelectedColumn() == column && getSelectedRow() == row){ uiTableTextField = new UITableTextField(value.toString()); } else { uiTableTextField = new UITextField(value.toString()); @@ -256,8 +277,7 @@ class MobileParaWidgetTable extends JTable { */ private class MobileCellEditor extends AbstractCellEditor implements TableCellEditor { UITableTextField uiTableTextField; - - MobileCellEditor() { + MobileCellEditor(){ uiTableTextField = new UITableTextField(); uiTableTextField.addFocusListener(new FocusAdapter() { @Override @@ -288,7 +308,7 @@ class MobileParaWidgetTable extends JTable { * cell改变,相应的nametag改变 */ - private void firePropertyChange() { + private void firePropertyChange(){ ((WParameterLayout) designer.getParaComponent().toData()).add2NameTagMap(uiTableTextField.getText(), cellData[getSelectedRow()][1]); ((WParameterLayout) designer.getParaComponent().toData()).setNameTagModified(cellData[getSelectedRow()][1], @@ -296,7 +316,7 @@ class MobileParaWidgetTable extends JTable { } @Override - public Object getCellEditorValue() { + public Object getCellEditorValue(){ return uiTableTextField.getText(); } @@ -309,8 +329,8 @@ class MobileParaWidgetTable extends JTable { } @Override - public Component getTableCellEditorComponent(JTable table, Object value, - boolean isSelected, int row, int column) { + public Component getTableCellEditorComponent( JTable table,Object value, + boolean isSelected,int row,int column){ uiTableTextField.setText(value.toString()); return uiTableTextField; } @@ -342,7 +362,7 @@ class MobileParaWidgetTable extends JTable { } Object[] rowValue = cellData[row]; if (column > -1 && column < rowValue.length) { - return cellData[row][WIDGET_NAME_COLUMN]; + return cellData[row][column]; } return null; } @@ -363,21 +383,23 @@ class MobileParaWidgetTable extends JTable { return; } if (aValue == null) { - cellData[row][WIDGET_NAME_COLUMN] = null; + cellData[row][column] = null; return; } - cellData[row][WIDGET_NAME_COLUMN] = aValue.toString(); + cellData[row][column] = aValue.toString(); } /** - * 是否可编辑 控件标签列可以编辑,控件名不可编辑 - * - * @param row 行号 - * @param column 列号 + * 是否可编辑 控件标签列可以编辑,控件名不可编辑 + * @param row 行号 + * @param column 列号 * @return 是否可编辑 */ public boolean isCellEditable(int row, int column) { - return false; + if(column ==1){ + return false; + } + return true; } } @@ -386,11 +408,11 @@ class MobileParaWidgetTable extends JTable { * 继承自JTextField类,重写了编辑框的样式 */ private class UITableTextField extends UITextField { - public UITableTextField() { + public UITableTextField(){ super(); } - public UITableTextField(String string) { + public UITableTextField(String string){ super(string); } From 25ab70797fe974a52d8d02c86e45c0f4ba7df8fd Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 24 Aug 2017 13:36:54 +0800 Subject: [PATCH 14/30] tmp --- .../mainframe/MobileParaWidgetTable.java | 47 ++++++------------- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java index 57402df94f..5c3f3630dd 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java @@ -1,41 +1,12 @@ package com.fr.design.mainframe; -import java.awt.BasicStroke; -import java.awt.Color; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.RenderingHints; -import java.awt.event.FocusAdapter; -import java.awt.event.FocusEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.geom.RoundRectangle2D; -import java.util.EventObject; - -import javax.swing.AbstractCellEditor; -import javax.swing.BorderFactory; -import javax.swing.JTable; -import javax.swing.ListSelectionModel; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import javax.swing.table.DefaultTableCellRenderer; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.JTableHeader; -import javax.swing.table.TableCellEditor; -import javax.swing.table.TableColumn; -import javax.swing.table.TableModel; - -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itable.GroupRenderer; -import com.fr.design.gui.itable.HeaderRenderer; -import com.fr.design.gui.itextfield.UITextField; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itable.HeaderRenderer; +import com.fr.design.gui.itextfield.UITextField; import com.fr.form.ui.Label; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WParameterLayout; @@ -43,6 +14,18 @@ import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.stable.StringUtils; +import javax.swing.*; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.table.*; +import java.awt.*; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.geom.RoundRectangle2D; +import java.util.EventObject; + /** * MobileParaWidgetTable主要显示参数面板容器的控件列表,与MobileWidgetTable的区别就是该表多了UITextField这一列 * Created with IntelliJ IDEA. From 2c297d511b42b4463548b009078a28176c79e7ae Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 24 Aug 2017 13:50:10 +0800 Subject: [PATCH 15/30] format --- .../mainframe/MobileParaWidgetTable.java | 66 ++++++++++--------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java index 5c3f3630dd..37555dd604 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java @@ -37,7 +37,7 @@ import java.util.EventObject; class MobileParaWidgetTable extends JTable { private FormDesigner designer; - private String[][] cellData ; + private String[][] cellData; private String[] headers = {Inter.getLocText("FR-Utils_Label"), Inter.getLocText("Form-Widget_Name")}; private static final int WIDGET_TABLE_ROW_HEIGHT = 22; private static final int UITEXTFIELD_WIDTH = 0; @@ -60,7 +60,7 @@ class MobileParaWidgetTable extends JTable { tc.setMaxWidth(UITEXTFIELD_WIDTH); tc.setPreferredWidth(UITEXTFIELD_WIDTH); this.repaint(); - this.setDefaultRenderer(Object.class,new MobileWidgetTableCellRenderer()); + this.setDefaultRenderer(Object.class, new MobileWidgetTableCellRenderer()); refreshData(); this.addMouseListener(mouseAdapter); this.addMouseMotionListener(mouseAdapter); @@ -97,12 +97,12 @@ class MobileParaWidgetTable extends JTable { */ @Override public void mouseReleased(MouseEvent e) { - if(!draging){ + if (!draging) { return; } draging = false; moveComponent.setVisible(false); - int toIndex = e.getY() < GAP ? 0 : (int)Math.rint((e.getY() - GAP)/WIDGET_TABLE_ROW_HEIGHT) + 1; + int toIndex = e.getY() < GAP ? 0 : (int) Math.rint((e.getY() - GAP) / WIDGET_TABLE_ROW_HEIGHT) + 1; //当鼠标放开时,将选中的容器调整至新的顺序 ((WParameterLayout) designer.getParaComponent().toData()).adjustOrder(selectedRow, toIndex); //拿取排序后表格数据,然后重绘表格 @@ -120,13 +120,13 @@ class MobileParaWidgetTable extends JTable { public void mouseMoved(MouseEvent e) { int overColumn = e.getX() < getColumnModel().getColumn(0).getWidth() ? 0 : 1; // 判断当前鼠标在哪一列 int overRow = -1; - for (int i = 0;i < getRowCount();i++) { + for (int i = 0; i < getRowCount(); i++) { if (e.getY() > i * WIDGET_TABLE_ROW_HEIGHT && e.getY() <= (i + 1) * WIDGET_TABLE_ROW_HEIGHT) { overRow = i; //判断当前鼠标在哪一行 } } //如果鼠标移动到当前选中的行列上面的时候,并且不能在第一列 - if (overRow == selectedRow && overColumn == selectedColumn && overColumn !=0) { + if (overRow == selectedRow && overColumn == selectedColumn && overColumn != 0) { //把当前选中的那一列行的光标改成(除了第一列)移动样式MOVE_CURSOR setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); } else { @@ -143,7 +143,7 @@ class MobileParaWidgetTable extends JTable { public void mouseDragged(MouseEvent e) { int width = getColumnModel().getColumn(1).getWidth(); //如果点击选中的是第二列,就可以拖动 - if (selectedColumn == 1){ + if (selectedColumn == 1) { setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); draging = true; moveComponent.setText(getValueAt(selectedRow, selectedColumn).toString()); @@ -161,14 +161,14 @@ class MobileParaWidgetTable extends JTable { */ @Override public void mouseClicked(MouseEvent e) { - if(getSelectedRow() != -1 && getSelectedColumn() == 1){ + if (getSelectedRow() != -1 && getSelectedColumn() == 1) { String widgetName = cellData[getSelectedRow()][getSelectedColumn()]; - if (StringUtils.isNotEmpty(widgetName)){ + if (StringUtils.isNotEmpty(widgetName)) { int count = getEditingDesigner().getParaComponent().getComponentCount(); - for (int i = 0; i < count; i++){ - XCreator xCreator = (XCreator)getEditingDesigner().getParaComponent().getComponent(i); + for (int i = 0; i < count; i++) { + XCreator xCreator = (XCreator) getEditingDesigner().getParaComponent().getComponent(i); Widget widget = xCreator.toData(); - if (!widget.acceptType(Label.class) && ComparatorUtils.equals(widgetName,widget.getWidgetName())) { + if (!widget.acceptType(Label.class) && ComparatorUtils.equals(widgetName, widget.getWidgetName())) { //设置选中的component,这句代码控制点击之后跳转到相应component属性表 getEditingDesigner().getSelectionModel().setSelectedCreator(xCreator); } @@ -189,12 +189,12 @@ class MobileParaWidgetTable extends JTable { } }; - public MobileParaWidgetTable getInstance(){ + public MobileParaWidgetTable getInstance() { return this; } - private FormDesigner getEditingDesigner(){ - return designer; + private FormDesigner getEditingDesigner() { + return designer; } /** @@ -214,7 +214,7 @@ class MobileParaWidgetTable extends JTable { /** * 重新get排序后的数据 */ - public void refreshData(){ + public void refreshData() { cellData = getData(); } @@ -223,9 +223,9 @@ class MobileParaWidgetTable extends JTable { * * @return String[][] 二维数组,[0][0]widgetTag, [0][1]widgetName */ - private String[][] getData(){ + private String[][] getData() { XLayoutContainer paraContainer = designer.getParaComponent(); - if(paraContainer == null || !paraContainer.acceptType(XWParameterLayout.class)){ + if (paraContainer == null || !paraContainer.acceptType(XWParameterLayout.class)) { return new String[0][0]; } @@ -236,14 +236,14 @@ class MobileParaWidgetTable extends JTable { /** * 自定义的tableRender类 */ - private class MobileWidgetTableCellRenderer extends DefaultTableCellRenderer{ + private class MobileWidgetTableCellRenderer extends DefaultTableCellRenderer { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - if (column == 0){ + if (column == 0) { UITextField uiTableTextField; - if (getSelectedColumn() == column && getSelectedRow() == row){ + if (getSelectedColumn() == column && getSelectedRow() == row) { uiTableTextField = new UITableTextField(value.toString()); } else { uiTableTextField = new UITextField(value.toString()); @@ -260,7 +260,8 @@ class MobileParaWidgetTable extends JTable { */ private class MobileCellEditor extends AbstractCellEditor implements TableCellEditor { UITableTextField uiTableTextField; - MobileCellEditor(){ + + MobileCellEditor() { uiTableTextField = new UITableTextField(); uiTableTextField.addFocusListener(new FocusAdapter() { @Override @@ -291,7 +292,7 @@ class MobileParaWidgetTable extends JTable { * cell改变,相应的nametag改变 */ - private void firePropertyChange(){ + private void firePropertyChange() { ((WParameterLayout) designer.getParaComponent().toData()).add2NameTagMap(uiTableTextField.getText(), cellData[getSelectedRow()][1]); ((WParameterLayout) designer.getParaComponent().toData()).setNameTagModified(cellData[getSelectedRow()][1], @@ -299,7 +300,7 @@ class MobileParaWidgetTable extends JTable { } @Override - public Object getCellEditorValue(){ + public Object getCellEditorValue() { return uiTableTextField.getText(); } @@ -312,8 +313,8 @@ class MobileParaWidgetTable extends JTable { } @Override - public Component getTableCellEditorComponent( JTable table,Object value, - boolean isSelected,int row,int column){ + public Component getTableCellEditorComponent(JTable table, Object value, + boolean isSelected, int row, int column) { uiTableTextField.setText(value.toString()); return uiTableTextField; } @@ -373,13 +374,14 @@ class MobileParaWidgetTable extends JTable { } /** - * 是否可编辑 控件标签列可以编辑,控件名不可编辑 - * @param row 行号 - * @param column 列号 + * 是否可编辑 控件标签列可以编辑,控件名不可编辑 + * + * @param row 行号 + * @param column 列号 * @return 是否可编辑 */ public boolean isCellEditable(int row, int column) { - if(column ==1){ + if (column == 1) { return false; } return true; @@ -391,11 +393,11 @@ class MobileParaWidgetTable extends JTable { * 继承自JTextField类,重写了编辑框的样式 */ private class UITableTextField extends UITextField { - public UITableTextField(){ + public UITableTextField() { super(); } - public UITableTextField(String string){ + public UITableTextField(String string) { super(string); } From 5f50ab43081338f9cb303f94cee068251494b5f8 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 24 Aug 2017 13:54:42 +0800 Subject: [PATCH 16/30] SonarQube --- .../com/fr/design/mainframe/MobileParaWidgetTable.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java index 37555dd604..2c6c063726 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java @@ -41,15 +41,19 @@ class MobileParaWidgetTable extends JTable { private String[] headers = {Inter.getLocText("FR-Utils_Label"), Inter.getLocText("Form-Widget_Name")}; private static final int WIDGET_TABLE_ROW_HEIGHT = 22; private static final int UITEXTFIELD_WIDTH = 0; + private static final int GAP = 11; private UILabel moveComponent = new UILabel(); // 作为拖动时候随鼠标移动的那个半透明控件 private int selectedRow = -1; private int selectedColumn = -1; - private int GAP = 11; private boolean draging = false; - MobileParaWidgetTable(FormDesigner designer) { + private void init(FormDesigner designer) { this.designer = designer; this.cellData = getData(); + } + + MobileParaWidgetTable(FormDesigner designer) { + init(designer); this.setTableProperties(); this.setDefaultEditor(Object.class, new MobileCellEditor()); TableModel defaultModel = new BeanTableModel(); From ef12593641aae6e9a9ab652ea441c8ec50422d90 Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 24 Aug 2017 14:28:33 +0800 Subject: [PATCH 17/30] =?UTF-8?q?bugfix:=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E6=8F=92=E5=85=A5=E5=86=85=E5=AE=B9=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E8=8F=9C=E5=8D=95=E5=90=8E=E5=8F=98=E4=B8=BA=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E7=AC=AC=E4=B8=80=E4=B8=AA=E8=80=8C=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E4=B8=8A=E6=AC=A1=E9=80=89=E4=B8=AD=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/quickeditor/CellQuickEditor.java | 35 +++++-------------- .../fr/design/actions/core/ActionFactory.java | 15 ++++---- 2 files changed, 18 insertions(+), 32 deletions(-) diff --git a/designer/src/com/fr/quickeditor/CellQuickEditor.java b/designer/src/com/fr/quickeditor/CellQuickEditor.java index b2d66fc25c..9f8ab61d2f 100644 --- a/designer/src/com/fr/quickeditor/CellQuickEditor.java +++ b/designer/src/com/fr/quickeditor/CellQuickEditor.java @@ -2,6 +2,7 @@ package com.fr.quickeditor; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.core.ActionFactory; +import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.iscrollbar.UIScrollBar; @@ -11,6 +12,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.CellElementPropertyPane; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.ShortCut; import com.fr.design.selection.QuickEditor; @@ -20,8 +22,6 @@ import com.fr.report.cell.TemplateCellElement; import com.fr.stable.ColumnRow; import javax.swing.*; -import javax.swing.event.PopupMenuEvent; -import javax.swing.event.PopupMenuListener; import java.awt.*; import java.awt.event.*; import java.util.ArrayList; @@ -119,10 +119,10 @@ public abstract class CellQuickEditor extends QuickEditor { cellLabel.setPreferredSize(new Dimension(60, 20)); UILabel insertContentLabel = new UILabel(Inter.getLocText("HF-Insert_Content")); insertContentLabel.setPreferredSize(new Dimension(60, 20)); - UIComboBox cellElementEditButton = initCellElementEditComboBox(); + UIComboBox cellElementEditComboBox = initCellElementEditComboBox(); Component[][] components = new Component[][]{ new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()}, - new Component[]{insertContentLabel, cellElementEditButton}, + new Component[]{insertContentLabel, cellElementEditComboBox}, }; JPanel topContent = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); topContent.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 0)); @@ -136,6 +136,10 @@ public abstract class CellQuickEditor extends QuickEditor { * @return UIButton */ private UIComboBox initCellElementEditComboBox() { + JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + if (jTemplate == null) { + return comboBox = new UIComboBox(); + } final String[] items = getDefaultComboBoxItems(); comboBox = new UIComboBox(items); final Object comboBoxSelected = getComboBoxSelected(); @@ -144,31 +148,10 @@ public abstract class CellQuickEditor extends QuickEditor { } else { comboBox.setSelectedIndex(1); } - comboBox.addPopupMenuListener(new PopupMenuListener() { - @Override - public void popupMenuWillBecomeVisible(PopupMenuEvent e) { - if (cellInsertActions == null) { - cellInsertActions = ActionFactory.createCellInsertAction(ElementCasePane.class, tc); - } - // 这边重新获取是因为要根据JTemplate做一个过滤 - ArrayList arrayList = new ArrayList(); - for (UpdateAction action : cellInsertActions) { - arrayList.add(action.getMenuKeySet().getMenuKeySetName()); - } - comboBox.setModel(new DefaultComboBoxModel<>(arrayList.toArray(new String[arrayList.size()]))); - } - - @Override - public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { - } - - @Override - public void popupMenuCanceled(PopupMenuEvent e) { - } - }); comboBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { + cellInsertActions = ActionFactory.createCellInsertAction(ElementCasePane.class, tc); selectedIndex = comboBox.getSelectedIndex(); cellInsertActions[selectedIndex].actionPerformed(e); } diff --git a/designer_base/src/com/fr/design/actions/core/ActionFactory.java b/designer_base/src/com/fr/design/actions/core/ActionFactory.java index 01c0708992..a8d9585337 100644 --- a/designer_base/src/com/fr/design/actions/core/ActionFactory.java +++ b/designer_base/src/com/fr/design/actions/core/ActionFactory.java @@ -73,6 +73,7 @@ public class ActionFactory { /** * 注册图表的 地图资源 + * * @param action 地图资源action */ public static void registerChartMapEditorAction(UpdateAction action) { @@ -229,16 +230,18 @@ public class ActionFactory { public static MenuKeySet[] createCellInsertActionName() { List actionNames = new ArrayList<>(); + JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); for (Class clazz : actionClasses) { if (clazz == null) { continue; } - try { - Constructor c = (Constructor) clazz.getConstructor(); - actionNames.add(c.newInstance().getMenuKeySet()); - - } catch (Exception e) { - FRContext.getLogger().error(e.getMessage(), e); + if (jTemplate.acceptToolbarItem(clazz)) { + try { + Constructor c = (Constructor) clazz.getConstructor(); + actionNames.add(c.newInstance().getMenuKeySet()); + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage(), e); + } } } return actionNames.toArray(new MenuKeySet[actionNames.size()]); From 6dd864e1811390f79adb179dc3861ca0765af6d0 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 24 Aug 2017 14:40:16 +0800 Subject: [PATCH 18/30] SonarQube --- .../fr/design/mainframe/MobileParaWidgetTable.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java index 2c6c063726..940c2df58d 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java @@ -50,14 +50,9 @@ class MobileParaWidgetTable extends JTable { private void init(FormDesigner designer) { this.designer = designer; this.cellData = getData(); - } - - MobileParaWidgetTable(FormDesigner designer) { - init(designer); this.setTableProperties(); this.setDefaultEditor(Object.class, new MobileCellEditor()); - TableModel defaultModel = new BeanTableModel(); - this.setModel(defaultModel); + this.setModel(new BeanTableModel()); this.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); TableColumn tc = this.getColumn(this.getColumnName(0)); tc.setMinWidth(UITEXTFIELD_WIDTH); @@ -68,6 +63,10 @@ class MobileParaWidgetTable extends JTable { refreshData(); this.addMouseListener(mouseAdapter); this.addMouseMotionListener(mouseAdapter); + } + + MobileParaWidgetTable(FormDesigner designer) { + init(designer); add(moveComponent); } From 4ac4dcb2524b15cf05af157797893ffb9aeb0616 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 24 Aug 2017 15:05:12 +0800 Subject: [PATCH 19/30] =?UTF-8?q?REPORT-3952=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E6=8F=92=E5=85=A5=E6=82=AC=E6=B5=AE?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E9=80=89=E6=8B=A9=E6=8F=92=E5=85=A5=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E7=82=B9=E5=87=BB=E5=8F=96=E6=B6=88=E6=97=B6=E4=BC=9A?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E4=BF=9D=E5=AD=98=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/insert/flot/ChartFloatAction.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java b/designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java index 80b731c1a1..ce05628da4 100644 --- a/designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java +++ b/designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java @@ -30,6 +30,8 @@ import java.awt.*; */ public class ChartFloatAction extends ElementCaseAction { + private boolean isRecordNeeded; + /** * 构造函数 图表插入悬浮元素 */ @@ -64,9 +66,10 @@ public class ChartFloatAction extends ElementCaseAction { * @return 是则返回true */ public boolean executeActionReturnUndoRecordNeeded() { + isRecordNeeded = false; final ElementCasePane reportPane = (ElementCasePane) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane(); if (reportPane == null) { - return false; + return isRecordNeeded; } reportPane.stopEditing(); @@ -78,7 +81,7 @@ public class ChartFloatAction extends ElementCaseAction { chartDialog.addDialogActionListener(new DialogActionAdapter() { @Override public void doOk() { - + isRecordNeeded = true; FloatElement newFloatElement; try { newFloatElement = new FloatElement(chartDialog.getChartCollection().clone()); @@ -101,6 +104,6 @@ public class ChartFloatAction extends ElementCaseAction { }); chartDialog.setVisible(true); - return true; + return isRecordNeeded; } } \ No newline at end of file From 800fb273b11bb8cd27f6221ea89458fc2b1ee27c Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 24 Aug 2017 15:10:33 +0800 Subject: [PATCH 20/30] =?UTF-8?q?bugfix:=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E6=8F=92=E5=85=A5=E5=86=85=E5=AE=B9=EF=BC=8C?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E6=A1=86=E5=8F=96=E6=B6=88=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=E5=9B=9E=E5=88=B0=E5=8E=9F=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/quickeditor/CellQuickEditor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer/src/com/fr/quickeditor/CellQuickEditor.java b/designer/src/com/fr/quickeditor/CellQuickEditor.java index 9f8ab61d2f..6f0530a70f 100644 --- a/designer/src/com/fr/quickeditor/CellQuickEditor.java +++ b/designer/src/com/fr/quickeditor/CellQuickEditor.java @@ -51,6 +51,8 @@ public abstract class CellQuickEditor extends QuickEditor { /*占位label*/ protected static UILabel emptyLabel = new UILabel(); + private int currentSelectedIndex; + static { emptyLabel.setPreferredSize(new Dimension(60, 20)); } @@ -148,12 +150,14 @@ public abstract class CellQuickEditor extends QuickEditor { } else { comboBox.setSelectedIndex(1); } + currentSelectedIndex = comboBox.getSelectedIndex(); comboBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cellInsertActions = ActionFactory.createCellInsertAction(ElementCasePane.class, tc); selectedIndex = comboBox.getSelectedIndex(); cellInsertActions[selectedIndex].actionPerformed(e); + comboBox.setSelectedIndex(currentSelectedIndex); } }); return comboBox; From e60a2c81c6878119109baad0911f5e04e9f4c75a Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 24 Aug 2017 15:50:08 +0800 Subject: [PATCH 21/30] =?UTF-8?q?REPORT-2897=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=BF=AE=E6=94=B9=20->=E4=BF=AE=E6=94=B9=E7=BC=A9?= =?UTF-8?q?=E6=94=BE=E6=9D=A1=E6=8C=89=E9=92=AE=E4=BA=A4=E4=BA=92=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=A9=E5=B1=95=E6=8E=A7=E4=BB=B6=E4=B9=8B?= =?UTF-8?q?=E9=97=B4=E7=9A=84=E9=97=B4=E8=B7=9D=20REPORT-3986=20[9.0?= =?UTF-8?q?=E4=B8=80=E8=BD=AE=E5=9B=9E=E5=BD=92]=E5=B0=86=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E5=AE=BD=E5=BA=A6=E8=B0=83=E6=95=B4=E5=88=B0?= =?UTF-8?q?=E5=B1=8F=E5=B9=95=E4=B8=80=E5=8D=8A=E5=90=8E=E8=BF=9E=E7=BB=AD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A010=E4=B8=AAsheet=EF=BC=8C=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=9C=80=E5=A4=A7=E5=8C=96=E5=90=8E=E7=BC=A9=E6=94=BE?= =?UTF-8?q?=E6=BB=91=E5=9D=97=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/ReportComponentComposite.java | 11 +- .../cell/settingpane/CellExpandAttrPane.java | 6 +- .../form/FormReportComponentComposite.java | 7 +- .../fr/design/gui/ibutton/UISliderButton.java | 375 ++++++++++++++++++ .../design/gui/ibutton/UISliderButtonUI.java | 227 +++++++++++ .../com/fr/design/gui/style/FormatPane.java | 6 +- .../fr/design/mainframe/JFormSliderPane.java | 29 +- .../com/fr/design/mainframe/JSliderPane.java | 30 +- .../design/present/dict/FormulaDictPane.java | 18 +- 9 files changed, 657 insertions(+), 52 deletions(-) create mode 100644 designer_base/src/com/fr/design/gui/ibutton/UISliderButton.java create mode 100644 designer_base/src/com/fr/design/gui/ibutton/UISliderButtonUI.java diff --git a/designer/src/com/fr/design/mainframe/ReportComponentComposite.java b/designer/src/com/fr/design/mainframe/ReportComponentComposite.java index 09b03c1837..41154d75b3 100644 --- a/designer/src/com/fr/design/mainframe/ReportComponentComposite.java +++ b/designer/src/com/fr/design/mainframe/ReportComponentComposite.java @@ -204,19 +204,14 @@ public class ReportComponentComposite extends JComponent { } private JComponent createSouthControlPane() { -// hbarContainer = FRGUIPaneFactory.createBorderLayout_S_Pane(); -// hbarContainer.add(createSouthControlPaneWithJSliderPane()); hbarContainer = FRGUIPaneFactory.createBorderLayout_S_Pane(); hbarContainer.add(centerCardPane.editingComponet.getHorizontalScrollBar()); -// JSplitPane splitpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sheetNameTab, hbarContainer); JPanel southPane = new JPanel(new BorderLayout()); jSliderContainer = JSliderPane.getInstance(); - JSplitPane splitpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sheetNameTab, jSliderContainer); - splitpane.setBorder(null); - splitpane.setDividerSize(3); - splitpane.setResizeWeight(1); + southPane.add(hbarContainer, BorderLayout.NORTH); - southPane.add(splitpane, BorderLayout.CENTER); + southPane.add(sheetNameTab, BorderLayout.CENTER); + southPane.add(jSliderContainer, BorderLayout.EAST); return southPane; } diff --git a/designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java b/designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java index c7e6c93e09..4eedd4f7c5 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java +++ b/designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java @@ -85,8 +85,8 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; UILabel direction = new UILabel(Inter.getLocText("FR-Designer_ExpandD_Expand_Direction"), SwingConstants.LEFT); -// JPanel directionPane = new JPanel(new BorderLayout()); -// directionPane.add(direction, BorderLayout.NORTH); + JPanel directionPane = new JPanel(new BorderLayout()); + directionPane.add(direction, BorderLayout.NORTH); UILabel left = new UILabel(Inter.getLocText("FR-Designer_LeftParent"), SwingConstants.LEFT); JPanel leftPane = new JPanel(new BorderLayout()); leftPane.add(left, BorderLayout.NORTH); @@ -95,7 +95,7 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { upPane.add(up, BorderLayout.NORTH); Component[][] components = new Component[][]{ new Component[]{null, null}, - new Component[]{direction, expandDirectionButton}, + new Component[]{directionPane, expandDirectionButton}, new Component[]{leftPane, leftFatherPane}, new Component[]{upPane, rightFatherPane}, }; diff --git a/designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java b/designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java index a79f64af4e..f060130f41 100644 --- a/designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java +++ b/designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java @@ -169,12 +169,9 @@ public class FormReportComponentComposite extends JComponent implements TargetMo hbarContainer.add(elementCaseDesigner.getHorizontalScrollBar()); jSliderContainer = JSliderPane.getInstance(); - JSplitPane splitpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sheetNameTab, jSliderContainer); southPane.add(hbarContainer, BorderLayout.NORTH); - southPane.add(splitpane, BorderLayout.CENTER); - splitpane.setBorder(null); - splitpane.setDividerSize(3); - splitpane.setResizeWeight(1); + southPane.add(sheetNameTab, BorderLayout.CENTER); + southPane.add(jSliderContainer, BorderLayout.EAST); return southPane; } diff --git a/designer_base/src/com/fr/design/gui/ibutton/UISliderButton.java b/designer_base/src/com/fr/design/gui/ibutton/UISliderButton.java new file mode 100644 index 0000000000..13376521ea --- /dev/null +++ b/designer_base/src/com/fr/design/gui/ibutton/UISliderButton.java @@ -0,0 +1,375 @@ +package com.fr.design.gui.ibutton; + +import com.fr.base.BaseUtils; +import com.fr.base.CellBorderStyle; +import com.fr.base.GraphHelper; +import com.fr.design.constants.UIConstants; +import com.fr.design.event.UIObserver; +import com.fr.design.event.UIObserverListener; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.stable.Constants; +import com.fr.stable.StringUtils; + +import javax.swing.*; +import javax.swing.plaf.ButtonUI; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; +import java.awt.geom.RoundRectangle2D; + +public class UISliderButton extends JButton implements UIObserver { + + public static final int OTHER_BORDER = 1; + public static final int NORMAL_BORDER = 2; + private static final int HEIGH = 20; + private static final int TOOLTIP_Y = 30; + private boolean isExtraPainted = true; + private boolean isRoundBorder = true; + private int rectDirection = Constants.NULL; + private Stroke borderStroke = UIConstants.BS; + private Color borderColor = UIConstants.LINE_COLOR; + + private boolean isPressedPainted = true; + private boolean isNormalPainted = true; + protected boolean isBorderPaintedOnlyWhenPressed = false; + + private int borderType = NORMAL_BORDER; + private CellBorderStyle border = null; + + protected UIObserverListener uiObserverListener; + + public UISliderButton() { + this(StringUtils.EMPTY); + } + + public UISliderButton(String string) { + super(string); + init(); + } + + + public UISliderButton(Icon icon) { + super(icon); + init(); + } + + public UISliderButton(Action action) { + super(action); + init(); + } + + public UISliderButton(String text, Icon icon) { + super(text, icon); + init(); + } + + /** + * 是否进行过权限编辑 + * + * @param role 角色 + * @return 否 + */ + public boolean isDoneAuthorityEdited(String role) { + return false; + } + + public UISliderButton(Icon normal, Icon rollOver, Icon pressed) { + super(normal); + setBorderPainted(false); + setRolloverIcon(rollOver); + setPressedIcon(pressed); + setExtraPainted(false); + setBackground(null); + setOpaque(false); + initListener(); + } + + protected void initListener() { + if (shouldResponseChangeListener()) { + this.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + if (uiObserverListener == null) { + return; + } + uiObserverListener.doChange(); + } + }); + } + } + + + //确定是正常的边框类型,还是其他的Border类型 + //若是其他的border类型,则要setOtherType,即设置线型颜色等。若是其他类型,但是没有设置,则默认的是虚线型边框 + public void setBorderType(int borderType) { + this.borderType = borderType; + } + + + public void setBorderStyle(CellBorderStyle border) { + this.border = border; + } + + public void set4ToolbarButton() { + setNormalPainted(false); + Dimension dim = getPreferredSize(); + dim.height = HEIGH; + setBackground(null); + setOpaque(false); + setSize(dim); + setBorderPaintedOnlyWhenPressed(true); + } + + public void set4LargeToolbarButton() { + setNormalPainted(false); + setBackground(null); + setOpaque(false); + setSize(new Dimension(40, 40)); + setBorderPaintedOnlyWhenPressed(true); + } + + public void set4ChartLargeToolButton() { + setNormalPainted(false); + setBackground(null); + setOpaque(false); + setSize(new Dimension(34, 44)); + setBorderPaintedOnlyWhenPressed(true); + } + + + private void init() { + setOpaque(false); + setBackground(null); + setRolloverEnabled(true); + initListener(); + } + + @Override + public ButtonUI getUI() { + return new UISliderButtonUI(); + } + + /** + * 更新界面 + */ + public void updateUI() { + setUI(getUI()); + } + + public CellBorderStyle getBorderStyle() { + return this.border; + } + + @Override + public Insets getInsets() { + if (getIcon() != null) { + return new Insets(0, 3, 0, 3); + } + return new Insets(0, 0, 0, 0); + } + + //@Override + public Dimension getPreferredSize() { + return new Dimension(super.getPreferredSize().width, 20); + } + + + public int getBorderType() { + return borderType; + } + + public void setOtherBorder(Stroke s, Color c) { + borderStroke = s; + borderColor = c; + } + + + @Override + protected void paintBorder(Graphics g) { + + if (!isBorderPainted()) { + return; + } + if (borderType == OTHER_BORDER) { + paintOtherBorder(g); + } else { + boolean isPress = (isBorderPaintedOnlyWhenPressed && getModel().isPressed()); + if (isPress || !isBorderPaintedOnlyWhenPressed) { + if (ui instanceof UISliderButtonUI) { + ((UISliderButtonUI) ui).paintBorder(g, this); + + } else { + super.paintBorder(g); + + } + } + } + } + + @Override + public void paintComponent(Graphics g) { + super.paintComponent(g); + Dimension size = this.getSize(); + Graphics2D g2d = (Graphics2D) g; + Stroke oldStroke = g2d.getStroke(); + if (border != null) { + g2d.setColor(border.getTopColor()); + GraphHelper.drawLine(g2d, 3, 4, size.getWidth() - 4, 4, border.getTopStyle()); + g2d.setColor(border.getLeftColor()); + GraphHelper.drawLine(g2d, 3, 4, 3, size.getHeight() - 4, border.getLeftStyle()); + g2d.setColor(border.getBottomColor()); + GraphHelper.drawLine(g2d, 3, size.getHeight() - 4, size.getWidth() - 4, size.getHeight() - 4, border.getBottomStyle()); + g2d.setColor(border.getRightColor()); + GraphHelper.drawLine(g2d, size.getWidth() - 4, 4, size.getWidth() - 4, size.getHeight() - 4, border.getRightStyle()); + } else { + GraphHelper.drawLine(g2d, 2, 4, size.getWidth() - 4, 4, Constants.LINE_NONE); + GraphHelper.drawLine(g2d, 2, 4, 2, size.getHeight() - 4, Constants.LINE_NONE); + GraphHelper.drawLine(g2d, 2, size.getHeight() - 4, size.getWidth() - 4, size.getHeight() - 4, Constants.LINE_NONE); + GraphHelper.drawLine(g2d, size.getWidth() - 4, 4, size.getWidth() - 4, size.getHeight() - 4, Constants.LINE_NONE); + } + g2d.setStroke(oldStroke); + } + + + protected void paintOtherBorder(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + g2d.setStroke(borderStroke); + Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1, getHeight() - 1, UIConstants.ARC, UIConstants.ARC); + g2d.setColor(borderColor); + g2d.draw(shape); + } + + public void setExtraPainted(boolean extra) { + this.isExtraPainted = extra; + } + + /** + * 是否额外画 + * + * @return 是则返回TRUE + */ + public boolean isExtraPainted() { + return this.isExtraPainted; + } + + /** + * @return + */ + public int getRectDirection() { + return rectDirection; + } + + /** + * 是否圆边框 + * + * @return 是则返回true + */ + public boolean isRoundBorder() { + return isRoundBorder; + } + + /** + * @param isRoundBorder + */ + public void setRoundBorder(boolean isRoundBorder) { + setRoundBorder(isRoundBorder, Constants.NULL); + } + + /** + * @param isRound + * @param rectDirection + */ + public void setRoundBorder(boolean isRound, int rectDirection) { + this.isRoundBorder = isRound; + this.rectDirection = rectDirection; + } + + /** + * 是否按压画 + * + * @return 是则返回TRUE + */ + public boolean isPressedPainted() { + return isPressedPainted; + } + + /** + * @param isPressedPainted + */ + public void setPressedPainted(boolean isPressedPainted) { + this.isPressedPainted = isPressedPainted; + } + + /** + * 是否正常画 + * + * @return 是则返回TRUE + */ + public boolean isNormalPainted() { + return isNormalPainted; + } + + /** + * @param isNormalPressed + */ + public void setNormalPainted(boolean isNormalPressed) { + this.isNormalPainted = isNormalPressed; + if (!isNormalPressed) { + setBackground(null); + setOpaque(false); + } + } + + /** + * @param value + */ + public void setBorderPaintedOnlyWhenPressed(boolean value) { + this.isBorderPaintedOnlyWhenPressed = value; + } + + @Override + public Point getToolTipLocation(MouseEvent event) { + return new Point(event.getX(), event.getY() - TOOLTIP_Y); + } + + /** + * 主函数 + * + * @param args 入口参数 + */ + public static void main(String... args) { + JFrame jf = new JFrame("test"); + jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + JPanel content = (JPanel) jf.getContentPane(); + content.setLayout(null); + + UISliderButton bb = new UISliderButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png")); + bb.setEnabled(false); + bb.setBorderType(OTHER_BORDER); + // bb.setBounds(20, 20,content.getSize().width, bb.getPreferredSize().height); + bb.setPreferredSize(new Dimension(100, 30)); + bb.setBounds(0, 0, bb.getPreferredSize().width, bb.getPreferredSize().height); + content.add(bb); + GUICoreUtils.centerWindow(jf); + jf.setSize(400, 400); + jf.setVisible(true); + } + + /** + * 给组件登记一个观察者监听事件 + * + * @param listener 观察者监听事件 + */ + public void registerChangeListener(UIObserverListener listener) { + this.uiObserverListener = listener; + } + + /** + * 组件是否需要响应添加的观察者事件 + * + * @return 如果需要响应观察者事件则返回true,否则返回false + */ + public boolean shouldResponseChangeListener() { + return true; + } +} \ No newline at end of file diff --git a/designer_base/src/com/fr/design/gui/ibutton/UISliderButtonUI.java b/designer_base/src/com/fr/design/gui/ibutton/UISliderButtonUI.java new file mode 100644 index 0000000000..be6f570aca --- /dev/null +++ b/designer_base/src/com/fr/design/gui/ibutton/UISliderButtonUI.java @@ -0,0 +1,227 @@ +package com.fr.design.gui.ibutton; + +import java.awt.*; +import java.awt.geom.RoundRectangle2D; + +import javax.swing.AbstractButton; +import javax.swing.ButtonModel; +import javax.swing.Icon; +import javax.swing.JComponent; +import javax.swing.SwingUtilities; +import javax.swing.plaf.basic.BasicButtonUI; +import javax.swing.plaf.basic.BasicHTML; +import javax.swing.text.View; + +import com.fr.base.BaseUtils; +import com.fr.design.constants.UIConstants; +import com.fr.design.roleAuthority.ReportAndFSManagePane; +import com.fr.stable.Constants; +import sun.swing.SwingUtilities2; + +import com.fr.stable.StringUtils; +import com.fr.design.utils.gui.GUIPaintUtils; + +import static com.fr.design.utils.gui.GUIPaintUtils.fillPaint; + +public class UISliderButtonUI extends BasicButtonUI { + + private Rectangle viewRec = new Rectangle(); + private Rectangle textRec = new Rectangle(); + private Rectangle iconRec = new Rectangle(); + + @Override + public void paint(Graphics g, JComponent c) { + UISliderButton b = (UISliderButton) c; + Graphics2D g2d = (Graphics2D) g; + int w = b.getWidth(); + int h = b.getHeight(); + + String text = initRecAndGetText(b, SwingUtilities2.getFontMetrics(b, g), b.getWidth(), b.getHeight()); + String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); + clearTextShiftOffset(); + + ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + if (b.isExtraPainted()) { + if (isPressed(b) && b.isPressedPainted()) { + fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles)); + } else if (isRollOver(b)) { + fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted()); + } else if (b.isNormalPainted()) { + fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted()); + } + } + ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); + + paintContent(g, b, text); + } + + protected boolean isRollOver(AbstractButton b) { + ButtonModel model = b.getModel(); + return model.isRollover() && !b.isSelected(); + } + + protected boolean isPressed(AbstractButton b) { + ButtonModel model = b.getModel(); + return (model.isArmed() && model.isPressed()) || b.isSelected(); + } + + private void paintContent(Graphics g, AbstractButton b, String text) { + if (b.getIcon() != null) { + paintIcon(g, b); + } + if (!StringUtils.isEmpty(text)) { + paintText(g, b, text); + } + } + + private void paintText(Graphics g, AbstractButton b, String text) { + View v = (View) b.getClientProperty(BasicHTML.propertyKey); + if (v != null) { + v.paint(g, textRec); + return; + } + FontMetrics fm = SwingUtilities2.getFontMetrics(b, g); + int mnemonicIndex = b.getDisplayedMnemonicIndex(); + if (b.isEnabled()) { + g.setColor(UIConstants.FONT_COLOR); + } else { + g.setColor(UIConstants.LINE_COLOR); + } + + SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemonicIndex, textRec.x + getTextShiftOffset(), textRec.y + fm.getAscent() + getTextShiftOffset()); + } + + private String initRecAndGetText(AbstractButton b, FontMetrics fm, int width, int height) { + Insets i = b.getInsets(); + viewRec.x = i.left; + viewRec.y = i.top; + viewRec.width = width - (i.right + viewRec.x); + viewRec.height = height - (i.bottom + viewRec.y); + textRec.x = textRec.y = textRec.width = textRec.height = 0; + iconRec.x = iconRec.y = iconRec.width = iconRec.height = 0; + // layout the text and icon + return SwingUtilities.layoutCompoundLabel( + b, fm, b.getText(), b.getIcon(), + b.getVerticalAlignment(), b.getHorizontalAlignment(), + b.getVerticalTextPosition(), b.getHorizontalTextPosition(), + viewRec, iconRec, textRec, + b.getText() == null ? 0 : b.getIconTextGap()); + } + + protected void paintBorder(Graphics g, UISliderButton b) { + String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); + GUIPaintUtils.drawBorder((Graphics2D) g, 0, 0, b.getWidth(), b.getHeight(), b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles)); + + } + + protected void paintIcon(Graphics g, JComponent c) { + AbstractButton b = (AbstractButton) c; + ButtonModel model = b.getModel(); + Icon icon = b.getIcon(); + Icon tmpIcon = null; + if (icon == null) { + return; + } + Icon selectedIcon = null; + /* the fallback icon should be based on the selected state */ + if (model.isSelected()) { + selectedIcon = (Icon) b.getSelectedIcon(); + if (selectedIcon != null) { + icon = selectedIcon; + } + } + if (!model.isEnabled()) { + if (model.isSelected()) { + tmpIcon = (Icon) b.getDisabledSelectedIcon(); + if (tmpIcon == null) { + tmpIcon = selectedIcon; + } + } + if (tmpIcon == null) { + tmpIcon = (Icon) b.getDisabledIcon(); + } + } else if (model.isPressed() && model.isArmed()) { + tmpIcon = (Icon) b.getPressedIcon(); + if (tmpIcon != null) { + // revert back to 0 offset + clearTextShiftOffset(); + } + } else if (b.isRolloverEnabled() && model.isRollover()) { + if (model.isSelected()) { + tmpIcon = (Icon) b.getRolloverSelectedIcon(); + if (tmpIcon == null) { + tmpIcon = selectedIcon; + } + } + if (tmpIcon == null) { + tmpIcon = (Icon) b.getRolloverIcon(); + } + } + if (tmpIcon != null) { + icon = tmpIcon; + } + paintModelIcon(model, icon, g, c); + } + + private void paintModelIcon(ButtonModel model, Icon icon, Graphics g, JComponent c) { + if (model.isPressed() && model.isArmed()) { + icon.paintIcon(c, g, iconRec.x + getTextShiftOffset(), + iconRec.y + getTextShiftOffset()); + } else { + icon.paintIcon(c, g, iconRec.x, iconRec.y); + } + } + + private void fillNormal(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) { + GradientPaint gp; + if (BaseUtils.isAuthorityEditing() && isAuthorityEdited) { + gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1, UIConstants.AUTHORITY_DARK_BLUE); + } else if (isPressedPainted) { + gp = new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, height - 1, UIConstants.SELECT_TAB); + }else{ + gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1, UIConstants.POP_DIALOG_BORDER); + } + + fillPaint(g2d, x, y, width, height, isRound, rectDirection, gp, UIConstants.ARC); + } + + private void fillRollOver(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) { + GradientPaint gp; + if (BaseUtils.isAuthorityEditing() && isAuthorityEdited) { + gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1, UIConstants.HOVER_BLUE); + } else if (isPressedPainted) { + gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1, UIConstants.POP_DIALOG_BORDER); + }else { + gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1, UIConstants.POP_DIALOG_BORDER); + } + fillPaint(g2d, x, y, width, height, isRound, rectDirection, gp, UIConstants.ARC); + } + + private void fillPressed(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited) { + Color oldColor = g2d.getColor(); + if (BaseUtils.isAuthorityEditing() && isAuthorityEdited) { + g2d.setColor(UIConstants.AUTHORITY_PRESS_BLUE); + } else { + g2d.setColor(UIConstants.POP_DIALOG_BORDER); + } + Shape oldClip = g2d.getClip(); + if (isRound) { + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2d.clip(new RoundRectangle2D.Double(x, y, width, height, UIConstants.ARC, UIConstants.ARC)); + g2d.fillRoundRect(x, y, width, height, UIConstants.ARC, UIConstants.ARC); + g2d.setClip(oldClip); + if (rectDirection == Constants.RIGHT) { + g2d.fillRect(width - 2, y, x + 2, height); + } else if (rectDirection == Constants.LEFT) { + g2d.fillRect(x, y, x + 2, height); + } + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); + } else { + g2d.clip(new Rectangle(x, y, width, height)); + g2d.fillRect(0, 0, width, height); + g2d.setClip(oldClip); + } + + g2d.setColor(oldColor); + } +} \ No newline at end of file diff --git a/designer_base/src/com/fr/design/gui/style/FormatPane.java b/designer_base/src/com/fr/design/gui/style/FormatPane.java index 23b6e213f9..58efc7f1ee 100644 --- a/designer_base/src/com/fr/design/gui/style/FormatPane.java +++ b/designer_base/src/com/fr/design/gui/style/FormatPane.java @@ -109,7 +109,7 @@ public class FormatPane extends AbstractBasicStylePane { JPanel typePane = new JPanel(new BorderLayout()); typePane.add(typeComboBox, BorderLayout.CENTER); typePane.setBorder(LEFT_BORDER); - centerPane.setBorder(LEFT_BORDER); +// centerPane.setBorder(LEFT_BORDER); frFontPane.setBorder(LEFT_BORDER); Component[][] components = getComponent(fontPane, centerPane, typePane); @@ -125,7 +125,7 @@ public class FormatPane extends AbstractBasicStylePane { return new Component[][]{ new Component[]{null, null}, new Component[]{new UILabel(Inter.getLocText("FR-Base_Format"), SwingConstants.LEFT), typePane}, - new Component[]{null, centerPane}, + new Component[]{centerPane, null}, new Component[]{fontPane, frFontPane}, }; } @@ -248,7 +248,7 @@ public class FormatPane extends AbstractBasicStylePane { this.typeComboBox.setSelectedItem(formatStyle); int i = isArrayContainPattern(FormatField.getInstance().getFormatArray(formatStyle), pattern); if (i == -1) { - this.textField.setSelectedIndex(0); + this.textField.setSelectedItem(pattern); } else { this.textField.setSelectedIndex(i); } diff --git a/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java b/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java index c796baa6ce..347bed6859 100644 --- a/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIRadioButton; +import com.fr.design.gui.ibutton.UISliderButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.islider.UISlider; import com.fr.design.gui.ispinner.UIBasicSpinner; @@ -46,7 +47,7 @@ public class JFormSliderPane extends JPanel { private static final int SHOWVALBUTTON_WIDTH = 40; private static final int SHOWVALBUTTON_HEIGHTH = 20; private static final int SLIDER_GAP = 5; - private static final int TOOLTIP_Y = 25; + private static final int TOOLTIP_Y = 30; private static final Color BACK_COLOR = new Color(245, 245, 247); public int showValue = 100; public double resolutionTimes = 1.0; @@ -58,7 +59,7 @@ public class JFormSliderPane extends JPanel { private int sliderValue; private UIButton downButton; private UIButton upButton; - private JButton showValButton; + private UISliderButton showValButton; private UIRadioButton twoHundredButton; private UIRadioButton oneHundredButton; private UIRadioButton SevenFiveButton; @@ -156,14 +157,7 @@ public class JFormSliderPane extends JPanel { } private void initShowValButton() { - showValButton = new JButton(showValSpinner.getValue() + "%"){ - public Point getToolTipLocation(MouseEvent event){ - return new Point(event.getX(), event.getY() - TOOLTIP_Y); - } - }; - showValButton.setOpaque(false); - showValButton.setMargin(new Insets(0, 0, 0, 0)); - showValButton.setFont(new Font("SimSun", Font.PLAIN, 12)); + showValButton = new UISliderButton(showValSpinner.getValue() + "%"); showValButton.setBackground(BACK_COLOR); showValButton.setBorderPainted(false); showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH)); @@ -185,8 +179,17 @@ public class JFormSliderPane extends JPanel { SevenFiveButton.addItemListener(radioButtonItemListener); fiveTenButton.addItemListener(radioButtonItemListener); twoFiveButton.addItemListener(radioButtonItemListener); - //TODO -// selfAdaptButton.addItemListener(); + customButton.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + JRadioButton temp = (JRadioButton) e.getSource(); + if (temp.isSelected()) { + JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField(); + textField.requestFocus(); + textField.selectAll(); + } + } + }); ButtonGroup bg = new ButtonGroup();// 初始化按钮组 bg.add(twoHundredButton);// 加入按钮组 @@ -267,6 +270,8 @@ public class JFormSliderPane extends JPanel { } refreshSlider(val); refreshBottun(val); + JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField(); + textField.setCaretPosition(showValSpinner.getValue().toString().length()); } }; diff --git a/designer_base/src/com/fr/design/mainframe/JSliderPane.java b/designer_base/src/com/fr/design/mainframe/JSliderPane.java index 006a38ce40..dd0e0f7d9e 100644 --- a/designer_base/src/com/fr/design/mainframe/JSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JSliderPane.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIRadioButton; +import com.fr.design.gui.ibutton.UISliderButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.islider.UISlider; import com.fr.design.gui.ispinner.UIBasicSpinner; @@ -17,6 +18,7 @@ import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.plaf.basic.BasicSliderUI; +import javax.swing.text.BadLocationException; import javax.swing.text.DefaultFormatterFactory; import javax.swing.text.NumberFormatter; import java.awt.*; @@ -47,7 +49,7 @@ public class JSliderPane extends JPanel { private static final int SHOWVALBUTTON_WIDTH = 40; private static final int SHOWVALBUTTON_HEIGHTH = 20; private static final int SLIDER_GAP = 5; - private static final int TOOLTIP_Y = 25; + private static final int TOOLTIP_Y = 30; private static final Color BACK_COLOR = new Color(245, 245, 247); public int showValue = 100; @@ -60,7 +62,7 @@ public class JSliderPane extends JPanel { private int sliderValue; private UIButton downButton; private UIButton upButton; - private JButton showValButton; + private UISliderButton showValButton; private UIRadioButton twoHundredButton; private UIRadioButton oneHundredButton; private UIRadioButton SevenFiveButton; @@ -159,14 +161,7 @@ public class JSliderPane extends JPanel { } private void initShowValButton() { - showValButton = new JButton(showValSpinner.getValue() + "%") { - public Point getToolTipLocation(MouseEvent event) { - return new Point(event.getX(), event.getY() - TOOLTIP_Y); - } - }; - showValButton.setOpaque(false); - showValButton.setMargin(new Insets(0, 0, 0, 0)); - showValButton.setFont(new Font("SimSun", Font.PLAIN, 12)); + showValButton = new UISliderButton(showValSpinner.getValue() + "%"); showValButton.setBackground(BACK_COLOR); showValButton.setBorderPainted(false); showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH)); @@ -189,8 +184,17 @@ public class JSliderPane extends JPanel { SevenFiveButton.addItemListener(radioButtonItemListener); fiveTenButton.addItemListener(radioButtonItemListener); twoFiveButton.addItemListener(radioButtonItemListener); - //TODO -// selfAdaptButton.addItemListener(); + customButton.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + JRadioButton temp = (JRadioButton) e.getSource(); + if (temp.isSelected()) { + JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField(); + textField.requestFocus(); + textField.selectAll(); + } + } + }); ButtonGroup bg = new ButtonGroup();// 初始化按钮组 bg.add(twoHundredButton);// 加入按钮组 @@ -272,6 +276,8 @@ public class JSliderPane extends JPanel { } refreshSlider(val); refreshBottun(val); + JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField(); + textField.setCaretPosition(showValSpinner.getValue().toString().length()); } }; diff --git a/designer_base/src/com/fr/design/present/dict/FormulaDictPane.java b/designer_base/src/com/fr/design/present/dict/FormulaDictPane.java index 3abd31dd8a..22d735ad86 100644 --- a/designer_base/src/com/fr/design/present/dict/FormulaDictPane.java +++ b/designer_base/src/com/fr/design/present/dict/FormulaDictPane.java @@ -29,14 +29,14 @@ public class FormulaDictPane extends FurtherBasicBeanPane { } public static void main(String[] args) { - JFrame jf = new JFrame("test"); - jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - JPanel content = (JPanel) jf.getContentPane(); - content.setLayout(new BorderLayout()); - content.add(new FormulaDictPane(), BorderLayout.NORTH); - GUICoreUtils.centerWindow(jf); - jf.setSize(250, 400); - jf.setVisible(true); +// JFrame jf = new JFrame("test"); +// jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); +// JPanel content = (JPanel) jf.getContentPane(); +// content.setLayout(new BorderLayout()); +// content.add(new FormulaDictPane(), BorderLayout.NORTH); +// GUICoreUtils.centerWindow(jf); +// jf.setSize(250, 400); +// jf.setVisible(true); } private void initComponents() { @@ -59,7 +59,7 @@ public class FormulaDictPane extends FurtherBasicBeanPane { int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; UILabel tag = new UILabel(Inter.getLocText("Formula_Dictionary_Display_Examples_Html")); - tag.setPreferredSize(new Dimension(225, 40)); + tag.setPreferredSize(new Dimension(225, 80)); JPanel t = new JPanel(new BorderLayout()); t.add(tag, BorderLayout.CENTER); From b4e4e6ea5f2453a2cbdc3a1d4e07f5b52632f8f6 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 24 Aug 2017 15:56:26 +0800 Subject: [PATCH 22/30] fix --- designer_base/src/com/fr/design/locale/designer.properties | 4 +++- .../src/com/fr/design/locale/designer_en_US.properties | 4 +++- .../src/com/fr/design/locale/designer_ja_JP.properties | 2 ++ .../src/com/fr/design/locale/designer_ko_KR.properties | 4 +++- .../src/com/fr/design/locale/designer_zh_CN.properties | 4 +++- .../src/com/fr/design/locale/designer_zh_TW.properties | 2 ++ .../src/com/fr/design/mainframe/MobileParaWidgetTable.java | 2 +- 7 files changed, 17 insertions(+), 5 deletions(-) diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 9423c23a74..c048d29c55 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -2129,4 +2129,6 @@ FR-Designer_Mobile-Height-Limit=Height Limit FR-Designer-AlphaFine_NO_Result=no search result FR-Designer-Download_Online_Sources= FR-Designer_Select_Color=Select Color -FR-Designer-Basic_Dynamic_Parameter_Injection=Injection \ No newline at end of file +FR-Designer-Basic_Dynamic_Parameter_Injection=Injection +FR-Designer_Label= +FR-Designer_Widgetname=Widget Name \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index bb48b927da..4a87f16203 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -2125,4 +2125,6 @@ FS-Designer_DS_Filter_Specify_Tip=Specify_Tip FR-Designer-AlphaFine_NO_Result=no search result FR-Designer-Download_Online_Sources= FR-Designer_Select_Color=Select Color -FR-Designer-Basic_Dynamic_Parameter_Injection=Injection \ No newline at end of file +FR-Designer-Basic_Dynamic_Parameter_Injection=Injection +FR-Designer_Label=Label +FR-Designer_Widgetname=Widget Name \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index 94768d0872..05783bc7be 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -2124,3 +2124,5 @@ FR-Designer_Mobile-Height-Limit= FR-Designer-Download_Online_Sources= FR-Designer_Select_Color= FR-Designer-Basic_Dynamic_Parameter_Injection=\ +FR-Designer_Label=\u30E9\u30D9\u30EBa +FR-Designer_Widgetname=\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB\u540D diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index c9cacdb7eb..6a660743d4 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -2124,4 +2124,6 @@ FR-Designer_Mobile-Height-Percent= FR-Designer_Mobile-Height-Limit= FR-Designer-Download_Online_Sources= FR-Designer_Select_Color= -FR-Designer-Basic_Dynamic_Parameter_Injection= \ No newline at end of file +FR-Designer-Basic_Dynamic_Parameter_Injection= +FR-Designer_Label=\uB808\uC774\uBE14 +FR-Designer_Widgetname=\uC18C\uD504\uD2B8\uC6E8\uC5B4\uC81C\uC5B4\uC774\uB984 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index d4cfbba9c0..e9b5933184 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -2136,4 +2136,6 @@ FS-Designer_DS_Filter_Specify_Tip=\u63D0\u793A\uFF1A\u683C\u5F0F\u4E3A1,2-3,5,8\ FR-Designer-AlphaFine_NO_Result=\u65E0\u641C\u7D22\u7ED3\u679C FR-Designer-Download_Online_Sources=\u56FE\u8868\u9700\u8981\u4E0B\u8F7D\u6700\u65B0\u7684\u8D44\u6E90\u6587\u4EF6\uFF0C\u662F\u5426\u5B89\u88C5\uFF1F FR-Designer_Select_Color=\u9009\u62E9\u989C\u8272 -FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165 \ No newline at end of file +FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165 +FR-Designer_Label=\u6807\u7B7E +FR-Designer_Widgetname=\u63A7\u4EF6\u540D \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index fe2839aee3..95c67c32af 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -2129,3 +2129,5 @@ FR-Designer-AlphaFine_NO_Result=\u7121\u641C\u7D22\u7D50\u679C FR-Designer-Download_Online_Sources= FR-Designer_Select_Color= FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165 +FR-Designer_Label=\u6A19\u7C3D +FR-Designer_Widgetname=\u63A7\u5236\u9805\u540D diff --git a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java index 940c2df58d..5788f22f41 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java @@ -38,7 +38,7 @@ class MobileParaWidgetTable extends JTable { private FormDesigner designer; private String[][] cellData; - private String[] headers = {Inter.getLocText("FR-Utils_Label"), Inter.getLocText("Form-Widget_Name")}; + private String[] headers = {Inter.getLocText("FR-Designer_Label"), Inter.getLocText("FR-Designer_Widgetname")}; private static final int WIDGET_TABLE_ROW_HEIGHT = 22; private static final int UITEXTFIELD_WIDTH = 0; private static final int GAP = 11; From 1cc5c6903eb3758e4aa86afece73ebfd2989e6a7 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 24 Aug 2017 15:57:11 +0800 Subject: [PATCH 23/30] fix --- .../src/com/fr/design/mainframe/MobileParaWidgetTable.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java index 5788f22f41..e7e5089b50 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java @@ -384,10 +384,7 @@ class MobileParaWidgetTable extends JTable { * @return 是否可编辑 */ public boolean isCellEditable(int row, int column) { - if (column == 1) { - return false; - } - return true; + return column != 1; } } From c9a21400fa70a47131ffd05af824f220bc9c4d69 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 24 Aug 2017 15:59:05 +0800 Subject: [PATCH 24/30] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/ElementCasePaneDelegate.java | 84 ++++++++++--------- .../submit/SmartInsertDBManipulationPane.java | 37 ++++---- .../src/com/fr/poly/creator/ECBlockPane.java | 2 +- .../actions/ExitAuthorityEditAction.java | 3 +- 4 files changed, 66 insertions(+), 60 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java index 17eb281543..0e4c2aa58c 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -45,51 +45,12 @@ public class ElementCasePaneDelegate extends ElementCasePane { public ElementCasePaneDelegate(WorkSheet sheet) { super(sheet); this.addSelectionChangeListener(new SelectionListener() { - @Override public void selectionChanged(SelectionEvent e) { if (!isEditable()) { return; } - //在编辑权限,所以要更新权限编辑面板 - if (BaseUtils.isAuthorityEditing()) { - AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(ElementCasePaneDelegate.this); - authorityPropertyPane.populate(); - EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); - EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane); - EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); - return; - } - CellWidgetPropertyPane.getInstance().populate(ElementCasePaneDelegate.this); - CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this); - QuickEditorRegion.getInstance().populate(getCurrentEditor()); - JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); - if (editingTemplate != null && !editingTemplate.isUpMode()) { - Selection editingSelection = ((ElementCasePaneDelegate)e.getSource()).getSelection(); - // 模板初始化完成后,才能初始化超级链接面板 - HyperlinkGroupPane hyperlinkGroupPane = editingTemplate.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance()); - hyperlinkGroupPane.populate(ElementCasePaneDelegate.this); - if (editingSelection instanceof FloatSelection) { - EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT); - JPanel floatPane = new JPanel(new BorderLayout()); - floatPane.add(ReportFloatPane.getInstance(), BorderLayout.NORTH); - floatPane.add(QuickEditorRegion.getInstance(), BorderLayout.CENTER); - EastRegionContainerPane.getInstance().replaceFloatElementPane(floatPane); - } else { - // 条件属性 - ConditionAttributesGroupPane conditionAttributesGroupPane = ConditionAttributesGroupPane.getInstance(); - conditionAttributesGroupPane.populate(ElementCasePaneDelegate.this); - - EastRegionContainerPane.getInstance().replaceFloatElementPane(ReportFloatPane.getInstance()); - EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT); - EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance()); - EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance()); - EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane); - EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(CellWidgetPropertyPane.getInstance()); - } - EastRegionContainerPane.getInstance().replaceHyperlinkPane(hyperlinkGroupPane); - EastRegionContainerPane.getInstance().removeParameterPane(); - } + doOnSelectionChanged(); } }); this.addTargetModifiedListener(new TargetModifiedListener() { @@ -100,6 +61,48 @@ public class ElementCasePaneDelegate extends ElementCasePane { }); } + private void doOnSelectionChanged() { + //在编辑权限,所以要更新权限编辑面板 + if (BaseUtils.isAuthorityEditing()) { + AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(ElementCasePaneDelegate.this); + authorityPropertyPane.populate(); + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); + EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane); + EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); + return; + } + CellWidgetPropertyPane.getInstance().populate(ElementCasePaneDelegate.this); + CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this); + QuickEditorRegion.getInstance().populate(getCurrentEditor()); + JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + if (editingTemplate != null && !editingTemplate.isUpMode()) { + Selection editingSelection = ((ElementCasePaneDelegate)e.getSource()).getSelection(); + // 模板初始化完成后,才能初始化超级链接面板 + HyperlinkGroupPane hyperlinkGroupPane = editingTemplate.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance()); + hyperlinkGroupPane.populate(ElementCasePaneDelegate.this); + if (editingSelection instanceof FloatSelection) { + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT); + JPanel floatPane = new JPanel(new BorderLayout()); + floatPane.add(ReportFloatPane.getInstance(), BorderLayout.NORTH); + floatPane.add(QuickEditorRegion.getInstance(), BorderLayout.CENTER); + EastRegionContainerPane.getInstance().replaceFloatElementPane(floatPane); + } else { + // 条件属性 + ConditionAttributesGroupPane conditionAttributesGroupPane = ConditionAttributesGroupPane.getInstance(); + conditionAttributesGroupPane.populate(ElementCasePaneDelegate.this); + + EastRegionContainerPane.getInstance().replaceFloatElementPane(ReportFloatPane.getInstance()); + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT); + EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance()); + EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance()); + EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane); + EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(CellWidgetPropertyPane.getInstance()); + } + EastRegionContainerPane.getInstance().replaceHyperlinkPane(hyperlinkGroupPane); + EastRegionContainerPane.getInstance().removeParameterPane(); + } + } + @Override protected boolean supportRepeatedHeaderFooter() { return true; @@ -126,6 +129,7 @@ public class ElementCasePaneDelegate extends ElementCasePane { * * @return 不是必须在可见范围. */ + @Override public boolean mustInVisibleRange() { return false; } diff --git a/designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index 4c5cdb4e2f..36695d988f 100644 --- a/designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -8,9 +8,7 @@ import java.awt.event.ActionEvent; import javax.swing.BorderFactory; import javax.swing.JDialog; -import javax.swing.JLayeredPane; import javax.swing.JPanel; -import javax.swing.JRootPane; import javax.swing.JTable; import javax.swing.SwingUtilities; import javax.swing.table.DefaultTableCellRenderer; @@ -43,12 +41,15 @@ import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.stable.ColumnRow; import com.fr.stable.ColumnRowGroup; +import com.fr.stable.StringUtils; import com.fr.write.DMLConfigJob; public class SmartInsertDBManipulationPane extends DBManipulationPane { private static final Selection NO_SELECTION = new CellSelection(-1, -1, -1, -1); private ElementCasePane ePane; private static int CELL_GROUP_LIMIT = 6; + private static int TOP_PADDING = 30; + private static int LEFT_COLUMN_MAX_WIDTH = 40; public SmartInsertDBManipulationPane(ElementCasePane ePane) { super(ValueEditorPaneFactory.extendedCellGroupEditors()); @@ -57,10 +58,14 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { public SmartInsertDBManipulationPane() { super(ValueEditorPaneFactory.extendedCellGroupEditors()); - JTemplate jTemplate = DesignerContext.getDesignerFrame().getSelectedJTemplate(); - this.ePane = ((JWorkBook) jTemplate).getEditingElementCasePane(); + init(); } + private void init() { + JTemplate jTemplate = DesignerContext.getDesignerFrame().getSelectedJTemplate(); + this.ePane = ((JWorkBook) jTemplate).getEditingElementCasePane(); + } + @Override protected SubmitJobListPane createSubmitJobListPane() { return new SmartInsertSubmitJobListPane(); @@ -123,7 +128,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { } }; bPane.setLayout(FRGUIPaneFactory.createBorderLayout()); - bPane.setBorder(BorderFactory.createEmptyBorder(30, 0, 0, 0)); + bPane.setBorder(BorderFactory.createEmptyBorder(TOP_PADDING, 0, 0, 0)); final UIBasicSpinner columnSpinner = new UIBasicSpinner(); final UIBasicSpinner rowSpinner = new UIBasicSpinner(); Component[][] coms = new Component[][] { { new UILabel(Inter.getLocText("RWA-Row_Offset")), rowSpinner },{ new UILabel(Inter.getLocText("RWA-Column_Offset")), columnSpinner } }; @@ -289,11 +294,6 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { } } - private boolean possibleParentContainer(Container p) { - return p instanceof Dialog || p instanceof BasicPane || - p instanceof JPanel || p instanceof JRootPane || p instanceof JLayeredPane; - } - private class SmartJTablePane4DB extends SmartJTablePane { // 是否是单元格组 @@ -329,7 +329,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { * set Width */ TableColumn column0 = table.getColumnModel().getColumn(0); - column0.setMaxWidth(40); + column0.setMaxWidth(LEFT_COLUMN_MAX_WIDTH); /* * 设置Column 1的Renderer */ @@ -410,7 +410,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { // 要考虑多选的情况 要结合之前的看看 可能是增加 也可能需要减少 ColumnRowGroup add = new ColumnRowGroup(); int removeCount = 0; - if (oriCellSelection != null && sameStartPoint(cellselection, oriCellSelection)) { + if (oriCellSelection != null && isSameStartPoint(cellselection, oriCellSelection)) { removeCount = dealDragSelection(add, cellselection); } else if (cellselection.getSelectedType() == CellSelection.CHOOSE_ROW || cellselection.getSelectedType() == CellSelection.CHOOSE_COLUMN) { dealSelectColRow(add, cellselection); @@ -441,7 +441,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { return newValue; } - private boolean sameStartPoint(CellSelection cs1, CellSelection cs2) { + private boolean isSameStartPoint(CellSelection cs1, CellSelection cs2) { return cs1.getColumn() == cs2.getColumn() && cs1.getRow() == cs2.getRow(); } @@ -479,6 +479,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { private SmartJTablePaneAction a = new AbstractSmartJTablePaneAction(this, SmartInsertDBManipulationPane.this) { @Override public void doOk() { + // 遗留代码 } @Override @@ -507,7 +508,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { if (((ColumnValue)value).obj != null) { this.setText(((ColumnValue)value).obj.toString()); } else { - this.setText(""); + this.setText(StringUtils.EMPTY); } } @@ -535,12 +536,12 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { Object cv = ((ColumnValue) value).obj; if (cv instanceof ColumnRowGroup && ((ColumnRowGroup)cv).getSize() >= CELL_GROUP_LIMIT) { text.setText("[" + Inter.getLocText(new String[]{"Has_Selected", "Classifier-Ge", "Cell"}, - new String[]{((ColumnRowGroup)cv).getSize()+"", ""}) + "]"); + new String[]{((ColumnRowGroup)cv).getSize()+StringUtils.EMPTY, StringUtils.EMPTY}) + "]"); tip = cv.toString() + " " + tip; } else if (cv != null) { text.setText(cv.toString()); } else { - text.setText(""); + text.setText(StringUtils.EMPTY); } } @@ -568,12 +569,12 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { Object cv = ((ColumnValue) value).obj; if (cv instanceof ColumnRowGroup && ((ColumnRowGroup)cv).getSize() >= CELL_GROUP_LIMIT) { this.setText("[" + Inter.getLocText(new String[]{"Has_Selected", "Classifier-Ge", "Cell"}, - new String[]{((ColumnRowGroup)cv).getSize()+"", ""}) + "]"); + new String[]{((ColumnRowGroup)cv).getSize()+StringUtils.EMPTY, StringUtils.EMPTY}) + "]"); tip = cv.toString() + " " + tip; } else if (cv != null) { this.setText(cv.toString()); } else { - this.setText(""); + this.setText(StringUtils.EMPTY); } } diff --git a/designer/src/com/fr/poly/creator/ECBlockPane.java b/designer/src/com/fr/poly/creator/ECBlockPane.java index ba65847673..ebde8b3b4b 100644 --- a/designer/src/com/fr/poly/creator/ECBlockPane.java +++ b/designer/src/com/fr/poly/creator/ECBlockPane.java @@ -119,7 +119,7 @@ public class ECBlockPane extends PolyElementCasePane { // 插入菜单 private MenuDef createInsertMenuDef() { - MenuDef menuDef = new MenuDef(Inter.getLocText("M-Insert"), 'I'); + MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_M-Insert"), 'I'); // 单元格菜单 menuDef.addShortCut(DeprecatedActionManager.getCellMenu(this)); diff --git a/designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java b/designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java index dfb7f1dd68..a470673a0b 100644 --- a/designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java +++ b/designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java @@ -23,9 +23,10 @@ public class ExitAuthorityEditAction extends TemplateComponentAction { public void prepare4Undo() { - + // 遗留代码 } + @Override public boolean executeActionReturnUndoRecordNeeded() { TargetComponent tc = getEditingComponent(); if (tc == null) { From bf6bbd019570e50e11eb1aaf603c4d1ebaa2aa22 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 24 Aug 2017 16:48:44 +0800 Subject: [PATCH 25/30] =?UTF-8?q?=E6=95=B0=E7=BB=84=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/widget/ui/designer/btn/ButtonGroupDefinePane.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java index 2cfd8ce3ca..5f60a8095e 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java @@ -1,8 +1,8 @@ package com.fr.design.widget.ui.designer.btn; +import com.fr.data.Dictionary; import com.fr.design.designer.creator.*; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -67,6 +67,7 @@ public abstract class ButtonGroupDefinePane extends Field protected void populateSubFieldEditorBean(T e) { this.buttonGroupDictPane.populate(e); formWidgetValuePane.populate(e); + dictionaryEditor.setValue(e.getDictionary()); populateSubButtonGroupBean(e); } @@ -79,6 +80,7 @@ public abstract class ButtonGroupDefinePane extends Field T e = updateSubButtonGroupBean(); this.buttonGroupDictPane.update(e); formWidgetValuePane.update(e); + e.setDictionary((Dictionary) dictionaryEditor.getValue()); return e; } From d145f7facb4ed697716f7cc7b8a311f4e4a8184e Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 24 Aug 2017 17:01:12 +0800 Subject: [PATCH 26/30] PMD --- .../src/com/fr/design/gui/ibutton/UISliderButton.java | 6 ++---- .../com/fr/design/present/dict/FormulaDictPane.java | 11 ----------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/ibutton/UISliderButton.java b/designer_base/src/com/fr/design/gui/ibutton/UISliderButton.java index 13376521ea..21c5ee4b98 100644 --- a/designer_base/src/com/fr/design/gui/ibutton/UISliderButton.java +++ b/designer_base/src/com/fr/design/gui/ibutton/UISliderButton.java @@ -44,14 +44,12 @@ public class UISliderButton extends JButton implements UIObserver { } public UISliderButton(String string) { - super(string); - init(); + this(string, null); } public UISliderButton(Icon icon) { - super(icon); - init(); + this(null, icon); } public UISliderButton(Action action) { diff --git a/designer_base/src/com/fr/design/present/dict/FormulaDictPane.java b/designer_base/src/com/fr/design/present/dict/FormulaDictPane.java index 22d735ad86..6a3130a9c0 100644 --- a/designer_base/src/com/fr/design/present/dict/FormulaDictPane.java +++ b/designer_base/src/com/fr/design/present/dict/FormulaDictPane.java @@ -28,17 +28,6 @@ public class FormulaDictPane extends FurtherBasicBeanPane { initComponents(); } - public static void main(String[] args) { -// JFrame jf = new JFrame("test"); -// jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); -// JPanel content = (JPanel) jf.getContentPane(); -// content.setLayout(new BorderLayout()); -// content.add(new FormulaDictPane(), BorderLayout.NORTH); -// GUICoreUtils.centerWindow(jf); -// jf.setSize(250, 400); -// jf.setVisible(true); - } - private void initComponents() { keyFormulaEditor = new FormulaEditor(); keyFormulaEditor.setColumns(EDITOR_COLUMN); From 9de97fbe3eb6f7106a7a2d5819740abbe6b9d4d1 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 24 Aug 2017 17:07:22 +0800 Subject: [PATCH 27/30] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83=E6=94=B9=E5=87=BA?= =?UTF-8?q?bug=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/ElementCasePaneDelegate.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java index 0e4c2aa58c..071d92cc15 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -50,7 +50,7 @@ public class ElementCasePaneDelegate extends ElementCasePane { if (!isEditable()) { return; } - doOnSelectionChanged(); + doOnSelectionChanged(e); } }); this.addTargetModifiedListener(new TargetModifiedListener() { @@ -61,7 +61,7 @@ public class ElementCasePaneDelegate extends ElementCasePane { }); } - private void doOnSelectionChanged() { + private void doOnSelectionChanged(SelectionEvent e) { //在编辑权限,所以要更新权限编辑面板 if (BaseUtils.isAuthorityEditing()) { AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(ElementCasePaneDelegate.this); From f86bc5a8f3a74fd8c0bb32e6f3aa42e39bc26145 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 24 Aug 2017 18:04:35 +0800 Subject: [PATCH 28/30] =?UTF-8?q?=E6=97=A7=E6=A8=A1=E6=9D=BF=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=A8=A1=E6=9D=BF=E6=97=B6=E5=80=99=E5=8A=A0ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/JTemplate.java | 10 ++++++++++ .../com/fr/design/parameter/RootDesignDefinePane.java | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java index aa42804dbb..4f9c7a2056 100644 --- a/designer_base/src/com/fr/design/mainframe/JTemplate.java +++ b/designer_base/src/com/fr/design/mainframe/JTemplate.java @@ -1055,4 +1055,14 @@ public abstract class JTemplate> ex return uiButtons; } + + /** + * 由于老版本的模板没有模板ID,当勾选使用参数模板时候,就加一个模板ID + * @param isUseParamTemplate 是否使用参数模板 + */ + public void needAddTemplateId(boolean isUseParamTemplate) { + if (isUseParamTemplate && StringUtils.isEmpty(template.getTemplateID())) { + template.initTemplateID(); + } + } } diff --git a/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java b/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java index ac265cc200..85b84588bf 100644 --- a/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java +++ b/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icheckbox.UICheckBox; @@ -13,6 +14,7 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor; import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.form.ui.container.WParameterLayout; @@ -124,6 +126,8 @@ public class RootDesignDefinePane extends AbstractDataModify { wParameterLayout.setDesignWidth((int) designerWidth.getValue()); wParameterLayout.setDelayDisplayContent(displayReport.isSelected()); wParameterLayout.setUseParamsTemplate(useParamsTemplate.isSelected()); + JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + jTemplate.needAddTemplateId(useParamsTemplate.isSelected()); wParameterLayout.setBackground((Background) background.getValue()); wParameterLayout.setPosition(hAlignmentPane.getSelectedIndex()); return wParameterLayout; From bbff7976c70a74f1c694408270e5c169a089aa94 Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Thu, 24 Aug 2017 18:34:00 +0800 Subject: [PATCH 29/30] =?UTF-8?q?PFC-607=20=E6=8F=92=E4=BB=B6=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=88=A0=E9=99=A4=E6=9B=B4=E6=96=B0=E4=B8=8D=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E6=94=AF=E6=8C=81=20=E6=94=BE=E5=BC=83=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E4=BB=A3=E7=90=86=EF=BC=8C=E7=94=A8javassist=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E7=9B=B8=E5=90=8C=E5=8A=9F=E8=83=BD:=201=E3=80=81?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=BB=A3=E7=90=86=E4=B8=8D=E8=83=BD=E4=BD=9C?= =?UTF-8?q?=E7=94=A8=E5=88=B0=E6=B2=A1=E6=8E=A5=E5=8F=A3=E7=9A=84class?= =?UTF-8?q?=E4=B8=8A=202=E3=80=81=E5=8A=A8=E6=80=81=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E6=94=B9=E5=8F=98=E4=BA=86class=E7=9A=84=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=EF=BC=8C=E5=BC=80=E5=8F=91=E5=92=8C=E8=B0=83=E8=AF=95=E9=83=BD?= =?UTF-8?q?=E4=B8=8D=E5=A4=AA=E6=96=B9=E4=BE=BF=203=E3=80=81=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E4=BB=A3=E7=90=86=E5=BD=B1=E5=93=8D=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/ExtraDesignClassManager.java | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/designer_base/src/com/fr/design/ExtraDesignClassManager.java b/designer_base/src/com/fr/design/ExtraDesignClassManager.java index 54fbcf2f10..fe11379c48 100644 --- a/designer_base/src/com/fr/design/ExtraDesignClassManager.java +++ b/designer_base/src/com/fr/design/ExtraDesignClassManager.java @@ -6,7 +6,13 @@ package com.fr.design; import com.fr.base.BaseUtils; import com.fr.design.data.datapane.TableDataNameObjectCreator; -import com.fr.design.fun.*; +import com.fr.design.fun.CellWidgetOptionProvider; +import com.fr.design.fun.Feedback; +import com.fr.design.fun.FormWidgetOptionProvider; +import com.fr.design.fun.ParameterWidgetOptionProvider; +import com.fr.design.fun.ServerTableDataDefineProvider; +import com.fr.design.fun.TableDataDefineProvider; +import com.fr.design.fun.ToolbarItemProvider; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOptionFactory; import com.fr.design.menu.ShortCut; @@ -16,13 +22,19 @@ import com.fr.general.FRLogger; import com.fr.general.GeneralUtils; import com.fr.general.IOUtils; import com.fr.plugin.AbstractExtraClassManager; -import com.fr.plugin.solution.closeable.CompatibleInjectionContainer; import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.injectable.PluginSingleInjection; +import com.fr.plugin.solution.closeable.CloseableContainedSet; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraDesignClassManagerProvider; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * @author : richie @@ -33,7 +45,7 @@ public class ExtraDesignClassManager extends AbstractExtraClassManager implement private static ExtraDesignClassManager classManager = new ExtraDesignClassManager(); - private CompatibleInjectionContainer shortCuts = new CompatibleInjectionContainer<>(); + private Set shortCuts = new CloseableContainedSet<>(HashSet.class); public synchronized static ExtraDesignClassManager getInstance() { return classManager; @@ -204,8 +216,8 @@ public class ExtraDesignClassManager extends AbstractExtraClassManager implement @Override protected boolean demountSpecific(PluginSingleInjection injection) { - - if (ShortCut.TEMPLATE_TREE.equals(injection.getName()) && injection.getOriginalObject() instanceof ShortCut) { + + if (ShortCut.TEMPLATE_TREE.equals(injection.getName()) && injection.getObject() instanceof ShortCut) { shortCuts.remove(injection.getObject()); return true; } @@ -214,16 +226,16 @@ public class ExtraDesignClassManager extends AbstractExtraClassManager implement @Override protected boolean mountSpecific(PluginSingleInjection injection) { - - if (ShortCut.TEMPLATE_TREE.equals(injection.getName()) && injection.getOriginalObject() instanceof ShortCut) { - shortCuts.put(injection.getObject(), (ShortCut) injection.getOriginalObject()); + + if (ShortCut.TEMPLATE_TREE.equals(injection.getName()) && injection.getObject() instanceof ShortCut) { + shortCuts.add((ShortCut) injection.getObject()); return true; } return false; } public Set getExtraShortCuts() { - - return shortCuts.getSet(); + + return Collections.unmodifiableSet(shortCuts); } } \ No newline at end of file From 93ef5715963c2cfe62ff41a2f3edfef9d67f6b50 Mon Sep 17 00:00:00 2001 From: loy Date: Fri, 25 Aug 2017 14:44:11 +0800 Subject: [PATCH 30/30] =?UTF-8?q?=E5=A1=AB=E6=8A=A5=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=E6=96=B9=E5=BC=8F=E6=94=B9=E4=B8=BAop=3Dwrit?= =?UTF-8?q?e=5Fplus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/preview/WriteEnhancePreview.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer_base/src/com/fr/design/preview/WriteEnhancePreview.java b/designer_base/src/com/fr/design/preview/WriteEnhancePreview.java index 71705e9634..8dc18b57d7 100644 --- a/designer_base/src/com/fr/design/preview/WriteEnhancePreview.java +++ b/designer_base/src/com/fr/design/preview/WriteEnhancePreview.java @@ -28,13 +28,13 @@ public class WriteEnhancePreview extends AbstractPreviewProvider { @Override public int previewTypeCode() { - return IOFile.WRITE_PREVIEW_TYPE; + return IOFile.WRITE_ENHANCE_PREVIEW_TYPE; } @Override public Map parametersForPreview() { Map map = new HashMap(); - map.put("op", "write_ex"); + map.put("op", "write_plus"); return map; } }