From 7d077a4653ac392a379f816db3f45db158b4f4f4 Mon Sep 17 00:00:00 2001 From: zhouping Date: Fri, 24 Feb 2017 17:33:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20tab=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E5=AD=97=E4=BD=93=E3=80=81=E5=AD=97=E5=8F=B7=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E4=BF=AE=E6=94=B9=EF=BC=8Crelease=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=88=B0dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../creator/cardlayout/XCardSwitchButton.java | 10 +--- .../creator/cardlayout/XWTabFitLayout.java | 51 ++----------------- 2 files changed, 6 insertions(+), 55 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 effa8856e..04e678029 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 @@ -48,7 +48,6 @@ public class XCardSwitchButton extends XButton { //设置的图片类型 private static final String COLOR_BACKGROUND_TYPE = "ColorBackground"; private static final String DEFAULT_TYPE = "default"; - private static final String DEFAULT_FONT_NAME = "SimSun"; //默认颜色 public static final Color NORMAL_GRAL = new Color(236,236,236); @@ -67,7 +66,6 @@ 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; @@ -345,10 +343,7 @@ 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 font = title.getFrFont(); FRFont newFont = FRFont.getInstance(font.getName(),font.getStyle(),font.getSize() + FONT_SIZE_ADJUST); UILabel label = this.getContentLabel(); label.setFont(newFont); @@ -427,9 +422,6 @@ 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())); 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 f4cac3e15..ee74339a9 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 @@ -1,11 +1,5 @@ package com.fr.design.designer.creator.cardlayout; -import java.awt.*; -import java.beans.IntrospectionException; - -import javax.swing.border.Border; - -import com.fr.base.ScreenResolution; import com.fr.base.background.ColorBackground; import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRTabFitLayoutAdapter; @@ -16,25 +10,25 @@ import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.fun.WidgetPropertyUIProvider; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormHierarchyTreePane; import com.fr.design.mainframe.widget.editors.ButtonTypeEditor; -import com.fr.design.mainframe.widget.editors.FontEditor; import com.fr.design.mainframe.widget.editors.ImgBackgroundEditor; -import com.fr.design.mainframe.widget.renderer.FontCellRenderer; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout; import com.fr.general.Background; -import com.fr.general.FRFont; import com.fr.general.FRLogger; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import com.fr.stable.core.PropertyChangeAdapter; +import javax.swing.border.Border; +import java.awt.*; +import java.beans.IntrospectionException; + /** * @author focus @@ -46,14 +40,10 @@ 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; private Background clickBackground; - private FRFont font; private XCardSwitchButton xCardSwitchButton; public Dimension getReferDim() { @@ -88,15 +78,6 @@ public class XWTabFitLayout extends XWFitLayout { this.clickBackground = clickBackground; } - @Override - public FRFont getFont() { - return font; - } - - public void setFont(FRFont font) { - this.font = font; - } - public XCardSwitchButton getxCardSwitchButton() { return xCardSwitchButton; } @@ -164,21 +145,7 @@ public class XWTabFitLayout extends XWFitLayout { cardSwitchButton.setClickBackground(clickBackground); } } - ), - //字体 - creatNonListenerStyle(4).setPropertyChangeListener( - new PropertyChangeAdapter() { - @Override - public void propertyChange() { - font = ((WTabFitLayout) data).getFont(); - CardSwitchButton cardSwitchButton = (CardSwitchButton) xCardSwitchButton.toData(); - cardSwitchButton.setFont(font); - UILabel uiLabel = xCardSwitchButton.getLabel(); - uiLabel.setFont(font.applyResolutionNP(ScreenResolution.getScreenResolution())); - uiLabel.setForeground(font.getForeground()); - xCardSwitchButton.setLabel(uiLabel); - } - }), + ) }; } @@ -210,9 +177,6 @@ public class XWTabFitLayout extends XWFitLayout { XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), new CRPropertyDescriptor("clickBackground", this.data.getClass()).setEditorClass( ImgBackgroundEditor.class).setI18NName(Inter.getLocText("FR-Designer_Background-Click")).putKeyValue( - XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), - new CRPropertyDescriptor("font", this.data.getClass()).setI18NName(Inter.getLocText("FR-Designer_FRFont")) - .setEditorClass(FontEditor.class).setRendererClass(FontCellRenderer.class).putKeyValue( XCreatorConstants.PROPERTY_CATEGORY, "Advanced") }; return crPropertyDescriptors[i]; @@ -243,20 +207,15 @@ public class XWTabFitLayout extends XWFitLayout { if (!isStyle) { 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(); bg = initialBackground == null ? bg : initialBackground; this.xCardSwitchButton.setSelectBackground(bg); this.xCardSwitchButton.setCustomStyle(true); cardSwitchButton.setCustomStyle(true); - if (font != null) { - cardSwitchButton.setFont(font); - } if (this.initialBackground != null){ this.xCardSwitchButton.setSelectBackground(this.initialBackground); cardSwitchButton.setInitialBackground(this.initialBackground);