From 406c5e7d1b1e3dde18c605c3f0abfd0f79537c60 Mon Sep 17 00:00:00 2001 From: hugh Date: Sat, 14 Jan 2017 10:59:03 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E5=88=86=E7=A6=BB=E5=8E=9F=E6=9D=A5=E7=9A=84=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E5=8D=95=E7=8B=AC=E6=88=90=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E4=B8=BA=E4=BA=86=E6=96=B9=E4=BE=BF=E7=AE=97=E5=AD=90?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=97=B6=E8=8E=B7=E5=8F=96=E5=88=86=E7=BB=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E9=87=8C=E9=9D=A2=E7=9A=84=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E3=80=82=E6=B2=A1=E6=9C=89=E5=8A=A8FinctionGroup=E8=BF=99?= =?UTF-8?q?=E4=B8=AA=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=9B=A0=E4=B8=BA=E5=8A=A8?= =?UTF-8?q?=E8=BF=99=E9=87=8C=E7=89=B5=E6=89=AF=E5=A4=AA=E5=B9=BF=E4=BA=86?= =?UTF-8?q?=EF=BC=8C=E5=8D=95=E7=8B=AC=E5=81=9A=E4=B8=80=E4=B8=AA=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=B8=93=E8=81=8C=E8=8E=B7=E5=8F=96=E5=85=AC=E5=BC=8F?= =?UTF-8?q?=E5=B0=B1=E5=A5=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/formula/FormulaPane.java | 3 ++- .../src/com/fr/design/formula/FunctionConstants.java | 3 ++- .../src/com/fr/design/formula/FunctionGroup.java | 4 ---- .../src/com/fr/design/fun/impl/AbstractFunctionGroup.java | 8 +++++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/designer_base/src/com/fr/design/formula/FormulaPane.java b/designer_base/src/com/fr/design/formula/FormulaPane.java index 260ca917b..e33a9414d 100644 --- a/designer_base/src/com/fr/design/formula/FormulaPane.java +++ b/designer_base/src/com/fr/design/formula/FormulaPane.java @@ -23,6 +23,7 @@ import com.fr.general.Inter; import com.fr.parser.FRLexer; import com.fr.parser.FRParser; import com.fr.plugin.ExtraClassManager; +import com.fr.script.FunctionDefContainer; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.stable.fun.mark.Mutable; @@ -619,7 +620,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ functionTypeListModel.addElement(FunctionConstants.CUSTOM); functionTypeListModel.addElement(FunctionConstants.PLUGIN); //hugh:自定义函数分组 - Set groups = ExtraClassManager.getInstance().getArray(FunctionGroup.MARK_STRING); + Set groups = ExtraClassManager.getInstance().getArray(FunctionDefContainer.MARK_STRING); if(!groups.isEmpty()){ for(Mutable group : groups){ functionTypeListModel.addElement(group); diff --git a/designer_base/src/com/fr/design/formula/FunctionConstants.java b/designer_base/src/com/fr/design/formula/FunctionConstants.java index 372409583..1194418e7 100644 --- a/designer_base/src/com/fr/design/formula/FunctionConstants.java +++ b/designer_base/src/com/fr/design/formula/FunctionConstants.java @@ -7,6 +7,7 @@ import com.fr.function.*; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.plugin.ExtraClassManager; +import com.fr.script.FunctionDefContainer; import com.fr.stable.EncodeConstants; import com.fr.stable.OperatingSystem; import com.fr.stable.StableUtils; @@ -98,7 +99,7 @@ public abstract class FunctionConstants { Collections.addAll(all, PLUGIN.getDescriptions()); Collections.addAll(all, CUSTOM.getDescriptions()); //hugh:自定义函数分组 - Set groups = ExtraClassManager.getInstance().getArray(FunctionGroup.MARK_STRING); + Set groups = ExtraClassManager.getInstance().getArray(FunctionDefContainer.MARK_STRING); if(!groups.isEmpty()){ for(Mutable group : groups){ Collections.addAll(all, ((FunctionGroup)group).getDescriptions()); diff --git a/designer_base/src/com/fr/design/formula/FunctionGroup.java b/designer_base/src/com/fr/design/formula/FunctionGroup.java index b2d181b12..4764454ed 100644 --- a/designer_base/src/com/fr/design/formula/FunctionGroup.java +++ b/designer_base/src/com/fr/design/formula/FunctionGroup.java @@ -2,10 +2,6 @@ package com.fr.design.formula; public interface FunctionGroup { - - int CURRENT_LEVEL = 1; - String MARK_STRING = "FunctionGroup"; - String getGroupName(); NameAndDescription[] getDescriptions(); } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractFunctionGroup.java b/designer_base/src/com/fr/design/fun/impl/AbstractFunctionGroup.java index 674339362..bd6a0c636 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractFunctionGroup.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractFunctionGroup.java @@ -3,17 +3,18 @@ package com.fr.design.fun.impl; import com.fr.design.formula.FunctionDefNAD; import com.fr.design.formula.FunctionGroup; import com.fr.design.formula.NameAndDescription; +import com.fr.script.FunctionDefContainer; import com.fr.stable.fun.mark.API; import com.fr.stable.fun.mark.Mutable; import com.fr.stable.script.FunctionDef; -@API(level = FunctionGroup.CURRENT_LEVEL) -public abstract class AbstractFunctionGroup implements Mutable, FunctionGroup { +@API(level = FunctionDefContainer.CURRENT_LEVEL) +public abstract class AbstractFunctionGroup implements Mutable, FunctionGroup,FunctionDefContainer { @Override public int currentAPILevel() { - return CURRENT_LEVEL; + return FunctionDefContainer.CURRENT_LEVEL; } @Override @@ -32,6 +33,7 @@ public abstract class AbstractFunctionGroup implements Mutable, FunctionGroup { return nads; } + @Override public FunctionDef[] getFunctionDefs(){ return new FunctionDef[0]; } From dcb837a7218faa05742542619248fdaa2ead8060 Mon Sep 17 00:00:00 2001 From: hugh Date: Sat, 14 Jan 2017 13:51:34 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=B9=8B=E5=89=8D=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=BC=80=E5=BE=97=E6=9C=89=E9=97=AE=E9=A2=98=EF=BC=8C=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=E6=97=B6=E7=AE=97=E5=AD=90=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E4=BC=9A=E5=87=BA=E9=94=99=E3=80=90=E8=AF=BB=E4=B8=8D=E5=88=B0?= =?UTF-8?q?=E5=87=BD=E6=95=B0=EF=BC=8C=E5=9B=A0=E4=B8=BA=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E4=B8=AD=E6=9C=89designer=E7=9A=84=E7=B1=BB=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/formula/FormulaPane.java | 13 ++---- .../fr/design/formula/FunctionConstants.java | 43 ++++++++++++++++++- .../fun/impl/AbstractFunctionGroup.java | 40 ----------------- 3 files changed, 45 insertions(+), 51 deletions(-) delete mode 100644 designer_base/src/com/fr/design/fun/impl/AbstractFunctionGroup.java diff --git a/designer_base/src/com/fr/design/formula/FormulaPane.java b/designer_base/src/com/fr/design/formula/FormulaPane.java index e33a9414d..9aec1972a 100644 --- a/designer_base/src/com/fr/design/formula/FormulaPane.java +++ b/designer_base/src/com/fr/design/formula/FormulaPane.java @@ -22,11 +22,8 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; import com.fr.parser.FRLexer; import com.fr.parser.FRParser; -import com.fr.plugin.ExtraClassManager; -import com.fr.script.FunctionDefContainer; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; -import com.fr.stable.fun.mark.Mutable; import com.fr.stable.script.Expression; import javax.swing.*; @@ -619,13 +616,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ functionTypeListModel.addElement(FunctionConstants.ALL); functionTypeListModel.addElement(FunctionConstants.CUSTOM); functionTypeListModel.addElement(FunctionConstants.PLUGIN); - //hugh:自定义函数分组 - Set groups = ExtraClassManager.getInstance().getArray(FunctionDefContainer.MARK_STRING); - if(!groups.isEmpty()){ - for(Mutable group : groups){ - functionTypeListModel.addElement(group); - } - } + + //hugh: 从函数分组插件中添加分组 + FunctionConstants.addFunctionGroupFromPlugins(functionTypeListModel); } private void initFunctionNameListCellRenderer(){ diff --git a/designer_base/src/com/fr/design/formula/FunctionConstants.java b/designer_base/src/com/fr/design/formula/FunctionConstants.java index 1194418e7..0575f8950 100644 --- a/designer_base/src/com/fr/design/formula/FunctionConstants.java +++ b/designer_base/src/com/fr/design/formula/FunctionConstants.java @@ -7,11 +7,11 @@ import com.fr.function.*; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.plugin.ExtraClassManager; -import com.fr.script.FunctionDefContainer; import com.fr.stable.EncodeConstants; import com.fr.stable.OperatingSystem; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import com.fr.stable.fun.FunctionDefContainer; import com.fr.stable.fun.mark.Mutable; import com.fr.stable.script.Function; import com.fr.stable.script.FunctionDef; @@ -25,8 +25,49 @@ import java.util.*; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; +import javax.swing.DefaultListModel; + public abstract class FunctionConstants { + + /** + * 将函数分组插件中的函数添加到对应的列表中 + * @param listModel + */ + public static void addFunctionGroupFromPlugins(DefaultListModel listModel){ + //hugh:自定义函数分组 + Set containers = ExtraClassManager.getInstance().getArray(FunctionDefContainer.MARK_STRING); + if(!containers.isEmpty()){ + for(Mutable container : containers){ + listModel.addElement(createFunctionGroup((FunctionDefContainer)container)); + } + } + } + + /** + * 创建一个新的分组 + * @param container + * @return + */ + private static FunctionGroup createFunctionGroup(final FunctionDefContainer container){ + return new FunctionGroup() { + @Override + public String getGroupName() { + return container.getGroupName(); + } + @Override + public NameAndDescription[] getDescriptions() { + FunctionDef[] fs = container.getFunctionDefs(); + int count = fs.length; + FunctionDefNAD[] nads = new FunctionDefNAD[count]; + for (int i = 0; i < count; i ++) { + nads[i] = new FunctionDefNAD(fs[i]); + } + return nads; + } + }; + } + public static FunctionGroup PLUGIN = new FunctionGroup() { @Override public String getGroupName() { diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractFunctionGroup.java b/designer_base/src/com/fr/design/fun/impl/AbstractFunctionGroup.java deleted file mode 100644 index bd6a0c636..000000000 --- a/designer_base/src/com/fr/design/fun/impl/AbstractFunctionGroup.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.fr.design.fun.impl; - -import com.fr.design.formula.FunctionDefNAD; -import com.fr.design.formula.FunctionGroup; -import com.fr.design.formula.NameAndDescription; -import com.fr.script.FunctionDefContainer; -import com.fr.stable.fun.mark.API; -import com.fr.stable.fun.mark.Mutable; -import com.fr.stable.script.FunctionDef; - - -@API(level = FunctionDefContainer.CURRENT_LEVEL) -public abstract class AbstractFunctionGroup implements Mutable, FunctionGroup,FunctionDefContainer { - - @Override - public int currentAPILevel() { - return FunctionDefContainer.CURRENT_LEVEL; - } - - @Override - public String mark4Provider() { - return getClass().getName(); - } - - @Override - public NameAndDescription[] getDescriptions() { - FunctionDef[] funcs = getFunctionDefs(); - int count = funcs.length; - FunctionDefNAD[] nads = new FunctionDefNAD[count]; - for (int i = 0; i < count; i ++) { - nads[i] = new FunctionDefNAD(funcs[i]); - } - return nads; - } - - @Override - public FunctionDef[] getFunctionDefs(){ - return new FunctionDef[0]; - } -} From 6a8b12b3b109de89384b1b5de118bfb7e9d1525d Mon Sep 17 00:00:00 2001 From: hugh Date: Sat, 14 Jan 2017 13:57:15 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E9=81=97=E6=BC=8F=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=9C=B0=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/formula/FunctionConstants.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer_base/src/com/fr/design/formula/FunctionConstants.java b/designer_base/src/com/fr/design/formula/FunctionConstants.java index 0575f8950..8a0675897 100644 --- a/designer_base/src/com/fr/design/formula/FunctionConstants.java +++ b/designer_base/src/com/fr/design/formula/FunctionConstants.java @@ -140,10 +140,10 @@ public abstract class FunctionConstants { Collections.addAll(all, PLUGIN.getDescriptions()); Collections.addAll(all, CUSTOM.getDescriptions()); //hugh:自定义函数分组 - Set groups = ExtraClassManager.getInstance().getArray(FunctionDefContainer.MARK_STRING); - if(!groups.isEmpty()){ - for(Mutable group : groups){ - Collections.addAll(all, ((FunctionGroup)group).getDescriptions()); + Set containers = ExtraClassManager.getInstance().getArray(FunctionDefContainer.MARK_STRING); + if(!containers.isEmpty()){ + for(Mutable container : containers){ + Collections.addAll(all,createFunctionGroup(((FunctionDefContainer)container)).getDescriptions()); } } java.util.Collections.sort(all, NameAndDescriptionComparator); From 2c50ee981b85daf7483d335720996447448b0466 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 16 Jan 2017 10:43:17 +0800 Subject: [PATCH 4/8] =?UTF-8?q?REPORT-1390=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E5=9C=A8=E9=80=89=E4=B8=AD=E2=80=9C=E6=82=AC?= =?UTF-8?q?=E6=B5=AE=E5=85=83=E7=B4=A0=E2=80=9D=E6=97=B6=EF=BC=8C=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E5=8F=B3=E4=BE=A7=E7=9A=84=E2=80=9C=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E5=B1=9E=E6=80=A7=E8=A1=A8=E2=80=9D=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/CellElementPropertyPane.java | 13 ++++++++++++- .../src/com/fr/grid/selection/CellSelection.java | 6 ++++++ .../src/com/fr/grid/selection/FloatSelection.java | 6 ++++++ designer/src/com/fr/grid/selection/Selection.java | 2 ++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java b/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java index fa602c8bd..d68bd7757 100644 --- a/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java +++ b/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java @@ -102,12 +102,23 @@ public class CellElementPropertyPane extends DockingView { return element; } + public void removeAll() { + this.remove(titlePane); + this.remove(cellElementEditPane); + } + + public void reInit(ElementCasePane ePane) { + this.add(titlePane, BorderLayout.NORTH); + this.add(cellElementEditPane, BorderLayout.CENTER); + cellElementEditPane.populate(ePane); + } + public void populate(ElementCasePane ePane) { TemplateElementCase elementCase = ePane.getEditingElementCase(); if (elementCase == null) { return; } - cellElementEditPane.populate(ePane); + ePane.getSelection().populatePropertyPane(ePane); } @Override diff --git a/designer/src/com/fr/grid/selection/CellSelection.java b/designer/src/com/fr/grid/selection/CellSelection.java index c08f87088..458d9fd29 100644 --- a/designer/src/com/fr/grid/selection/CellSelection.java +++ b/designer/src/com/fr/grid/selection/CellSelection.java @@ -18,6 +18,7 @@ import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.imenu.UIMenu; import com.fr.design.gui.imenu.UIPopupMenu; +import com.fr.design.mainframe.CellElementPropertyPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane.Clear; import com.fr.design.mainframe.JTemplate; @@ -684,4 +685,9 @@ public class CellSelection extends Selection { editor.populate(tc); return editor; } + + @Override + public void populatePropertyPane(ElementCasePane ePane) { + CellElementPropertyPane.getInstance().reInit(ePane); + } } \ No newline at end of file diff --git a/designer/src/com/fr/grid/selection/FloatSelection.java b/designer/src/com/fr/grid/selection/FloatSelection.java index 0c1b1fcb0..5f0be878c 100644 --- a/designer/src/com/fr/grid/selection/FloatSelection.java +++ b/designer/src/com/fr/grid/selection/FloatSelection.java @@ -20,6 +20,7 @@ import com.fr.design.cell.clipboard.CellElementsClip; import com.fr.design.cell.clipboard.ElementsTransferable; import com.fr.design.cell.clipboard.FloatElementsClip; import com.fr.design.designer.TargetComponent; +import com.fr.design.mainframe.CellElementPropertyPane; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.design.mainframe.ElementCasePane; @@ -230,4 +231,9 @@ public class FloatSelection extends Selection { editor.populate(tc); return editor; } + + @Override + public void populatePropertyPane(ElementCasePane ePane) { + CellElementPropertyPane.getInstance().removeAll(); + } } \ No newline at end of file diff --git a/designer/src/com/fr/grid/selection/Selection.java b/designer/src/com/fr/grid/selection/Selection.java index e7466b365..c12dda83b 100644 --- a/designer/src/com/fr/grid/selection/Selection.java +++ b/designer/src/com/fr/grid/selection/Selection.java @@ -87,6 +87,8 @@ public abstract class Selection implements FCloneable, Serializable , Selectable // //////////////////////////Just4CellSelection/////////////////////////////// public abstract boolean containsColumnRow(ColumnRow cr); + + public abstract void populatePropertyPane(ElementCasePane ePane); @Override From 2dad275f38b868bab361a6ff18b51ad0b7344ea9 Mon Sep 17 00:00:00 2001 From: lee <854954082@qq.com> Date: Mon, 16 Jan 2017 21:26:26 +0800 Subject: [PATCH 5/8] =?UTF-8?q?REPORT-1808=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=86=85tab=20bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.嵌套情况下,删除不起效果。 2.删除最后一个没有提示。 3.字体自定义之后再设置默认,字体没有变回来。 --- .../designer/creator/cardlayout/XCardSwitchButton.java | 10 +++++++++- .../designer/creator/cardlayout/XWTabFitLayout.java | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java index fdfaaa0dc..27954b20b 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java @@ -251,7 +251,9 @@ public class XCardSwitchButton extends XButton { Point position = button.getLocation(); int width = button.getWidth(); int height = button.getHeight(); - + + ey = ey % DEFAULT_BUTTON_HEIGHT; + // 鼠标进入按钮右侧删除图标区域 double recX = position.getX() + (width - RIGHT_OFFSET); double recY = position.getY() + (height - TOP_OFFSET); @@ -337,6 +339,12 @@ public class XCardSwitchButton extends XButton { //删除tab布局 private void deleteTabLayout(SelectionModel selectionModel,FormDesigner designer){ + String titleName = this.getContentLabel().getText(); + int value = JOptionPane.showConfirmDialog(null, Inter.getLocText("FR-Designer_ConfirmDialog_Content") + "“" + titleName + "”", + Inter.getLocText("FR-Designer_ConfirmDialog_Title"),JOptionPane.YES_NO_OPTION); + if (value != JOptionPane.OK_OPTION) { + return; + } XLayoutContainer mainLayout = this.cardLayout.getBackupParent(); if(mainLayout != null){ selectionModel.setSelectedCreator(mainLayout); diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java index e9d7b58c3..7276df53d 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java @@ -45,6 +45,9 @@ public class XWTabFitLayout extends XWFitLayout { // tab布局在拖拽导致的缩放里(含间隔时),如果拖拽宽高大于组件宽高,会导致调整的时候找不到原来的组件 // 这里先将拖拽之前的宽高先做备份 private static final Color NORMAL_GRAL = new Color(236,236,236); + private static final String DEFAULT_FONT_NAME = "SimSun"; + public final static Font DEFAULTFT = new Font("Song_TypeFace",0,12); + public final static FRFont DEFAULT_FRFT = FRFont.getInstance(DEFAULT_FONT_NAME, 0, 9); private Dimension referDim; private Background initialBackground; private Background overBackground; @@ -229,16 +232,21 @@ public class XWTabFitLayout extends XWFitLayout { boolean isStyle = ((WTabFitLayout) data).isCustomStyle(); Background bg; bg = ColorBackground.getInstance(NORMAL_GRAL); + CardSwitchButton cardSwitchButton = (CardSwitchButton) this.xCardSwitchButton.toData(); if (!isStyle) { this.xCardSwitchButton.setCustomStyle(false); this.xCardSwitchButton.setSelectBackground(bg); + this.xCardSwitchButton.getLabel().setFont(DEFAULTFT); + cardSwitchButton.setFont(DEFAULT_FRFT); } else { - CardSwitchButton cardSwitchButton = (CardSwitchButton) this.xCardSwitchButton.toData(); Background initialBackground = cardSwitchButton.getInitialBackground(); bg = initialBackground == null ? bg : initialBackground; this.xCardSwitchButton.setSelectBackground(bg); this.xCardSwitchButton.setCustomStyle(true); cardSwitchButton.setCustomStyle(true); + if (font != null) { + cardSwitchButton.setFont(font); + } } } From 001aab092b24f24154103d2b6d54e5ccc53f9c4a Mon Sep 17 00:00:00 2001 From: lee <854954082@qq.com> Date: Tue, 17 Jan 2017 09:58:45 +0800 Subject: [PATCH 6/8] 1 1 --- .../design/designer/creator/cardlayout/XCardSwitchButton.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java index 27954b20b..8ade2b368 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java @@ -395,9 +395,9 @@ public class XCardSwitchButton extends XButton { this.tagLayout.getComponent(i).setBounds(rectangle); Dimension dimension = new Dimension(); dimension.setSize(cardWidth, cardHeight); + XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i); CardSwitchButton cardSwitchButton = (CardSwitchButton) temp.toData(); FRFont frFont = cardSwitchButton.getFont(); - XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i); UILabel label = temp.getContentLabel(); label.setSize(dimension); label.setFont(frFont.applyResolutionNP(ScreenResolution.getScreenResolution())); From 3b5c88284205dfe01a381e182fb4ba357914b846 Mon Sep 17 00:00:00 2001 From: lee <854954082@qq.com> Date: Tue, 17 Jan 2017 12:52:32 +0800 Subject: [PATCH 7/8] =?UTF-8?q?REPORT-1808=20font=E7=A9=BA=E5=80=BC?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E7=BB=99=E4=BA=88=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/cardlayout/XCardSwitchButton.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java index 8ade2b368..6bc1de727 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java @@ -47,6 +47,7 @@ public class XCardSwitchButton extends XButton { //设置的图片类型 private static final String COLORBACKGROUNDTYPE = "ColorBackground"; private static final String DEFAULTTYPE = "default"; + private static final String DEFAULT_FONT_NAME = "SimSun"; //默认颜色 public static final Color NORMAL_GRAL = new Color(236,236,236); @@ -65,6 +66,7 @@ public class XCardSwitchButton extends XButton { private static final int FONT_SIZE_ADJUST = 2; private static final int SIDE_OFFSET = 57; + private static final int FONT_SIZE = 9; private XWCardLayout cardLayout; private XWCardTagLayout tagLayout; @@ -320,6 +322,9 @@ public class XCardSwitchButton extends XButton { // 标题部分 WidgetTitle title = style.getTitle(); FRFont font = button.getFont(); + if (font == null) { + font = FRFont.getInstance(DEFAULT_FONT_NAME, 0, FONT_SIZE); + } FRFont newFont = FRFont.getInstance(font.getName(),font.getStyle(),font.getSize() + FONT_SIZE_ADJUST); UILabel label = this.getContentLabel(); label.setFont(newFont); @@ -398,6 +403,9 @@ public class XCardSwitchButton extends XButton { XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i); CardSwitchButton cardSwitchButton = (CardSwitchButton) temp.toData(); FRFont frFont = cardSwitchButton.getFont(); + if (frFont == null) { + frFont = FRFont.getInstance(DEFAULT_FONT_NAME, 0, FONT_SIZE); + } UILabel label = temp.getContentLabel(); label.setSize(dimension); label.setFont(frFont.applyResolutionNP(ScreenResolution.getScreenResolution())); From a2a7a6bd155c5bd97ac181cc37b4e603affde8d7 Mon Sep 17 00:00:00 2001 From: lee <854954082@qq.com> Date: Tue, 17 Jan 2017 16:17:04 +0800 Subject: [PATCH 8/8] =?UTF-8?q?REPORT-1808=20=E5=AD=97=E4=BD=93=EF=BC=8C?= =?UTF-8?q?=E8=83=8C=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.字体设置之后的控件的宽度,导致设计器端的显示异常。 2.背景设置恢复默认之后,后台的属性设置为空。 --- .../design/designer/creator/cardlayout/XCardSwitchButton.java | 2 +- .../fr/design/designer/creator/cardlayout/XWTabFitLayout.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java index 6bc1de727..6c55ee045 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java @@ -376,7 +376,7 @@ public class XCardSwitchButton extends XButton { XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i); CardSwitchButton tempCard = (CardSwitchButton) temp.toData(); String tempText = tempCard.getText(); - Font f = ((CardSwitchButton)this.toData()).getFont(); + Font f = tempCard.getFont(); FontMetrics fm = GraphHelper.getFontMetrics(f); cardWidth.put(i,fm.stringWidth(tempText)); cardHeight.put(i,fm.getHeight()); diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java index 7276df53d..ccdf7dd07 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java @@ -237,6 +237,9 @@ public class XWTabFitLayout extends XWFitLayout { this.xCardSwitchButton.setCustomStyle(false); this.xCardSwitchButton.setSelectBackground(bg); this.xCardSwitchButton.getLabel().setFont(DEFAULTFT); + cardSwitchButton.setInitialBackground(null); + cardSwitchButton.setClickBackground(null); + cardSwitchButton.setOverBackground(null); cardSwitchButton.setFont(DEFAULT_FRFT); } else { Background initialBackground = cardSwitchButton.getInitialBackground();