Browse Source

Merge branch 'release/10.0' of http://cloud.finedevelop.com:2015/scm/~hades/design into release/10.0

bugfix/10.0
Hades 6 years ago
parent
commit
dab09c8326
  1. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  2. 60
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

@ -143,7 +143,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){
JPanel panel = TableLayoutHelper.createTableLayoutPane(comps,row,col);
return createTableLayoutPaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout"), panel);
return createTableLayoutPaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Attr_Layout"), panel);
}

60
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java

@ -17,6 +17,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.ComparatorUtils;
import com.fr.report.cell.DefaultTemplateCellElement;
@ -51,6 +52,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
private static final int HEAD_WDITH = 290;
private static final int HEAD_HEIGTH = 24;
private static final int COMBO_WIDTH = 154;
private static final int BUTTON_GROUP_WIDTH = 140;
// normal
private UIButtonGroup autoshrik;
@ -81,7 +83,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
private UIRadioButton[] adjustRadioButtons;
// 插入行策略
private UIButtonGroup insertRowPolicy;
private UIButtonGroup insertRowPolicyButtonGroup;
private ValueEditorPane valueEditor;
private CardLayout insertRowLayout;
private JPanel insertRowPane;
@ -147,7 +149,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
private void initInsertRowPolicyPane() {
// 插入行策略
insertRowPolicy = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_NULL"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Estate_Default_Text"),
insertRowPolicyButtonGroup = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_NULL"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Estate_Default_Text"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_COPY")});
defaultValuePane = new JPanel(new BorderLayout(4, 0));
valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane();
@ -157,10 +159,10 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
insertRowPane.add(new JPanel(), "none");
insertRowPane.add(defaultValuePane, "content");
insertRowPane.setPreferredSize(new Dimension(0, 0));
insertRowPolicy.addChangeListener(new ChangeListener() {
insertRowPolicyButtonGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (insertRowPolicy.getSelectedIndex() == 1) {
if (insertRowPolicyButtonGroup.getSelectedIndex() == 1) {
insertRowPane.setPreferredSize(new Dimension(100, 20));
insertRowLayout.show(insertRowPane, "content");
} else {
@ -169,16 +171,33 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
}
}
});
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize1 = {p, p};
double[] columnSize1 = {p, f};
int[][] rowCount1 = {{1, 1}, {1, 1}};
Component[][] components1 = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy"), SwingConstants.LEFT), insertRowPolicy},
new Component[]{null, insertRowPane},
};
insertRowPolicyPane = TableLayoutHelper.createGapTableLayoutPane(components1, rowSize1, columnSize1, rowCount1, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
UILabel insertRowPolicyLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy", SwingConstants.LEFT));
UIComponentUtils.setLineWrap(insertRowPolicyLabel);
// 如果右侧需要很宽的空间,就用3行1列的布局
if (insertRowPolicyButtonGroup.getPreferredSize().getWidth() > BUTTON_GROUP_WIDTH) {
double[] rowSize = {p, p, p};
double[] columnSize = {f};
Component[][] components = new Component[][] {
new Component[]{insertRowPolicyLabel},
new Component[]{insertRowPolicyButtonGroup},
new Component[]{insertRowPane},
};
insertRowPolicyPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
} else {
double[] rowSize = {p, p};
double[] columnSize = {f, BUTTON_GROUP_WIDTH};
Component[][] components = new Component[][] {
new Component[]{insertRowPolicyLabel, insertRowPolicyButtonGroup},
new Component[]{null, insertRowPane},
};
insertRowPolicyPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
}
}
private JPanel seniorUpPane() {
@ -200,13 +219,14 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
fileNamePane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0));
UILabel showContentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Content"), SwingConstants.LEFT);
UIComponentUtils.setLineWrap(showContentLabel);
UILabel toolTipLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip"));
JPanel toolTipTextFieldWrapper = new JPanel(new BorderLayout());
toolTipTextFieldWrapper.add(tooltipTextField, BorderLayout.NORTH);
Component[][] components = new Component[][]{
new Component[]{showContentLabel, showContent},
new Component[]{showContentLabel, UIComponentUtils.wrapWithBorderLayoutPane(showContent)},
new Component[]{fileNamePane, null}, // 选择"用下载连接显示二进制内容"时,会显示这一行的面板
new Component[]{toolTipLabel, toolTipTextFieldWrapper}
};
@ -323,7 +343,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
pageAfterColumnCheckBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Page_After_Column"));
canBreakOnPaginateCheckBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellPage_Can_Break_On_Paginate"));
repeatCheckBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellPage_Repeat_Content_When_Paging"));
insertRowPolicy.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy"));
insertRowPolicyButtonGroup.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy"));
valueEditor.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy"));
}
@ -395,16 +415,16 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
cellInsertPolicyAttr = new CellInsertPolicyAttr();
}
if (ComparatorUtils.equals(CellInsertPolicyAttr.INSERT_POLICY_COPY, cellInsertPolicyAttr.getInsertPolicy())) {
insertRowPolicy.setSelectedIndex(2);
insertRowPolicyButtonGroup.setSelectedIndex(2);
} else if (ComparatorUtils.equals(CellInsertPolicyAttr.INSERT_POLICY_DEFAULT, cellInsertPolicyAttr.getInsertPolicy())) {
insertRowPolicy.setSelectedIndex(1);
insertRowPolicyButtonGroup.setSelectedIndex(1);
Object defaultValue = cellInsertPolicyAttr.getDefaultInsertValue();
this.valueEditor.populate(defaultValue);
} else {
insertRowPolicy.setSelectedIndex(0);
insertRowPolicyButtonGroup.setSelectedIndex(0);
this.valueEditor.populate(StringUtils.EMPTY);
}
if (insertRowPolicy.getSelectedIndex() == 1) {
if (insertRowPolicyButtonGroup.getSelectedIndex() == 1) {
insertRowPane.setPreferredSize(new Dimension(100, 20));
insertRowLayout.show(insertRowPane, "content");
} else {
@ -521,9 +541,9 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
// 插入
CellInsertPolicyAttr cellInsertPolicyAttr = new CellInsertPolicyAttr();
if (insertRowPolicy.getSelectedIndex() == 2) {
if (insertRowPolicyButtonGroup.getSelectedIndex() == 2) {
cellInsertPolicyAttr.setInsertPolicy(CellInsertPolicyAttr.INSERT_POLICY_COPY);
} else if (insertRowPolicy.getSelectedIndex() == 1) {
} else if (insertRowPolicyButtonGroup.getSelectedIndex() == 1) {
cellInsertPolicyAttr.setInsertPolicy(CellInsertPolicyAttr.INSERT_POLICY_DEFAULT);
Object value = valueEditor.update();
cellInsertPolicyAttr.setDefaultInsertValue(value);

Loading…
Cancel
Save