Browse Source

Merging in latest from upstream (BA/design:refs/heads/dev)

* commit 'ff8a12b213f2d80cd7887c4345efe97a861ca2bf':
  1
  无jiar 国际化文件内容修改
  单元格配置界面接口
  调整
  REPORT-576 tabpane属性添加,添加一个轮播属性
  甘特图数据配置界面
  REPORT-576 font代码调整
  REPORT-576 tab中button内容自动扩展bug修复
  delete
  delete
master
daniel 8 years ago
parent
commit
67752d40a7
  1. BIN
      designer_base/src/com/fr/design/images/buttonicon/delete.png
  2. 3
      designer_base/src/com/fr/design/locale/designer.properties
  3. 3
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  4. 3
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  5. 3
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  6. 3
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  7. 3
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  8. 12
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java
  9. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/ReportDataPane.java
  10. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java
  11. 23
      designer_form/src/com/fr/design/designer/creator/XLayoutContainer.java
  12. 4
      designer_form/src/com/fr/design/designer/creator/cardlayout/XCardAddButton.java
  13. 30
      designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java
  14. 95
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java
  15. 12
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java
  16. 24
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java

BIN
designer_base/src/com/fr/design/images/buttonicon/delete.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

3
designer_base/src/com/fr/design/locale/designer.properties

@ -518,3 +518,6 @@ FR-Designer_Background_Gradient_Color=
FR-Designer_Background_Image= FR-Designer_Background_Image=
FR-Designer_Background_Clear= FR-Designer_Background_Clear=
FR-Designer_Background_Image_Select= FR-Designer_Background_Image_Select=
FR-Designer_Tab_carousel=
FR-Designer_setCarousel=
FR-Designer_carouselInterval=

3
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -518,3 +518,6 @@ FR-Designer_Background_Gradient_Color=Gradient Color
FR-Designer_Background_Image=Image FR-Designer_Background_Image=Image
FR-Designer_Background_Clear=Clear FR-Designer_Background_Clear=Clear
FR-Designer_Background_Image_Select=Select Picture FR-Designer_Background_Image_Select=Select Picture
FR-Designer_Tab_carousel=
FR-Designer_setCarousel=
FR-Designer_carouselInterval=

3
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -497,3 +497,6 @@ FR-Designer_Background_Gradient_Color=
FR-Designer_Background_Image= FR-Designer_Background_Image=
FR-Designer_Background_Clear= FR-Designer_Background_Clear=
FR-Designer_Background_Image_Select= FR-Designer_Background_Image_Select=
FR-Designer_Tab_carousel=
FR-Designer_setCarousel=
FR-Designer_carouselInterval=

3
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -492,3 +492,6 @@ FR-Designer_Background_Gradient_Color=
FR-Designer_Background_Image= FR-Designer_Background_Image=
FR-Designer_Background_Clear= FR-Designer_Background_Clear=
FR-Designer_Background_Image_Select= FR-Designer_Background_Image_Select=
FR-Designer_Tab_carousel=
FR-Designer_setCarousel=
FR-Designer_carouselInterval=

3
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -522,3 +522,6 @@ FR-Designer_Background_Gradient_Color=\u6E10\u53D8\u8272
FR-Designer_Background_Image=\u56FE\u7247 FR-Designer_Background_Image=\u56FE\u7247
FR-Designer_Background_Clear=\u6E05\u9664 FR-Designer_Background_Clear=\u6E05\u9664
FR-Designer_Background_Image_Select=\u9009\u62E9\u56FE\u7247 FR-Designer_Background_Image_Select=\u9009\u62E9\u56FE\u7247
FR-Designer_Tab_carousel=tab\u8F6E\u64AD
FR-Designer_setCarousel=\u5F00\u542F\u8F6E\u64AD
FR-Designer_carouselInterval=\u8F6E\u64AD\u95F4\u9694

3
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -510,3 +510,6 @@ FR-Designer_Background_Gradient_Color=
FR-Designer_Background_Image= FR-Designer_Background_Image=
FR-Designer_Background_Clear= FR-Designer_Background_Clear=
FR-Designer_Background_Image_Select= FR-Designer_Background_Image_Select=
FR-Designer_Tab_carousel=
FR-Designer_setCarousel=
FR-Designer_carouselInterval=

12
designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java

@ -70,8 +70,8 @@ public class NormalChartDataPane extends DataContentsPane {
@Override @Override
protected List<FurtherBasicBeanPane<? extends ChartCollection>> initPaneList() { protected List<FurtherBasicBeanPane<? extends ChartCollection>> initPaneList() {
tableDataPane = new TableDataPane(parent); tableDataPane = getTableDataPane(parent);
reportDataPane = new ReportDataPane(parent); reportDataPane = getReportDataPane(parent);
List<FurtherBasicBeanPane<? extends ChartCollection>> paneList = new ArrayList<FurtherBasicBeanPane<? extends ChartCollection>>(); List<FurtherBasicBeanPane<? extends ChartCollection>> paneList = new ArrayList<FurtherBasicBeanPane<? extends ChartCollection>>();
paneList.add(tableDataPane); paneList.add(tableDataPane);
paneList.add(reportDataPane); paneList.add(reportDataPane);
@ -96,6 +96,14 @@ public class NormalChartDataPane extends DataContentsPane {
} }
protected ReportDataPane getReportDataPane(ChartDataPane parent) {
return new ReportDataPane(parent);
}
protected TableDataPane getTableDataPane(ChartDataPane chartDataPane) {
return new TableDataPane(chartDataPane);
}
/** /**
* 更新界面 数据内容 * 更新界面 数据内容
*/ */

2
designer_chart/src/com/fr/design/mainframe/chart/gui/data/ReportDataPane.java

@ -21,7 +21,7 @@ public class ReportDataPane extends FurtherBasicBeanPane<ChartCollection>{
this.parent = parent; this.parent = parent;
} }
private AbstractReportDataContentPane getContentPane(Chart chart) { protected AbstractReportDataContentPane getContentPane(Chart chart) {
if(chart == null) { if(chart == null) {
return null; return null;
} }

2
designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java

@ -69,7 +69,7 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
} }
} }
private AbstractTableDataContentPane getContentPane(Plot plot) { protected AbstractTableDataContentPane getContentPane(Plot plot) {
return ChartTypeInterfaceManager.getInstance().getTableDataSourcePane(plot, parent); return ChartTypeInterfaceManager.getInstance().getTableDataSourcePane(plot, parent);
} }

23
designer_form/src/com/fr/design/designer/creator/XLayoutContainer.java

@ -10,8 +10,6 @@ import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.widget.editors.PaddingMarginEditor; import com.fr.design.mainframe.widget.editors.PaddingMarginEditor;
import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor;
import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer;
import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer;
import com.fr.design.parameter.ParameterBridge; import com.fr.design.parameter.ParameterBridge;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.WLayout;
@ -81,6 +79,27 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme
}; };
} }
/**
* 控件名属性
* @return
* @throws IntrospectionException
*/
public CRPropertyDescriptor createWidgetNameDescriptor() throws IntrospectionException {
return new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter
.getLocText("FR-Designer_Form-Widget_Name"));
}
/**
* 边距属性
* @return
* @throws IntrospectionException
*/
public CRPropertyDescriptor createMarginDescriptor() throws IntrospectionException {
return new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class)
.setI18NName(Inter.getLocText("FR-Designer_Layout-Padding"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced");
}
/** /**
* 返回对应的wlayout * 返回对应的wlayout
* @return wlayout控件 * @return wlayout控件

4
designer_form/src/com/fr/design/designer/creator/cardlayout/XCardAddButton.java

@ -147,11 +147,11 @@ public class XCardAddButton extends XButton{
//设置标题 //设置标题
titleButton.setText(getTabTitleName()); titleButton.setText(getTabTitleName());
titleButton.setInitialBackground(ColorBackground.getInstance(Color.WHITE)); titleButton.setInitialBackground(ColorBackground.getInstance(Color.WHITE));
XCardSwitchButton showButton = new XCardSwitchButton(titleButton,dimension,cardLayout,tagLayout); XCardSwitchButton showButton = new XCardSwitchButton(titleButton, dimension, cardLayout, tagLayout);
titleButton.setCustomStyle(true);
titleButton.setShowButton(true); titleButton.setShowButton(true);
showButton.setBackupParent(tagLayout); showButton.setBackupParent(tagLayout);
this.tagLayout.setCurrentCard(titleButton); this.tagLayout.setCurrentCard(titleButton);
this.tagLayout.setTabFitIndex(index); this.tagLayout.setTabFitIndex(index);
this.tagLayout.add(showButton); this.tagLayout.add(showButton);

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

@ -6,12 +6,12 @@ package com.fr.design.designer.creator.cardlayout;
import java.awt.*; import java.awt.*;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.util.HashMap; import java.util.*;
import java.util.Map;
import javax.swing.*; import javax.swing.*;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper;
import com.fr.base.background.ColorBackground; import com.fr.base.background.ColorBackground;
import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.ComponentAdapter; import com.fr.design.designer.beans.ComponentAdapter;
@ -32,7 +32,6 @@ import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.Inter; import com.fr.general.Inter;
import sun.font.FontDesignMetrics;
/** /**
* *
@ -58,6 +57,9 @@ public class XCardSwitchButton extends XButton {
private static final int RIGHT_OFFSET = 15; private static final int RIGHT_OFFSET = 15;
private static final int TOP_OFFSET = 25; private static final int TOP_OFFSET = 25;
//这边先不计算button的高度,涉及到layout那边的整体高度,先用之前的固定高度
private static final int DEFAULT_BUTTON_HEIGHT = 36;
// tab按钮里的字体因为按钮内部的布局看起来比正常的要小,加个调整量 // tab按钮里的字体因为按钮内部的布局看起来比正常的要小,加个调整量
private static final int FONT_SIZE_ADJUST = 2; private static final int FONT_SIZE_ADJUST = 2;
@ -70,7 +72,6 @@ public class XCardSwitchButton extends XButton {
private Background selectBackground; private Background selectBackground;
private boolean isCustomStyle; private boolean isCustomStyle;
private Icon closeIcon = MOUSE_COLSE; private Icon closeIcon = MOUSE_COLSE;
public XWCardTagLayout getTagLayout() { public XWCardTagLayout getTagLayout() {
@ -169,6 +170,7 @@ public class XCardSwitchButton extends XButton {
editingMouseListener.startEditing(this, editingMouseListener.startEditing(this,
adapter.getDesignerEditor(), adapter); adapter.getDesignerEditor(), adapter);
} }
setTabsAndAdjust();
} }
//删除card,同时修改其他switchbutton和tabfit的index //删除card,同时修改其他switchbutton和tabfit的index
@ -258,6 +260,7 @@ public class XCardSwitchButton extends XButton {
public void paintComponent(Graphics g) { public void paintComponent(Graphics g) {
super.paintComponent(g); super.paintComponent(g);
setTabsAndAdjust();
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
drawBackgorund(); drawBackgorund();
drawTitle(); drawTitle();
@ -351,7 +354,7 @@ public class XCardSwitchButton extends XButton {
CardSwitchButton tempCard = (CardSwitchButton) temp.toData(); CardSwitchButton tempCard = (CardSwitchButton) temp.toData();
String tempText = tempCard.getText(); String tempText = tempCard.getText();
Font f = ((CardSwitchButton)this.toData()).getFont(); Font f = ((CardSwitchButton)this.toData()).getFont();
FontMetrics fm = FontDesignMetrics.getMetrics(f); FontMetrics fm = GraphHelper.getFontMetrics(f);
cardWidth.put(i,fm.stringWidth(tempText)); cardWidth.put(i,fm.stringWidth(tempText));
cardHeight.put(i,fm.getHeight()); cardHeight.put(i,fm.getHeight());
} }
@ -359,22 +362,27 @@ public class XCardSwitchButton extends XButton {
} }
public void adjustTabs(int tabLength, Map<Integer, Integer> width, Map<Integer, Integer> height) { public void adjustTabs(int tabLength, Map<Integer, Integer> width, Map<Integer, Integer> height) {
if (width == null) {
return;
}
int tempX = 0; int tempX = 0;
for (int i = 0; i < tabLength; i++) { for (int i = 0; i < tabLength; i++) {
Rectangle rectangle = this.tagLayout.getComponent(i).getBounds(); Rectangle rectangle = this.tagLayout.getComponent(i).getBounds();
Integer cardWidth = width.get(i) + SIDE_OFFSET; Integer cardWidth = width.get(i) + SIDE_OFFSET;
Integer cardHeight = height.get(i) + HEIGHT_OFFSET; //先用这边的固定高度
Integer cardHeight = DEFAULT_BUTTON_HEIGHT;
rectangle.setSize(cardWidth, cardHeight); rectangle.setSize(cardWidth, cardHeight);
rectangle.setBounds(tempX, 0, cardWidth, cardHeight); rectangle.setBounds(tempX, 0, cardWidth, cardHeight);
tempX += cardWidth; tempX += cardWidth;
this.tagLayout.getComponent(i).setBounds(rectangle); this.tagLayout.getComponent(i).setBounds(rectangle);
Dimension dimension = new Dimension(); Dimension dimension = new Dimension();
dimension.setSize(cardWidth, cardHeight); dimension.setSize(cardWidth, cardHeight);
this.getContentLabel().setSize(dimension);
this.setSize(dimension);
XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i); XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i);
CardSwitchButton tempCard = (CardSwitchButton) temp.toData(); UILabel label = temp.getContentLabel();
tempCard.setDefaultWidth(cardWidth); label.setSize(dimension);
temp.setContentLabel(label);
temp.setSize(dimension);
temp.setPreferredSize(new Dimension(cardWidth, cardHeight));
} }
} }

95
designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java

@ -6,13 +6,16 @@ package com.fr.design.designer.creator.cardlayout;
import com.fr.base.background.ColorBackground; import com.fr.base.background.ColorBackground;
import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRCardLayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRCardLayoutAdapter;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.beans.models.SelectionModel;
import com.fr.design.designer.creator.*; import com.fr.design.designer.creator.*;
import com.fr.design.form.layout.FRCardLayout; import com.fr.design.form.layout.FRCardLayout;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.editors.BooleanEditor;
import com.fr.design.mainframe.widget.editors.CardTagWLayoutBorderStyleEditor; import com.fr.design.mainframe.widget.editors.CardTagWLayoutBorderStyleEditor;
import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer; import com.fr.design.mainframe.widget.editors.DoubleEditor;
import com.fr.form.ui.*; import com.fr.form.ui.*;
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;
@ -22,6 +25,7 @@ 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.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
@ -39,6 +43,8 @@ public class XWCardLayout extends XLayoutContainer {
private CardLayout cardLayout; private CardLayout cardLayout;
private boolean initFlag = true; private boolean initFlag = true;
private static final int NORTH = 0; private static final int NORTH = 0;
private FormDesigner designer;
//默认蓝色标题背景 //默认蓝色标题背景
private static final Color TITLE_COLOR = new Color(51, 132, 240); private static final Color TITLE_COLOR = new Color(51, 132, 240);
@ -197,9 +203,9 @@ public class XWCardLayout extends XLayoutContainer {
CardSwitchButton firstBtn = new CardSwitchButton(widgetName); CardSwitchButton firstBtn = new CardSwitchButton(widgetName);
firstBtn.setText(Inter.getLocText("FR-Designer_Title") + 0); firstBtn.setText(Inter.getLocText("FR-Designer_Title") + 0);
firstBtn.setInitialBackground(ColorBackground.getInstance(Color.WHITE)); firstBtn.setInitialBackground(ColorBackground.getInstance(Color.WHITE));
xTag.setCurrentCard(firstBtn);
XCardSwitchButton xFirstBtn = new XCardSwitchButton(firstBtn, new Dimension(CardSwitchButton.DEF_WIDTH, -1),this,xTag);
firstBtn.setCustomStyle(true); firstBtn.setCustomStyle(true);
xTag.setCurrentCard(firstBtn);
XCardSwitchButton xFirstBtn = new XCardSwitchButton(firstBtn, new Dimension(CardSwitchButton.DEF_WIDTH, -1), this, xTag);
xFirstBtn.setBackupParent(xTag); xFirstBtn.setBackupParent(xTag);
return xFirstBtn; return xFirstBtn;
@ -272,27 +278,68 @@ public class XWCardLayout extends XLayoutContainer {
* @throws IntrospectionException * @throws IntrospectionException
*/ */
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
return new CRPropertyDescriptor[] { CRPropertyDescriptor[] crp = ((WCardLayout) data).isCarousel() ? getisCarousel() : getisnotCarousel();
new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter return ArrayUtils.addAll(getDefaultDescriptor(), crp);
.getLocText("FR-Designer_Form-Widget_Name")).setPropertyChangeListener(new PropertyChangeAdapter(){ }
@Override public CRPropertyDescriptor[] getisCarousel() throws IntrospectionException {
public void propertyChange(){ return new CRPropertyDescriptor[] {
WCardLayout cardLayout = toData(); new CRPropertyDescriptor("carousel", this.data.getClass())
changeRalateSwitchCardname(cardLayout.getWidgetName()); .setEditorClass(BooleanEditor.class)
} .setI18NName(Inter.getLocText("FR-Designer_setCarousel"))
}), .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "FR-Designer_Tab_carousel")
new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( .setPropertyChangeListener(new PropertyChangeAdapter() {
CardTagWLayoutBorderStyleEditor.class).setI18NName( @Override
Inter.getLocText("FR-Engine_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") public void propertyChange() {
.setPropertyChangeListener(new PropertyChangeAdapter() { designer = WidgetPropertyPane.getInstance().getEditingFormDesigner();
designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_EDITED);
@Override }
public void propertyChange() { }),
initStyle(); new CRPropertyDescriptor("carouselInterval", this.data.getClass())
} .setEditorClass(DoubleEditor.class)
}), .setI18NName(Inter.getLocText("FR-Designer_carouselInterval"))
}; .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "FR-Designer_Tab_carousel")
};
}
public CRPropertyDescriptor[] getisnotCarousel() throws IntrospectionException {
return new CRPropertyDescriptor[] {
new CRPropertyDescriptor("carousel", this.data.getClass())
.setEditorClass(BooleanEditor.class)
.setI18NName(Inter.getLocText("FR-Designer_setCarousel"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "FR-Designer_Tab_carousel")
.setPropertyChangeListener(new PropertyChangeAdapter() {
@Override
public void propertyChange() {
designer = WidgetPropertyPane.getInstance().getEditingFormDesigner();
designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_EDITED);
}
})
};
}
public CRPropertyDescriptor[] getDefaultDescriptor() throws IntrospectionException {
return new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter
.getLocText("FR-Designer_Form-Widget_Name")).setPropertyChangeListener(new PropertyChangeAdapter(){
@Override
public void propertyChange(){
WCardLayout cardLayout = toData();
changeRalateSwitchCardname(cardLayout.getWidgetName());
}
}),
new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass(
CardTagWLayoutBorderStyleEditor.class).setI18NName(
Inter.getLocText("FR-Engine_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
.setPropertyChangeListener(new PropertyChangeAdapter() {
@Override
public void propertyChange() {
initStyle();
}
})
};
} }
//初始化样式 //初始化样式

12
designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java

@ -163,18 +163,6 @@ public class XWCardTagLayout extends XWHorizontalBoxLayout {
* void * void
*/ */
public void adjustComponentWidth(){ public void adjustComponentWidth(){
int btnNum = this.getComponentCount();
int tagLayoutWidth = this.getWidth();
int allBtnWidth = btnNum * CardSwitchButton.DEF_WIDTH + btnNum;
int size = CardSwitchButton.DEF_WIDTH;
if(tagLayoutWidth - allBtnWidth < CardSwitchButton.DEF_WIDTH){
size = (tagLayoutWidth - CardSwitchButton.DEF_WIDTH - btnNum)/btnNum;
}
WCardTagLayout layout = (WCardTagLayout)this.toData();
for(int i=0;i<btnNum;i++){
CardSwitchButton button = layout.getSwitchButton(i);
layout.setWidthAtWidget(button, size);
}
} }

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

@ -27,6 +27,7 @@ import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
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.FRFont;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
@ -41,12 +42,12 @@ public class XWTabFitLayout extends XWFitLayout {
private static final int MIN_SIZE = 1; private static final int MIN_SIZE = 1;
// tab布局在拖拽导致的缩放里(含间隔时),如果拖拽宽高大于组件宽高,会导致调整的时候找不到原来的组件 // tab布局在拖拽导致的缩放里(含间隔时),如果拖拽宽高大于组件宽高,会导致调整的时候找不到原来的组件
// 这里先将拖拽之前的宽高先做备份 // 这里先将拖拽之前的宽高先做备份
public static final Color NORMAL_GRAL = new Color(236,236,236); private static final Color NORMAL_GRAL = new Color(236,236,236);
public static final Color CHOOSED_GRAL = new Color(222,222,222);
private Dimension referDim; private Dimension referDim;
private Background initialBackground; private Background initialBackground;
private Background overBackground; private Background overBackground;
private Background clickBackground; private Background clickBackground;
private FRFont font;
private XCardSwitchButton xCardSwitchButton; private XCardSwitchButton xCardSwitchButton;
public Dimension getReferDim() { public Dimension getReferDim() {
@ -81,6 +82,15 @@ public class XWTabFitLayout extends XWFitLayout {
this.clickBackground = clickBackground; this.clickBackground = clickBackground;
} }
@Override
public FRFont getFont() {
return font;
}
public void setFont(FRFont font) {
this.font = font;
}
public XCardSwitchButton getxCardSwitchButton() { public XCardSwitchButton getxCardSwitchButton() {
return xCardSwitchButton; return xCardSwitchButton;
} }
@ -105,7 +115,7 @@ public class XWTabFitLayout extends XWFitLayout {
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
checkButonType(); checkButonType();
CRPropertyDescriptor[] crp = ((WTabFitLayout) data).isCustomStyle() ? getisCustomStyle() : getisnotCustomStyle(); CRPropertyDescriptor[] crp = ((WTabFitLayout) data).isCustomStyle() ? getisCustomStyle() : getisnotCustomStyle();
return ArrayUtils.addAll(super.supportedDescriptor(), crp); return ArrayUtils.addAll(defaultDescriptor(), crp);
} }
protected CRPropertyDescriptor[] getisCustomStyle() throws IntrospectionException { protected CRPropertyDescriptor[] getisCustomStyle() throws IntrospectionException {
@ -195,6 +205,14 @@ public class XWTabFitLayout extends XWFitLayout {
return crPropertyDescriptors[i]; return crPropertyDescriptors[i];
} }
protected CRPropertyDescriptor[] defaultDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] crPropertyDescriptors = {
super.createWidgetNameDescriptor(),
super.createMarginDescriptor()
};
return crPropertyDescriptors;
}
private void checkButonType() { private void checkButonType() {
if (this.xCardSwitchButton == null) { if (this.xCardSwitchButton == null) {
return; return;

Loading…
Cancel
Save