Browse Source

merge

master
plough 8 years ago
parent
commit
6ceca72b5d
  1. BIN
      designer_base/src/com/fr/design/images/buttonicon/delete.png
  2. 13
      designer_base/src/com/fr/design/locale/designer.properties
  3. 11
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  4. 13
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  5. 11
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  6. 13
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  7. 11
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  8. 53
      designer_base/src/com/fr/design/style/background/BackgroundButtonPane.java
  9. 48
      designer_base/src/com/fr/design/style/background/BackgroundFactory.java
  10. 55
      designer_base/src/com/fr/design/style/background/impl/ImageBackgroundPane.java
  11. 5
      designer_base/src/com/fr/design/style/background/impl/ImageBackgroundPane4Browser.java
  12. 79
      designer_base/src/com/fr/design/style/background/impl/ImageButtonBackgroundPane.java
  13. 12
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java
  14. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/ReportDataPane.java
  15. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java
  16. 23
      designer_form/src/com/fr/design/designer/creator/XLayoutContainer.java
  17. 14
      designer_form/src/com/fr/design/designer/creator/cardlayout/XCardAddButton.java
  18. 73
      designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java
  19. 93
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java
  20. 12
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java
  21. 24
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java
  22. 13
      designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleImgBackgroundEditor.java

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

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

@ -516,4 +516,15 @@ FR-Designer_Unload_Check=Prompt users when leave without submitting
FR-Designer_ReportColumns_Columns_Optional=
FR-Designer_Row_Icon_File_Name=row.png
FR-Designer_Center_Display=Center
FR-Designer_Left_Display=Left
FR-Designer_Left_Display=Left
FR-Designer_Background_Null=
FR-Designer_Background_Color=
FR-Designer_Background_Texture=
FR-Designer_Background_Pattern=
FR-Designer_Background_Gradient_Color=
FR-Designer_Background_Image=
FR-Designer_Background_Clear=
FR-Designer_Background_Image_Select=
FR-Designer_Tab_carousel=
FR-Designer_setCarousel=
FR-Designer_carouselInterval=

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

@ -517,3 +517,14 @@ FR-Designer_ReportColumns_Columns_Optional=\u3000
FR-Designer_Row_Icon_File_Name=row_en.png
FR-Designer_Center_Display=Center
FR-Designer_Left_Display=Left
FR-Designer_Background_Null=No Background
FR-Designer_Background_Color=Color
FR-Designer_Background_Texture=Texture
FR-Designer_Background_Pattern=Pattern
FR-Designer_Background_Gradient_Color=Gradient Color
FR-Designer_Background_Image=Image
FR-Designer_Background_Clear=Clear
FR-Designer_Background_Image_Select=Select Picture
FR-Designer_Tab_carousel=
FR-Designer_setCarousel=
FR-Designer_carouselInterval=

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

@ -495,4 +495,15 @@ FR-Designer_Unload_Check=\u63D0\u51FA\u305B\u305A\u306B\u30D2\u30F3\u30C8
FR-Designer_ReportColumns_Columns_Optional=\u6BB5\u7D44\u307F
FR-Designer_Row_Icon_File_Name=row.png
FR-Designer_Center_Display=\u4E2D\u592E\u63C3\u3048\u8868\u793A
FR-Designer_Left_Display=\u5DE6\u8868\u793A
FR-Designer_Left_Display=\u5DE6\u8868\u793A
FR-Designer_Background_Null=
FR-Designer_Background_Color=
FR-Designer_Background_Texture=
FR-Designer_Background_Pattern=
FR-Designer_Background_Gradient_Color=
FR-Designer_Background_Image=
FR-Designer_Background_Clear=
FR-Designer_Background_Image_Select=
FR-Designer_Tab_carousel=
FR-Designer_setCarousel=
FR-Designer_carouselInterval=

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

@ -491,3 +491,14 @@ FR-Designer_ReportColumns_Columns_Optional=\uC140\uB098\uB204\uAE30
FR-Designer_Row_Icon_File_Name=row.png
FR-Designer_Center_Display=\uAC00\uC6B4\uB370\uC815\uB82C\uBCF4\uC774\uAE30
FR-Designer_Left_Display=\uC67C\uCABD\uBCF4\uC774\uAE30
FR-Designer_Background_Null=
FR-Designer_Background_Color=
FR-Designer_Background_Texture=
FR-Designer_Background_Pattern=
FR-Designer_Background_Gradient_Color=
FR-Designer_Background_Image=
FR-Designer_Background_Clear=
FR-Designer_Background_Image_Select=
FR-Designer_Tab_carousel=
FR-Designer_setCarousel=
FR-Designer_carouselInterval=

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

@ -520,4 +520,15 @@ FR-Designer_Unload_Check=\u672A\u63D0\u4EA4\u79BB\u5F00\u63D0\u793A
FR-Designer_ReportColumns_Columns_Optional=\u5206\u680F
FR-Designer_Row_Icon_File_Name=row.png
FR-Designer_Center_Display=\u5C45\u4E2D\u5C55\u793A
FR-Designer_Left_Display=\u5DE6\u5C55\u793A
FR-Designer_Left_Display=\u5DE6\u5C55\u793A
FR-Designer_Background_Null=\u6CA1\u6709\u80CC\u666F
FR-Designer_Background_Color=\u989C\u8272
FR-Designer_Background_Texture=\u7EB9\u7406
FR-Designer_Background_Pattern=\u56FE\u6848
FR-Designer_Background_Gradient_Color=\u6E10\u53D8\u8272
FR-Designer_Background_Image=\u56FE\u7247
FR-Designer_Background_Clear=\u6E05\u9664
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

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

@ -509,3 +509,14 @@ FR-Designer_ReportColumns_Columns_Optional=\u5831\u8868\u6B04\u4F4D
FR-Designer_Row_Icon_File_Name=row.png
FR-Designer_Center_Display=\u7F6E\u4E2D\u986F\u793A
FR-Designer_Left_Display=\u5DE6\u986F\u793A
FR-Designer_Background_Null=
FR-Designer_Background_Color=
FR-Designer_Background_Texture=
FR-Designer_Background_Pattern=
FR-Designer_Background_Gradient_Color=
FR-Designer_Background_Image=
FR-Designer_Background_Clear=
FR-Designer_Background_Image_Select=
FR-Designer_Tab_carousel=
FR-Designer_setCarousel=
FR-Designer_carouselInterval=

53
designer_base/src/com/fr/design/style/background/BackgroundButtonPane.java

@ -0,0 +1,53 @@
package com.fr.design.style.background;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.Background;
import com.fr.general.Inter;
/**
* Created by ibm on 2017/1/5.
*/
public class BackgroundButtonPane extends BackgroundPane {
public BackgroundButtonPane() {
super();
}
protected void initTabPane() {
int index = 0;
for (Class<? extends Background> key : BackgroundFactory.buttonKindsOfKey()) {
BackgroundUIWrapper wrapper = BackgroundFactory.getButtonWrapper(key);
wrapper.setIndex(index++);
tabbedPane.addTab(Inter.getLocText(wrapper.getTitle()), FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane());
}
}
protected BackgroundUIWrapper getBackgroundUIWrapper(Background background) {
return BackgroundFactory.getButtonWrapper(background == null ? null : background.getClass());
}
protected BackgroundDetailPane getTabItemPane(Background background, int index) {
BackgroundDetailPane quickPane = cacheMap.get(index);
if (quickPane == null) {
quickPane = BackgroundFactory.createButtonIfAbsent(background == null ? null : background.getClass());
quickPane.addChangeListener(backgroundChangeListener);
cacheMap.put(index, quickPane);
}
tabbedPane.setComponentAt(index, quickPane);
tabbedPane.setSelectedIndex(index);
return quickPane;
}
protected BackgroundDetailPane getTabItemPaneByIndex(int index) {
BackgroundDetailPane quickPane = cacheMap.get(index);
if (quickPane == null) {
quickPane = BackgroundFactory.createButtonIfAbsent(index);
tabbedPane.setComponentAt(index, quickPane);
cacheMap.put(index, quickPane);
quickPane.addChangeListener(backgroundChangeListener);
}
return quickPane;
}
}

48
designer_base/src/com/fr/design/style/background/BackgroundFactory.java

@ -3,7 +3,6 @@ package com.fr.design.style.background;
import com.fr.base.background.*;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.BackgroundQuickUIProvider;
import com.fr.design.fun.BackgroundUIProvider;
import com.fr.design.style.background.gradient.GradientBackgroundPane;
import com.fr.design.style.background.impl.*;
@ -21,6 +20,7 @@ public class BackgroundFactory {
private static Map<Class<? extends Background>, BackgroundUIWrapper> map = new LinkedHashMap<>();
private static Map<Class<? extends Background>, BackgroundUIWrapper> browser = new LinkedHashMap<>();
private static Map<Class<? extends Background>, BackgroundUIWrapper> button = new LinkedHashMap<>();
static {
registerUniversal(map);
@ -29,29 +29,38 @@ public class BackgroundFactory {
registerBrowserImageBackground(browser);
registerExtra(map);
registerExtra(browser);
registerButtonBackground(button);
}
private static void registerUniversal(Map<Class<? extends Background>, BackgroundUIWrapper> map) {
map.put(null, BackgroundUIWrapper.create()
.setType(NullBackgroundPane.class).setTitle(Inter.getLocText("Background-Null")));
.setType(NullBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Null")));
map.put(ColorBackground.class, BackgroundUIWrapper.create()
.setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("Color")));
.setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Color")));
map.put(TextureBackground.class, BackgroundUIWrapper.create()
.setType(TextureBackgroundPane.class).setTitle(Inter.getLocText("Background-Texture")));
.setType(TextureBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Texture")));
map.put(PatternBackground.class, BackgroundUIWrapper.create()
.setType(PatternBackgroundPane.class).setTitle(Inter.getLocText("Background-Pattern")));
.setType(PatternBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Pattern")));
map.put(GradientBackground.class, BackgroundUIWrapper.create()
.setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("Gradient-Color")));
.setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Gradient_Color")));
}
private static void registerImageBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map) {
map.put(ImageBackground.class, BackgroundUIWrapper.create()
.setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("Image")));
.setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Image")));
}
private static void registerBrowserImageBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map) {
map.put(ImageBackground.class, BackgroundUIWrapper.create()
.setType(ImageBackgroundPane4Browser.class).setTitle(Inter.getLocText("Image")));
.setType(ImageBackgroundPane4Browser.class).setTitle(Inter.getLocText("FR-Designer_Background_Image")));
}
private static void registerButtonBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map){
map.put(ColorBackground.class, BackgroundUIWrapper.create()
.setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Color")));
map.put(ImageBackground.class, BackgroundUIWrapper.create()
.setType(ImageButtonBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Image")));
}
private static void registerExtra(Map<Class<? extends Background>, BackgroundUIWrapper> map) {
@ -85,6 +94,29 @@ public class BackgroundFactory {
return new NullBackgroundPane();
}
public static Set<Class<? extends Background>> buttonKindsOfKey() {
return button.keySet();
}
public static BackgroundUIWrapper getButtonWrapper(Class<? extends Background> category) {
return button.get(category);
}
public static BackgroundDetailPane createButtonIfAbsent(Class<? extends Background> category) {
BackgroundUIWrapper wrapper = button.get(category);
return createByWrapper(wrapper);
}
public static BackgroundDetailPane createButtonIfAbsent(int index) {
for (BackgroundUIWrapper wrapper : button.values()) {
if (wrapper.getIndex() == index) {
return createByWrapper(wrapper);
}
}
return new NullBackgroundPane();
}
public static Set<Class<? extends Background>> browserKindsOfKey() {
return browser.keySet();
}

55
designer_base/src/com/fr/design/style/background/impl/ImageBackgroundPane.java

@ -28,16 +28,16 @@ import java.io.File;
*/
public class ImageBackgroundPane extends BackgroundDetailPane {
private ImagePreviewPane previewPane = null;
protected ImagePreviewPane previewPane = null;
private Style imageStyle = null;
private ChangeListener changeListener = null;
private ImageFileChooser imageFileChooser = null;
private UILabel imageSizeLabel = new UILabel();
protected UILabel imageSizeLabel = new UILabel();
protected JRadioButton defaultRadioButton = null;
protected JRadioButton tiledRadioButton = null;
private JRadioButton extendRadioButton = null;
private JRadioButton adjustRadioButton = null;
protected UIRadioButton defaultRadioButton = null;
protected UIRadioButton tiledRadioButton = null;
private UIRadioButton extendRadioButton = null;
private UIRadioButton adjustRadioButton = null;
public ImageBackgroundPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
@ -46,21 +46,27 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
JPanel previewContainerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(previewContainerPane, BorderLayout.CENTER);
JPanel previewOwnerPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Preview"));
JPanel previewOwnerPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Preview"));
previewOwnerPane.setLayout(new BorderLayout());
previewContainerPane.add(previewOwnerPane, BorderLayout.CENTER);
previewContainerPane.add(initSelectFilePane(), BorderLayout.EAST);
previewPane = new ImagePreviewPane();
previewOwnerPane.add(new JScrollPane(previewPane));
previewPane.addChangeListener(imageSizeChangeListener);
// init image file chooser.
imageFileChooser = new ImageFileChooser();
imageFileChooser.setMultiSelectionEnabled(false);
}
public JPanel initSelectFilePane(){
JPanel selectFilePane = FRGUIPaneFactory.createBorderLayout_L_Pane();
previewContainerPane.add(selectFilePane, BorderLayout.EAST);
selectFilePane.setBorder(BorderFactory.createEmptyBorder(8, 2, 4, 0));
UIButton selectPictureButton = new UIButton(
Inter.getLocText("Image-Select_Picture"));
Inter.getLocText("FR-Designer_Background_Image_Select"));
selectFilePane.add(selectPictureButton, BorderLayout.NORTH);
selectPictureButton.setMnemonic('S');
selectPictureButton.addActionListener(selectPictureActionListener);
@ -68,10 +74,10 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
selectFilePane.add(layoutPane, BorderLayout.CENTER);
//布局
defaultRadioButton = new UIRadioButton(Inter.getLocText("Default"));
tiledRadioButton = new UIRadioButton(Inter.getLocText("Image-Titled"));
extendRadioButton = new UIRadioButton(Inter.getLocText("Image-Extend"));
adjustRadioButton = new UIRadioButton(Inter.getLocText("Image-Adjust"));
defaultRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer-StyleAlignment_Layout_Default"));
tiledRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer-StyleAlignment_Layout_Image_Titled"));
extendRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer-StyleAlignment_Layout_Image_Extend"));
adjustRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer-StyleAlignment_Layout_Image_Adjust"));
defaultRadioButton.addActionListener(layoutActionListener);
tiledRadioButton.addActionListener(layoutActionListener);
@ -79,7 +85,7 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
adjustRadioButton.addActionListener(layoutActionListener);
JPanel jp = new JPanel(new GridLayout(4, 1, 15, 15));
for (JRadioButton button : imageLayoutButtons()) {
for (UIRadioButton button : imageLayoutButtons()) {
jp.add(button);
}
layoutPane.add(jp);
@ -91,14 +97,11 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
layoutBG.add(adjustRadioButton);
defaultRadioButton.setSelected(true);
// init image file chooser.
imageFileChooser = new ImageFileChooser();
imageFileChooser.setMultiSelectionEnabled(false);
return selectFilePane;
}
protected JRadioButton[] imageLayoutButtons() {
return new JRadioButton[]{
protected UIRadioButton[] imageLayoutButtons() {
return new UIRadioButton[]{
defaultRadioButton,
tiledRadioButton,
extendRadioButton,
@ -121,8 +124,7 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
CoreGraphHelper.waitForImage(image);
previewPane.setImage(image);
setImageStyle();
previewPane.setImageStyle(imageStyle);
imageStyleRepaint();
previewPane.repaint();
} else {
previewPane.setImage(null);
@ -133,6 +135,11 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
}
};
public void imageStyleRepaint(){
setImageStyle();
previewPane.setImageStyle(imageStyle);
}
private void setImageStyle() {
if (tiledRadioButton.isSelected()) {
imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_TILED);

5
designer_base/src/com/fr/design/style/background/impl/ImageBackgroundPane4Browser.java

@ -1,5 +1,6 @@
package com.fr.design.style.background.impl;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.stable.ArrayUtils;
import javax.swing.*;
@ -15,9 +16,9 @@ public class ImageBackgroundPane4Browser extends ImageBackgroundPane {
}
@Override
protected JRadioButton[] imageLayoutButtons() {
protected UIRadioButton[] imageLayoutButtons() {
return (JRadioButton[]) ArrayUtils.addAll(super.imageLayoutButtons(), new JRadioButton[] {
return (UIRadioButton[]) ArrayUtils.addAll(super.imageLayoutButtons(), new UIRadioButton[] {
defaultRadioButton,
tiledRadioButton,
});

79
designer_base/src/com/fr/design/style/background/impl/ImageButtonBackgroundPane.java

@ -0,0 +1,79 @@
package com.fr.design.style.background.impl;
import com.fr.base.Style;
import com.fr.base.background.ImageBackground;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.general.Background;
import com.fr.general.Inter;
import com.fr.stable.Constants;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Created by ibm on 2017/1/5.
*/
public class ImageButtonBackgroundPane extends ImageBackgroundPane {
private UIButton chooseButton;
private UIButton clearButton;
public ImageButtonBackgroundPane(){
super();
Style imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_CENTER);
previewPane.setImageStyle(imageStyle);
}
public JPanel initSelectFilePane(){
JPanel choosePane = new JPanel(new BorderLayout(0, 10));
choosePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
JPanel choosePane1 = new JPanel(new BorderLayout(0, 10));
initButton();
choosePane.add(chooseButton, BorderLayout.NORTH);
choosePane1.add(clearButton,BorderLayout.NORTH);
choosePane.add(choosePane1,BorderLayout.CENTER);
imageSizeLabel.setHorizontalAlignment(SwingConstants.CENTER);
choosePane1.add(imageSizeLabel,BorderLayout.CENTER);
this.add(choosePane,BorderLayout.EAST);
return choosePane;
}
private void initButton() {
chooseButton = new UIButton(Inter.getLocText("FR-Designer_Background_Image_Select"));
chooseButton.addActionListener(selectPictureActionListener);
clearButton = new UIButton(Inter.getLocText("FR-Designer_Background_Clear"));
clearButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
previewPane.setImage(null);
previewPane.repaint();
}
});
}
public void imageStyleRepaint(){
}
public void populate(Background background) {
if(background != null && background instanceof ImageBackground){
ImageBackground imageBackground = (ImageBackground) background;
if(imageBackground.getImage() != null) {
previewPane.setImage(imageBackground.getImage());
}
}
}
public Background update() {
if(previewPane.getImage() == null) {
return null;
}
return new ImageBackground(previewPane.getImage());
}
}

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

@ -70,8 +70,8 @@ public class NormalChartDataPane extends DataContentsPane {
@Override
protected List<FurtherBasicBeanPane<? extends ChartCollection>> initPaneList() {
tableDataPane = new TableDataPane(parent);
reportDataPane = new ReportDataPane(parent);
tableDataPane = getTableDataPane(parent);
reportDataPane = getReportDataPane(parent);
List<FurtherBasicBeanPane<? extends ChartCollection>> paneList = new ArrayList<FurtherBasicBeanPane<? extends ChartCollection>>();
paneList.add(tableDataPane);
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;
}
private AbstractReportDataContentPane getContentPane(Chart chart) {
protected AbstractReportDataContentPane getContentPane(Chart chart) {
if(chart == 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);
}

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.widget.editors.PaddingMarginEditor;
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.form.ui.Widget;
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
* @return wlayout控件

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

@ -1,13 +1,12 @@
package com.fr.design.designer.creator.cardlayout;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.*;
import java.awt.event.MouseEvent;
import javax.swing.Icon;
import com.fr.base.BaseUtils;
import com.fr.base.background.ColorBackground;
import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.ComponentAdapter;
import com.fr.design.designer.beans.models.SelectionModel;
@ -32,6 +31,7 @@ public class XCardAddButton extends XButton{
private static final int START_INDEX = 3;
private static final int INDEX = 0;
private static final int DEFAULT_BUTTON_WIDTH = 80;
private static Icon ADD_ICON = BaseUtils.readIcon("/com/fr/design/form/images/add.png");
@ -140,18 +140,18 @@ public class XCardAddButton extends XButton{
//新增tab
private void addTab(int index){
Dimension dimension = new Dimension();
XCardSwitchButton button = (XCardSwitchButton) this.tagLayout.getComponent(INDEX);
dimension.width = button.getWidth();
dimension.width = DEFAULT_BUTTON_WIDTH;
String cardLayoutName = cardLayout.toData().getWidgetName();
CardSwitchButton titleButton = new CardSwitchButton(index,cardLayoutName);
//设置标题
titleButton.setText(getTabTitleName());
XCardSwitchButton showButton = new XCardSwitchButton(titleButton,dimension,cardLayout,tagLayout);
titleButton.setInitialBackground(ColorBackground.getInstance(Color.WHITE));
XCardSwitchButton showButton = new XCardSwitchButton(titleButton, dimension, cardLayout, tagLayout);
titleButton.setCustomStyle(true);
titleButton.setShowButton(true);
showButton.setBackupParent(tagLayout);
this.tagLayout.setCurrentCard(titleButton);
this.tagLayout.setTabFitIndex(index);
this.tagLayout.add(showButton);

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

@ -3,17 +3,15 @@
*/
package com.fr.design.designer.creator.cardlayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.geom.Rectangle2D;
import java.util.*;
import javax.swing.*;
import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper;
import com.fr.base.background.ColorBackground;
import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.ComponentAdapter;
@ -59,16 +57,21 @@ public class XCardSwitchButton extends XButton {
private static final int RIGHT_OFFSET = 15;
private static final int TOP_OFFSET = 25;
//这边先不计算button的高度,涉及到layout那边的整体高度,先用之前的固定高度
private static final int DEFAULT_BUTTON_HEIGHT = 36;
// tab按钮里的字体因为按钮内部的布局看起来比正常的要小,加个调整量
private static final int FONT_SIZE_ADJUST = 2;
private static final int SIDE_OFFSET = 57;
private static final int HEIGHT_OFFSET = 25;
private XWCardLayout cardLayout;
private XWCardTagLayout tagLayout;
private Background selectBackground;
private boolean isCustomStyle;
private Icon closeIcon = MOUSE_COLSE;
public XWCardTagLayout getTagLayout() {
@ -155,19 +158,19 @@ public class XCardSwitchButton extends XButton {
//将当前tab按钮改为选中状态
changeButtonState(index);
// 切换到当前tab按钮对应的tabFitLayout
XWTabFitLayout tabFitLayout = (XWTabFitLayout) cardLayout.getComponent(index);
tabFitLayout.setxCardSwitchButton(this);
selectionModel.setSelectedCreator(tabFitLayout);
if (editingMouseListener.stopEditing()) {
ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer,
this);
editingMouseListener.startEditing(this,
adapter.getDesignerEditor(), adapter);
}
setTabsAndAdjust();
}
//删除card,同时修改其他switchbutton和tabfit的index
@ -257,6 +260,7 @@ public class XCardSwitchButton extends XButton {
public void paintComponent(Graphics g) {
super.paintComponent(g);
setTabsAndAdjust();
Graphics2D g2d = (Graphics2D) g;
drawBackgorund();
drawTitle();
@ -337,5 +341,54 @@ public class XCardSwitchButton extends XButton {
public XLayoutContainer getTopLayout() {
return this.getBackupParent().getTopLayout();
}
public void setTabsAndAdjust() {
if (this.tagLayout == null) {
return;
}
int tabLength = this.tagLayout.getComponentCount();
Map<Integer, Integer> cardWidth = new HashMap<>();
Map<Integer, Integer> cardHeight = new HashMap<>();
for (int i = 0; i < tabLength; i++) {
XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i);
CardSwitchButton tempCard = (CardSwitchButton) temp.toData();
String tempText = tempCard.getText();
Font f = ((CardSwitchButton)this.toData()).getFont();
FontMetrics fm = GraphHelper.getFontMetrics(f);
cardWidth.put(i,fm.stringWidth(tempText));
cardHeight.put(i,fm.getHeight());
}
adjustTabs(tabLength, cardWidth, cardHeight);
}
public void adjustTabs(int tabLength, Map<Integer, Integer> width, Map<Integer, Integer> height) {
if (width == null) {
return;
}
int tempX = 0;
for (int i = 0; i < tabLength; i++) {
Rectangle rectangle = this.tagLayout.getComponent(i).getBounds();
Integer cardWidth = width.get(i) + SIDE_OFFSET;
//先用这边的固定高度
Integer cardHeight = DEFAULT_BUTTON_HEIGHT;
rectangle.setSize(cardWidth, cardHeight);
rectangle.setBounds(tempX, 0, cardWidth, cardHeight);
tempX += cardWidth;
this.tagLayout.getComponent(i).setBounds(rectangle);
Dimension dimension = new Dimension();
dimension.setSize(cardWidth, cardHeight);
XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i);
UILabel label = temp.getContentLabel();
label.setSize(dimension);
temp.setContentLabel(label);
temp.setSize(dimension);
temp.setPreferredSize(new Dimension(cardWidth, cardHeight));
}
}
@Override
public void doLayout() {
super.doLayout();
setTabsAndAdjust();
}
}

93
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.design.designer.beans.LayoutAdapter;
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.creator.*;
import com.fr.design.form.layout.FRCardLayout;
import com.fr.design.form.util.XCreatorConstants;
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.renderer.LayoutBorderStyleRenderer;
import com.fr.design.mainframe.widget.editors.DoubleEditor;
import com.fr.form.ui.*;
import com.fr.form.ui.container.WBorderLayout;
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.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import com.fr.stable.core.PropertyChangeAdapter;
@ -39,6 +43,8 @@ public class XWCardLayout extends XLayoutContainer {
private CardLayout cardLayout;
private boolean initFlag = true;
private static final int NORTH = 0;
private FormDesigner designer;
//默认蓝色标题背景
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);
firstBtn.setText(Inter.getLocText("FR-Designer_Title") + 0);
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);
xTag.setCurrentCard(firstBtn);
XCardSwitchButton xFirstBtn = new XCardSwitchButton(firstBtn, new Dimension(CardSwitchButton.DEF_WIDTH, -1), this, xTag);
xFirstBtn.setBackupParent(xTag);
return xFirstBtn;
@ -272,27 +278,68 @@ public class XWCardLayout extends XLayoutContainer {
* @throws IntrospectionException
*/
public CRPropertyDescriptor[] supportedDescriptor() 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() {
CRPropertyDescriptor[] crp = ((WCardLayout) data).isCarousel() ? getisCarousel() : getisnotCarousel();
return ArrayUtils.addAll(getDefaultDescriptor(), crp);
}
public CRPropertyDescriptor[] getisCarousel() 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);
}
}),
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();
}
}),
};
@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
*/
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.WTabFitLayout;
import com.fr.general.Background;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.core.PropertyChangeAdapter;
@ -41,12 +42,12 @@ public class XWTabFitLayout extends XWFitLayout {
private static final int MIN_SIZE = 1;
// tab布局在拖拽导致的缩放里(含间隔时),如果拖拽宽高大于组件宽高,会导致调整的时候找不到原来的组件
// 这里先将拖拽之前的宽高先做备份
public static final Color NORMAL_GRAL = new Color(236,236,236);
public static final Color CHOOSED_GRAL = new Color(222,222,222);
private static final Color NORMAL_GRAL = new Color(236,236,236);
private Dimension referDim;
private Background initialBackground;
private Background overBackground;
private Background clickBackground;
private FRFont font;
private XCardSwitchButton xCardSwitchButton;
public Dimension getReferDim() {
@ -81,6 +82,15 @@ 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;
}
@ -105,7 +115,7 @@ public class XWTabFitLayout extends XWFitLayout {
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
checkButonType();
CRPropertyDescriptor[] crp = ((WTabFitLayout) data).isCustomStyle() ? getisCustomStyle() : getisnotCustomStyle();
return ArrayUtils.addAll(super.supportedDescriptor(), crp);
return ArrayUtils.addAll(defaultDescriptor(), crp);
}
protected CRPropertyDescriptor[] getisCustomStyle() throws IntrospectionException {
@ -195,6 +205,14 @@ public class XWTabFitLayout extends XWFitLayout {
return crPropertyDescriptors[i];
}
protected CRPropertyDescriptor[] defaultDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] crPropertyDescriptors = {
super.createWidgetNameDescriptor(),
super.createMarginDescriptor()
};
return crPropertyDescriptors;
}
private void checkButonType() {
if (this.xCardSwitchButton == null) {
return;

13
designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleImgBackgroundEditor.java

@ -1,17 +1,16 @@
package com.fr.design.mainframe.widget.accessibles;
import java.awt.Dimension;
import javax.swing.SwingUtilities;
import com.fr.base.background.ImageBackground;
import com.fr.base.background.ColorBackground;
import com.fr.design.mainframe.widget.wrappers.BackgroundWrapper;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.frpane.ImgChoosePane;
import com.fr.design.style.background.BackgroundButtonPane;
import com.fr.general.Background;
public class AccessibleImgBackgroundEditor extends UneditableAccessibleEditor {
private ImgChoosePane choosePane;
private BackgroundButtonPane choosePane;
public AccessibleImgBackgroundEditor() {
super(new BackgroundWrapper());
@ -20,7 +19,7 @@ public class AccessibleImgBackgroundEditor extends UneditableAccessibleEditor {
@Override
protected void showEditorPane() {
if (choosePane == null) {
choosePane = new ImgChoosePane();
choosePane = new BackgroundButtonPane();
choosePane.setPreferredSize(new Dimension(600, 400));
}
BasicDialog dlg = choosePane.showWindow(SwingUtilities.getWindowAncestor(this));
@ -32,7 +31,7 @@ public class AccessibleImgBackgroundEditor extends UneditableAccessibleEditor {
fireStateChanged();
}
});
choosePane.populate(getValue() instanceof ImageBackground ? (ImageBackground) getValue() : null);
choosePane.populate(getValue() instanceof Background ? (Background) getValue() : new ColorBackground());
dlg.setVisible(true);
}
}
Loading…
Cancel
Save