Browse Source

Merge pull request #1030 in DESIGN/design from ~RICHIE/design:feature/10.0 to feature/10.0

* commit 'cd93562c52d5b305e9f872f52cdb28360e51f741':
  无JIRA任务 抽象实体类,给SDK做准备
persist/11.0
richie 5 years ago
parent
commit
63d0e27bb0
  1. 4
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java
  2. 7
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java
  3. 23
      designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java
  4. 18
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java
  5. 12
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java
  6. 4
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java
  7. 6
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java
  8. 31
      designer-form/src/main/java/com/fr/design/gui/xpane/LayoutBorderPane.java
  9. 6
      designer-form/src/main/java/com/fr/design/gui/xpane/LayoutBorderPreviewPane.java

4
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java

@ -24,7 +24,7 @@ import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.container.WTabDisplayPosition; import com.fr.form.ui.container.WTabDisplayPosition;
import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.TextFetcher; import com.fr.general.act.BorderPacker;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
@ -285,7 +285,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
backupBound.x -= rec.x; backupBound.x -= rec.x;
backupBound.y -= rec.y; backupBound.y -= rec.y;
XWCardLayout cardLayout = mainLayout.getCardPart(); XWCardLayout cardLayout = mainLayout.getCardPart();
TextFetcher style = cardLayout.toData().getBorderStyle(); BorderPacker style = cardLayout.toData().getBorderStyle();
XWCardTitleLayout xwCardTitleLayout = mainLayout.getTitlePart(); XWCardTitleLayout xwCardTitleLayout = mainLayout.getTitlePart();
Dimension titleDimension = xwCardTitleLayout.getSize(); Dimension titleDimension = xwCardTitleLayout.getSize();

7
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java

@ -7,19 +7,16 @@ package com.fr.design.designer.beans.adapters.layout;
import com.fr.design.beans.GroupModel; import com.fr.design.beans.GroupModel;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.creator.XWidgetCreator; import com.fr.design.designer.creator.XWidgetCreator;
import com.fr.design.designer.creator.cardlayout.XWCardLayout; import com.fr.design.designer.creator.cardlayout.XWCardLayout;
import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout;
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout;
import com.fr.design.designer.properties.FRTabFitLayoutPropertiesGroupModel; import com.fr.design.designer.properties.FRTabFitLayoutPropertiesGroupModel;
import com.fr.design.mainframe.widget.editors.ParameterEditor;
import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.ComponentUtils;
import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.container.WBorderLayout;
import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.TextFetcher; import com.fr.general.act.BorderPacker;
import java.awt.*; import java.awt.*;
@ -91,7 +88,7 @@ public class FRTabFitLayoutAdapter extends FRFitLayoutAdapter {
// TODO 可以直接在这边将x,y都变成相对坐标,这样在后面判断拖进来的新控件放置方式的时候就不用再判断了 // TODO 可以直接在这边将x,y都变成相对坐标,这样在后面判断拖进来的新控件放置方式的时候就不用再判断了
private int adjustY(int y, XWTabFitLayout tabLayout) { private int adjustY(int y, XWTabFitLayout tabLayout) {
XWCardLayout cardLayout = (XWCardLayout) tabLayout.getBackupParent(); XWCardLayout cardLayout = (XWCardLayout) tabLayout.getBackupParent();
TextFetcher style = cardLayout.toData().getBorderStyle(); BorderPacker style = cardLayout.toData().getBorderStyle();
y = y - this.getParaEditorYOffset(); y = y - this.getParaEditorYOffset();
if (ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)) { if (ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)) {
y = y - WCardMainBorderLayout.TAB_HEIGHT; y = y - WCardMainBorderLayout.TAB_HEIGHT;

23
designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java

@ -11,7 +11,8 @@ import com.fr.form.ui.WidgetTitle;
import com.fr.form.ui.WidgetValue; import com.fr.form.ui.WidgetValue;
import com.fr.form.ui.container.WTitleLayout; import com.fr.form.ui.container.WTitleLayout;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.TextFetcher; import com.fr.general.act.BorderPacker;
import com.fr.general.act.TitlePacker;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -42,7 +43,7 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{
} }
protected void initStyle() { protected void initStyle() {
TextFetcher style = toData().getBorderStyle(); BorderPacker style = toData().getBorderStyle();
initBorderStyle(); initBorderStyle();
if (ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)) { if (ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)) {
initTitleStyle(style); initTitleStyle(style);
@ -53,7 +54,7 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{
// 边框默认值设为NONE,不然像scalelayout这种只用默认边框的会不显示边框 // 边框默认值设为NONE,不然像scalelayout这种只用默认边框的会不显示边框
protected void initBorderStyle() { protected void initBorderStyle() {
TextFetcher style = toData().getBorderStyle(); BorderPacker style = toData().getBorderStyle();
if (style != null && style.getBorder() != Constants.LINE_NONE) { if (style != null && style.getBorder() != Constants.LINE_NONE) {
this.setBorder(new UIRoundedBorder(style.getBorder(), style.getColor(), style.getBorderRadius())); this.setBorder(new UIRoundedBorder(style.getBorder(), style.getColor(), style.getBorderRadius()));
} else { } else {
@ -75,8 +76,8 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{
* 设置样式为标题样式时对应组件加上标题 * 设置样式为标题样式时对应组件加上标题
* @param style 样式 * @param style 样式
*/ */
protected void initTitleStyle(TextFetcher style){ protected void initTitleStyle(BorderPacker style){
if (style.getTextObject() == null) { if (style.getTitle() == null || style.getTitle().getTextObject() == null) {
return; return;
} }
XWTitleLayout parent = (XWTitleLayout) this.getParent(); XWTitleLayout parent = (XWTitleLayout) this.getParent();
@ -101,25 +102,25 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{
/** /**
* 更新标题控件所有的样式 * 更新标题控件所有的样式
*/ */
private void updateTitleWidgetStyle(Label title, TextFetcher style) { private void updateTitleWidgetStyle(Label title, BorderPacker style) {
//标题的边框样式目前是取对应的控件的边框样式 //标题的边框样式目前是取对应的控件的边框样式
title.setBorder(style.getBorder()); title.setBorder(style.getBorder());
title.setColor(style.getColor()); title.setColor(style.getColor());
// title.setCorner(style.isCorner()); // title.setCorner(style.isCorner());
WidgetTitle wTitle = WidgetTitle.as(style); TitlePacker wTitle = style.getTitle();
//设置成随机不重复的, 不然都用一个名字的话, 联动只能联动一个 //设置成随机不重复的, 不然都用一个名字的话, 联动只能联动一个
title.setWidgetName(wTitle.TITLE_NAME_INDEX + this.toData().getWidgetName()); title.setWidgetName(WidgetTitle.TITLE_NAME_INDEX + this.toData().getWidgetName());
title.setWidgetValue(getTitleValue(wTitle)); title.setWidgetValue(getTitleValue(wTitle));
title.setFont(wTitle.getFrFont()); title.setFont(wTitle.getFrFont());
title.setTextalign(wTitle.getPosition()); title.setTextalign(wTitle.getPosition());
title.setBackground(wTitle.getBackground()); title.setBackground(wTitle.getBackground());
} }
private WidgetValue getTitleValue(WidgetTitle wTitle){ private WidgetValue getTitleValue(TitlePacker wTitle){
String content = String.valueOf(wTitle.getTextObject()); String content = String.valueOf(wTitle.getTextObject());
Object vlaue = content.startsWith("=") ? BaseFormula.createFormulaBuilder().build(content) : content; Object value = content.startsWith("=") ? BaseFormula.createFormulaBuilder().build(content) : content;
return new WidgetValue(vlaue); return new WidgetValue(value);
} }
@Override @Override

18
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java

@ -22,14 +22,14 @@ import com.fr.design.mainframe.JForm;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.WidgetTitle;
import com.fr.form.ui.container.WTabTextDirection; import com.fr.form.ui.container.WTabTextDirection;
import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.form.ui.container.cardlayout.WTabFitLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.act.BorderPacker;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.TextFetcher; import com.fr.general.act.TitlePacker;
import com.fr.general.cardtag.TemplateStyle; import com.fr.general.cardtag.TemplateStyle;
import com.fr.stable.unit.PT; import com.fr.stable.unit.PT;
@ -297,7 +297,7 @@ public class XCardSwitchButton extends XButton {
super.paintComponent(g); super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
CardSwitchButton button = (CardSwitchButton) this.toData(); CardSwitchButton button = (CardSwitchButton) this.toData();
WidgetTitle widgetTitle = getWidgetTitle(); TitlePacker widgetTitle = getWidgetTitle();
drawBackground(button, widgetTitle); drawBackground(button, widgetTitle);
drawTitle(button, widgetTitle); drawTitle(button, widgetTitle);
Dimension panelSize = this.getContentLabel().getSize(); Dimension panelSize = this.getContentLabel().getSize();
@ -311,7 +311,7 @@ public class XCardSwitchButton extends XButton {
} }
//画背景 //画背景
private void drawBackground(CardSwitchButton button, WidgetTitle widgetTitle){ private void drawBackground(CardSwitchButton button, TitlePacker widgetTitle){
Background background = widgetTitle.getBackground() == null ? ColorBackground.getInstance(NORMAL_GRAL) : widgetTitle.getBackground(); Background background = widgetTitle.getBackground() == null ? ColorBackground.getInstance(NORMAL_GRAL) : widgetTitle.getBackground();
TemplateStyle templateStyle = ((WCardTagLayout) tagLayout.toData()).getTemplateStyle(); TemplateStyle templateStyle = ((WCardTagLayout) tagLayout.toData()).getTemplateStyle();
//获取当前tab的index //获取当前tab的index
@ -329,7 +329,7 @@ public class XCardSwitchButton extends XButton {
} }
//画标题 //画标题
private void drawTitle(CardSwitchButton button, WidgetTitle widgetTitle) { private void drawTitle(CardSwitchButton button, TitlePacker widgetTitle) {
String titleText = button.getText(); String titleText = button.getText();
this.setButtonText(titleText); this.setButtonText(titleText);
FRFont font = widgetTitle.getFrFont(); FRFont font = widgetTitle.getFrFont();
@ -340,12 +340,12 @@ public class XCardSwitchButton extends XButton {
} }
private WidgetTitle getWidgetTitle() { private TitlePacker getWidgetTitle() {
if (this.cardLayout == null) { if (this.cardLayout == null) {
initRelateLayout(); initRelateLayout();
} }
TextFetcher style = this.cardLayout.toData().getBorderStyle(); BorderPacker style = this.cardLayout.toData().getBorderStyle();
return WidgetTitle.as(style); return style.getTitle();
} }
//删除tab布局 //删除tab布局
@ -452,7 +452,7 @@ public class XCardSwitchButton extends XButton {
String titleText = button.getText(); String titleText = button.getText();
java.util.List verticalTextList = new ArrayList(); java.util.List verticalTextList = new ArrayList();
StringBuilder titleStringBuf = new StringBuilder(); StringBuilder titleStringBuf = new StringBuilder();
WidgetTitle title = getWidgetTitle(); TitlePacker title = getWidgetTitle();
FRFont font = title.getFrFont(); FRFont font = title.getFrFont();
FRFont newFont = FRFont.getInstance(font.getName(), font.getStyle(), font.getSize() + FONT_SIZE_ADJUST); FRFont newFont = FRFont.getInstance(font.getName(), font.getStyle(), font.getSize() + FONT_SIZE_ADJUST);
FontMetrics fm = GraphHelper.getFontMetrics(newFont); FontMetrics fm = GraphHelper.getFontMetrics(newFont);

12
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java

@ -25,7 +25,6 @@ import com.fr.form.ui.CardAddButton;
import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetTitle;
import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WBorderLayout;
import com.fr.form.ui.container.WCardLayout; import com.fr.form.ui.container.WCardLayout;
import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.WLayout;
@ -33,8 +32,9 @@ import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout;
import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.form.ui.container.cardlayout.WCardTitleLayout; import com.fr.form.ui.container.cardlayout.WCardTitleLayout;
import com.fr.form.ui.container.cardlayout.WTabFitLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.act.BorderPacker;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.TextFetcher; import com.fr.general.act.TitlePacker;
import com.fr.general.cardtag.DefaultTemplateStyle; import com.fr.general.cardtag.DefaultTemplateStyle;
import com.fr.general.cardtag.TemplateStyle; import com.fr.general.cardtag.TemplateStyle;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
@ -166,7 +166,7 @@ public class XWCardLayout extends XLayoutContainer {
WCardMainBorderLayout border = new WCardMainBorderLayout(); WCardMainBorderLayout border = new WCardMainBorderLayout();
XWCardMainBorderLayout xMainBorder = new XWCardMainBorderLayout(border, dimension); XWCardMainBorderLayout xMainBorder = new XWCardMainBorderLayout(border, dimension);
//将子WCardBorder的style设置到父容器上 //将子WCardBorder的style设置到父容器上
TextFetcher style = (this.toData()).getBorderStyle(); BorderPacker style = (this.toData()).getBorderStyle();
border.setBorderStyle(style); border.setBorderStyle(style);
this.setBackupParent(xMainBorder); this.setBackupParent(xMainBorder);
XWCardTitleLayout titlePart = this.initTitlePart(widgetName, xMainBorder); XWCardTitleLayout titlePart = this.initTitlePart(widgetName, xMainBorder);
@ -398,13 +398,13 @@ public class XWCardLayout extends XLayoutContainer {
//初始化样式 //初始化样式
@Override @Override
protected void initStyle() { protected void initStyle() {
TextFetcher style = toData().getBorderStyle(); BorderPacker style = toData().getBorderStyle();
initBorderTitleStyle(style); initBorderTitleStyle(style);
initBorderStyle(); initBorderStyle();
clearOrShowTitleLayout(ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)); clearOrShowTitleLayout(ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE));
} }
private void initBorderTitleStyle(TextFetcher style) { private void initBorderTitleStyle(BorderPacker style) {
//初始化默认标题样式 //初始化默认标题样式
if (!initFlag) { if (!initFlag) {
return; return;
@ -412,7 +412,7 @@ public class XWCardLayout extends XLayoutContainer {
style.setType(LayoutBorderStyle.TITLE); style.setType(LayoutBorderStyle.TITLE);
style.setBorder(Constants.LINE_THIN); style.setBorder(Constants.LINE_THIN);
WidgetTitle widgetTitle = WidgetTitle.as(style); TitlePacker widgetTitle = style.getTitle();
widgetTitle.setBackground(ColorBackground.getInstance(TITLE_COLOR)); widgetTitle.setBackground(ColorBackground.getInstance(TITLE_COLOR));
initFlag = false; initFlag = false;
} }

4
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java

@ -38,7 +38,7 @@ import com.fr.form.ui.container.cardlayout.WCardTitleLayout;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.TextFetcher; import com.fr.general.act.BorderPacker;
import com.fr.share.ShareConstants; import com.fr.share.ShareConstants;
import com.fr.stable.Constants; import com.fr.stable.Constants;
@ -165,7 +165,7 @@ public class XWCardMainBorderLayout extends XWBorderLayout {
String tabpaneName = cardLayout.getWidgetName(); String tabpaneName = cardLayout.getWidgetName();
if (!wCardTagLayout.isNewTab()) { if (!wCardTagLayout.isNewTab()) {
wCardTagLayout.setWidgetName(tabpaneName); wCardTagLayout.setWidgetName(tabpaneName);
TextFetcher borderStyle = cardLayout.getBorderStyle(); BorderPacker borderStyle = cardLayout.getBorderStyle();
if(borderStyle != null){ if(borderStyle != null){
//新tab默认都有标题 //新tab默认都有标题
borderStyle.setType(LayoutBorderStyle.TITLE); borderStyle.setType(LayoutBorderStyle.TITLE);

6
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java

@ -32,9 +32,9 @@ import com.fr.form.ui.container.WCardLayout;
import com.fr.form.ui.container.WTabDisplayPosition; import com.fr.form.ui.container.WTabDisplayPosition;
import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.form.ui.container.cardlayout.WTabFitLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.act.BorderPacker;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.TextFetcher;
import com.fr.general.cardtag.DefaultTemplateStyle; import com.fr.general.cardtag.DefaultTemplateStyle;
import javax.swing.border.Border; import javax.swing.border.Border;
@ -360,8 +360,8 @@ public class XWCardTagLayout extends XWHorizontalBoxLayout {
if (this.cardLayout == null) { if (this.cardLayout == null) {
initCardLayout(); initCardLayout();
} }
TextFetcher borderStyle = this.cardLayout.toData().getBorderStyle(); BorderPacker borderStyle = this.cardLayout.toData().getBorderStyle();
FRFont f = borderStyle.getFrFont(); FRFont f = borderStyle.getTitle().getFrFont();
FontMetrics fm = GraphHelper.getFontMetrics(f); FontMetrics fm = GraphHelper.getFontMetrics(f);
switch (wCardTagLayout.getTextDirection()) { switch (wCardTagLayout.getTextDirection()) {

31
designer-form/src/main/java/com/fr/design/gui/xpane/LayoutBorderPane.java

@ -38,32 +38,17 @@ import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.WidgetTitle; import com.fr.form.ui.WidgetTitle;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.act.TitlePacker;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.AbstractButton; import javax.swing.*;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.ButtonModel;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JToggleButton;
import javax.swing.border.Border; import javax.swing.border.Border;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import javax.swing.plaf.basic.BasicToggleButtonUI; import javax.swing.plaf.basic.BasicToggleButtonUI;
import java.awt.BorderLayout; import java.awt.*;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
@ -546,7 +531,7 @@ public class LayoutBorderPane extends BasicPane {
style.setColor(currentLineColorPane.getColor()); style.setColor(currentLineColorPane.getColor());
style.setBackground(backgroundPane.update()); style.setBackground(backgroundPane.update());
style.setAlpha((float)(numberDragPane.updateBean()/maxNumber)); style.setAlpha((float)(numberDragPane.updateBean()/maxNumber));
WidgetTitle title = style.getTitle() == null ? new WidgetTitle() : style.getTitle(); TitlePacker title = style.getTitle() == null ? new WidgetTitle() : style.getTitle();
title.setTextObject(formulaPane.updateBean()); title.setTextObject(formulaPane.updateBean());
FRFont frFont = title.getFrFont(); FRFont frFont = title.getFrFont();
frFont = frFont.applySize((Integer)fontSizeComboBox.getSelectedItem()); frFont = frFont.applySize((Integer)fontSizeComboBox.getSelectedItem());
@ -644,10 +629,10 @@ public class LayoutBorderPane extends BasicPane {
} }
protected void populateTitle(){ protected void populateTitle(){
WidgetTitle widgetTitle = borderStyle == null ? new WidgetTitle() : borderStyle.getTitle(); TitlePacker widgetTitle = borderStyle == null ? new WidgetTitle() : borderStyle.getTitle();
widgetTitle = widgetTitle == null ? new WidgetTitle() : widgetTitle; widgetTitle = widgetTitle == null ? new WidgetTitle() : widgetTitle;
populateFourmula(widgetTitle); populateFormula(widgetTitle);
populateFont(widgetTitle); populateFont(widgetTitle);
underline.addMouseListener(new MouseAdapter() { underline.addMouseListener(new MouseAdapter() {
@ -683,7 +668,7 @@ public class LayoutBorderPane extends BasicPane {
paintPreviewPane(); paintPreviewPane();
} }
protected void populateFont(WidgetTitle widgetTitle){ protected void populateFont(TitlePacker widgetTitle){
FRFont frFont = widgetTitle.getFrFont(); FRFont frFont = widgetTitle.getFrFont();
this.fontSizeComboBox.setSelectedItem(frFont.getSize()); this.fontSizeComboBox.setSelectedItem(frFont.getSize());
this.fontSizeComboBox.addItemListener(new ItemListener() { this.fontSizeComboBox.addItemListener(new ItemListener() {
@ -756,7 +741,7 @@ public class LayoutBorderPane extends BasicPane {
} }
private void populateFourmula(WidgetTitle widgetTitle) { private void populateFormula(TitlePacker widgetTitle) {
this.formulaPane.populateBean(widgetTitle.getTextObject().toString()); this.formulaPane.populateBean(widgetTitle.getTextObject().toString());
this.formulaPane.getUITextField().getDocument() this.formulaPane.getUITextField().getDocument()
.addDocumentListener(new DocumentListener() { .addDocumentListener(new DocumentListener() {

6
designer-form/src/main/java/com/fr/design/gui/xpane/LayoutBorderPreviewPane.java

@ -7,10 +7,10 @@ import com.fr.base.background.ColorBackground;
import com.fr.design.designer.creator.cardlayout.XCardSwitchButton; import com.fr.design.designer.creator.cardlayout.XCardSwitchButton;
import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextarea.UITextArea;
import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.WidgetTitle;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.act.TitlePacker;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -126,7 +126,7 @@ public class LayoutBorderPreviewPane extends JPanel{
g2d.setColor(new Color(237, 237, 237)); g2d.setColor(new Color(237, 237, 237));
} }
g2d.setFont(frFont.applyResolutionNP(resolution)); g2d.setFont(frFont.applyResolutionNP(resolution));
WidgetTitle title = borderStyle.getTitle(); TitlePacker title = borderStyle.getTitle();
String paintText = title.getTextObject().toString(); String paintText = title.getTextObject().toString();
int startX1 = 0; int startX1 = 0;
int startY = 0; int startY = 0;
@ -158,7 +158,7 @@ public class LayoutBorderPreviewPane extends JPanel{
GraphHelper.draw(g,double2, borderStyle.getBorder()); GraphHelper.draw(g,double2, borderStyle.getBorder());
} }
private void drawTabBack(Graphics2D g2d, Graphics g, WidgetTitle title, FontMetrics fm, int startX1, int startY){ private void drawTabBack(Graphics2D g2d, Graphics g, TitlePacker title, FontMetrics fm, int startX1, int startY){
Dimension d = getSize(); Dimension d = getSize();
String paintText = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Title")+TAB_ZERO; String paintText = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Title")+TAB_ZERO;

Loading…
Cancel
Save