Browse Source

Merge pull request #653 in BA/design from ~LEE/design_release:release to release

* commit '49e88c6ced05c9f6853550e5ef9da6179189a7fd':
  REPORT-576 字体设置功能完善
master
superman 8 years ago
parent
commit
776ea87c51
  1. 26
      designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java
  2. 9
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java

26
designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java

@ -12,6 +12,7 @@ import javax.swing.*;
import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution;
import com.fr.base.background.ColorBackground;
import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.ComponentAdapter;
@ -70,7 +71,7 @@ public class XCardSwitchButton extends XButton {
private Background selectBackground;
private boolean isCustomStyle;
private UILabel label;
private Icon closeIcon = MOUSE_COLSE;
@ -106,6 +107,14 @@ public class XCardSwitchButton extends XButton {
this.selectBackground = selectBackground;
}
public UILabel getLabel() {
return label;
}
public void setLabel(UILabel label) {
this.label = label;
}
public XCardSwitchButton(CardSwitchButton widget, Dimension initSize) {
super(widget, initSize);
}
@ -161,7 +170,8 @@ public class XCardSwitchButton extends XButton {
// 切换到当前tab按钮对应的tabFitLayout
XWTabFitLayout tabFitLayout = (XWTabFitLayout) cardLayout.getComponent(index);
tabFitLayout.setxCardSwitchButton(this);
XCardSwitchButton xCardSwitchButton = (XCardSwitchButton) this.tagLayout.getComponent(index);
tabFitLayout.setxCardSwitchButton(xCardSwitchButton);
selectionModel.setSelectedCreator(tabFitLayout);
if (editingMouseListener.stopEditing()) {
@ -307,7 +317,7 @@ public class XCardSwitchButton extends XButton {
// 标题部分
WidgetTitle title = style.getTitle();
FRFont font = title.getFrFont();
FRFont font = button.getFont();
FRFont newFont = FRFont.getInstance(font.getName(),font.getStyle(),font.getSize() + FONT_SIZE_ADJUST);
UILabel label = this.getContentLabel();
label.setFont(newFont);
@ -377,9 +387,13 @@ public class XCardSwitchButton extends XButton {
this.tagLayout.getComponent(i).setBounds(rectangle);
Dimension dimension = new Dimension();
dimension.setSize(cardWidth, cardHeight);
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()));
label.setForeground(frFont.getForeground());
temp.setContentLabel(label);
temp.setSize(dimension);
temp.setPreferredSize(new Dimension(cardWidth, cardHeight));
@ -391,4 +405,10 @@ public class XCardSwitchButton extends XButton {
super.doLayout();
setTabsAndAdjust();
}
@Override
protected void initXCreatorProperties() {
super.initXCreatorProperties();
label = this.getContentLabel();
}
}

9
designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java

@ -5,6 +5,7 @@ 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;
@ -15,6 +16,7 @@ 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;
@ -164,6 +166,13 @@ public class XWTabFitLayout extends XWFitLayout {
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);
}
}),
};

Loading…
Cancel
Save