Browse Source

REPORT-2897 9.0设计器修改

单元格属性-样式=》自定义样式=》单元格、对齐
master
MoMeak 7 years ago
parent
commit
8e34056d1a
  1. 15
      designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java
  2. 287
      designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java
  3. 22
      designer_base/src/com/fr/design/gui/ibutton/FiveButtonLayout.java
  4. 2
      designer_base/src/com/fr/design/gui/ibutton/UITabGroup.java
  5. 686
      designer_base/src/com/fr/design/gui/style/AlignmentPane.java
  6. 386
      designer_base/src/com/fr/design/gui/style/BorderPane.java
  7. 47
      designer_base/src/com/fr/design/gui/style/FRFontPane.java
  8. 55
      designer_base/src/com/fr/design/gui/style/FormatPane.java
  9. 17
      designer_base/src/com/fr/design/locale/designer.properties
  10. 17
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  11. 58
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  12. 56
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  13. 17
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  14. 58
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties

15
designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java

@ -89,21 +89,6 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
layoutPane.add(basicPane,BorderLayout.NORTH); layoutPane.add(basicPane,BorderLayout.NORTH);
layoutPane.add(seniorPane,BorderLayout.CENTER); layoutPane.add(seniorPane,BorderLayout.CENTER);
return layoutPane; return layoutPane;
// double f = TableLayout.FILL;
// double p = TableLayout.PREFERRED;
// Component[][] components = new Component[][]{
// new Component[]{new UILabel(Inter.getLocText("ExpandD-Expand_Direction") + ":", SwingConstants.RIGHT), expandDirectionButton},
// new Component[]{new UILabel(Inter.getLocText("LeftParent") + ":", SwingConstants.RIGHT), leftFatherPane},
// new Component[]{new UILabel(Inter.getLocText("ExpandD-Up_Father_Cell") + ":", SwingConstants.RIGHT), rightFatherPane},
// new Component[]{new JSeparator(), null},
// new Component[]{new UILabel(Inter.getLocText("ExpandD-Expandable") + ":", SwingConstants.RIGHT), horizontalExpandableCheckBox},
// new Component[]{null, verticalExpandableCheckBox},
// new Component[]{new UILabel(Inter.getLocText("ExpandD-Sort_After_Expand") + ":", SwingConstants.RIGHT), sortAfterExpand},
// };
// double[] rowSize = {p, p, p, p, p, p, p, p, p, p, p, p, p};
// double[] columnSize = {p, f};
// int[][] rowCount = {{1, 1}, {1, 3}, {1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 3}};
// return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
} }
private JPanel basicPane(){ private JPanel basicPane(){

287
designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java

@ -1,29 +1,25 @@
package com.fr.design.mainframe.cell.settingpane.style; package com.fr.design.mainframe.cell.settingpane.style;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
import javax.swing.event.ChangeListener;
import com.fr.base.CellBorderStyle; import com.fr.base.CellBorderStyle;
import com.fr.base.NameStyle; import com.fr.base.NameStyle;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.actions.utils.ReportActionUtils; import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.gui.ibutton.FiveButtonLayout;
import com.fr.design.gui.style.AbstractBasicStylePane;
import com.fr.design.gui.style.AlignmentPane;
import com.fr.design.gui.style.BackgroundPane;
import com.fr.design.gui.style.BorderPane;
import com.fr.design.gui.style.FRFontPane;
import com.fr.design.gui.style.FormatPane;
import com.fr.design.style.BorderUtils;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.MultiTabPane; import com.fr.design.dialog.MultiTabPane;
import com.fr.general.Inter; import com.fr.design.gui.ibutton.FiveButtonLayout;
import com.fr.design.gui.style.*;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.style.BorderUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.*;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
/** /**
* 复杂的原型图导致复杂的画法非我所愿也 * 复杂的原型图导致复杂的画法非我所愿也
@ -32,130 +28,143 @@ import com.fr.stable.Constants;
* @since 2012-5-24上午10:36:10 * @since 2012-5-24上午10:36:10
*/ */
public class CustomStylePane extends MultiTabPane<Style> { public class CustomStylePane extends MultiTabPane<Style> {
private static final int LENGTH_FOUR = 4; private static final int LENGTH_FOUR = 4;
private static final int THREE_INDEX = 3; private static final int THREE_INDEX = 3;
private String[] NameArray; private static final int TWO_INDEX = 2;
private ElementCasePane reportPane; private static final int ONE_INDEX = 1;
private BackgroundPane backgroundPane = null; private String[] NameArray;
private ElementCasePane reportPane;
private BackgroundPane backgroundPane = null;
public CustomStylePane() {
super();
tabPane.setOneLineTab(false); public CustomStylePane() {
tabPane.setLayout(new FiveButtonLayout()); super();
} tabPane.setOneLineTab(true);
tabPane.setLayout(new FiveButtonLayout(1));
/** }
* @return
*/ public static void main(String[] args) {
public String title4PopupWindow() { JFrame jf = new JFrame("test");
return Inter.getLocText(new String[]{"Custom", "Style"}); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
} JPanel content = (JPanel) jf.getContentPane();
content.setLayout(new BorderLayout());
/** content.add(new CustomStylePane(), BorderLayout.CENTER);
* for ScrollBar GUICoreUtils.centerWindow(jf);
* jf.setSize(290, 400);
* @param l jf.setVisible(true);
*/ }
public void addTabChangeListener(ChangeListener l) {
if (tabPane != null) { /**
tabPane.addChangeListener(l); * @return
} */
if (backgroundPane != null) { public String title4PopupWindow() {
backgroundPane.addChangeListener(l); return Inter.getLocText(new String[]{"Custom", "Style"});
} }
}
/**
/** * for ScrollBar
* *
*/ * @param l
public void reset() { */
populateBean(null); public void addTabChangeListener(ChangeListener l) {
} if (tabPane != null) {
tabPane.addChangeListener(l);
@Override }
/** if (backgroundPane != null) {
* backgroundPane.addChangeListener(l);
*/ }
public void populateBean(Style ob) { }
for (int i = 0; i < paneList.size(); i++) {
((AbstractBasicStylePane) paneList.get(i)).populateBean(ob); /**
} *
} */
public void reset() {
@Override populateBean(null);
/** }
*
*/ @Override
public Style updateBean() { /**
return updateStyle(ReportActionUtils.getCurrentStyle(reportPane)); *
} */
public void populateBean(Style ob) {
/** for (int i = 0; i < paneList.size(); i++) {
* @param style ((AbstractBasicStylePane) paneList.get(i)).populateBean(ob);
* @return }
*/ }
public Style updateStyle(Style style) {
return ((AbstractBasicStylePane) paneList.get(tabPane.getSelectedIndex())).update(style);//只更新当前选中面板的样式 @Override
} /**
*
*/
public boolean isBorderPaneSelected() { public Style updateBean() {
return tabPane.getSelectedIndex() == THREE_INDEX ; return updateStyle(ReportActionUtils.getCurrentStyle(reportPane));
} }
/** /**
* @param ePane * @param style
*/ * @return
public void dealWithBorder(ElementCasePane ePane) { */
this.reportPane = ePane; public Style updateStyle(Style style) {
Object[] fourObjectArray = BorderUtils.createCellBorderObject(reportPane); return ((AbstractBasicStylePane) paneList.get(tabPane.getSelectedIndex())).update(style);//只更新当前选中面板的样式
}
if (fourObjectArray != null && fourObjectArray.length % LENGTH_FOUR == 0) {
if (fourObjectArray.length == LENGTH_FOUR) {
((BorderPane) paneList.get(THREE_INDEX)).populateBean((CellBorderStyle) fourObjectArray[0], ((Boolean) fourObjectArray[1]).booleanValue(), ((Integer) fourObjectArray[2]).intValue(), public boolean isBorderPaneSelected() {
(Color) fourObjectArray[THREE_INDEX]); return tabPane.getSelectedIndex() == TWO_INDEX;
} else { }
((BorderPane) paneList.get(THREE_INDEX)).populateBean(new CellBorderStyle(), Boolean.TRUE, Constants.LINE_NONE,
(Color) fourObjectArray[THREE_INDEX]); /**
} * @param ePane
} */
public void dealWithBorder(ElementCasePane ePane) {
} this.reportPane = ePane;
Object[] fourObjectArray = BorderUtils.createCellBorderObject(reportPane);
/**
* if (fourObjectArray != null && fourObjectArray.length % LENGTH_FOUR == 0) {
*/ if (fourObjectArray.length == LENGTH_FOUR) {
public void updateBorder() { ((BorderPane) paneList.get(ONE_INDEX)).populateBean((CellBorderStyle) fourObjectArray[0], ((Boolean) fourObjectArray[1]).booleanValue(), ((Integer) fourObjectArray[2]).intValue(),
BorderUtils.update(reportPane, ((BorderPane) paneList.get(THREE_INDEX)).update()); (Color) fourObjectArray[THREE_INDEX]);
} } else {
((BorderPane) paneList.get(ONE_INDEX)).populateBean(new CellBorderStyle(), Boolean.TRUE, Constants.LINE_NONE,
/** (Color) fourObjectArray[THREE_INDEX]);
* @param ob }
* @return }
*/
public boolean accept(Object ob) { }
return ob instanceof Style && !(ob instanceof NameStyle);
} /**
*
@Override */
protected List<BasicPane> initPaneList() { public void updateBorder() {
paneList = new ArrayList<BasicPane>(); BorderUtils.update(reportPane, ((BorderPane) paneList.get(TWO_INDEX)).update());
paneList.add(new FormatPane()); }
paneList.add(new AlignmentPane());
paneList.add(new FRFontPane()); /**
paneList.add(new BorderPane()); * @param ob
paneList.add(backgroundPane = new BackgroundPane()); * @return
return paneList; */
} public boolean accept(Object ob) {
return ob instanceof Style && !(ob instanceof NameStyle);
@Override }
/**
* @Override
*/ protected List<BasicPane> initPaneList() {
public void updateBean(Style ob) { paneList = new ArrayList<BasicPane>();
paneList.add(new FormatPane());
} paneList.add(new BorderPane());
paneList.add(new AlignmentPane());
// paneList.add(new FRFontPane());
// paneList.add(backgroundPane = new BackgroundPane());
return paneList;
}
@Override
/**
*
*/
public void updateBean(Style ob) {
}
} }

22
designer_base/src/com/fr/design/gui/ibutton/FiveButtonLayout.java

@ -12,20 +12,26 @@ import java.awt.*;
public class FiveButtonLayout extends GridLayout { public class FiveButtonLayout extends GridLayout {
private static final double SECOND_ROW = 1.25; private static final double SECOND_ROW = 1.25;
public FiveButtonLayout () { public FiveButtonLayout(int rows) {
super(2, 3, 1, 1); super(rows, 3, 1, 1);
} }
/** /**
* 容器布局 * 容器布局
*
* @param parent 容器 * @param parent 容器
*/ */
public void layoutContainer(Container parent) { public void layoutContainer(Container parent) {
synchronized(parent.getTreeLock()) { synchronized (parent.getTreeLock()) {
Insets insets = parent.getInsets(); Insets insets = parent.getInsets();
int ncomponents = parent.getComponentCount(); int ncomponents = parent.getComponentCount();
int nrows = 2; int nrows = 2;
int ncols = 3; int ncols = 3;
if (ncomponents == 3) {
nrows = 1;
ncols = 3;
}
if (ncomponents == 0) { if (ncomponents == 0) {
return; return;
} }
@ -36,14 +42,14 @@ public class FiveButtonLayout extends GridLayout {
} }
int w = parent.getWidth() - (insets.left + insets.right); int w = parent.getWidth() - (insets.left + insets.right);
int h = parent.getHeight() - (insets.top + insets.bottom); int h = parent.getHeight() - (insets.top + insets.bottom);
w = (w - (ncols - 1) ) / ncols; w = (w - (ncols - 1)) / ncols;
h = (h - (nrows - 1) ) / nrows; h = (h - (nrows - 1)) / nrows;
for (int i = 0, x = insets.left, y = insets.top; i < ncols; i ++, x += w + 1) { for (int i = 0, x = insets.left, y = insets.top; i < ncols; i++, x += w + 1) {
parent.getComponent(i).setBounds(x, y, w, h); parent.getComponent(i).setBounds(x, y, w, h);
} }
int line2w = (int) (SECOND_ROW * w); int line2w = (int) (SECOND_ROW * w);
int secondRowCount = ncomponents-ncols; int secondRowCount = ncomponents - ncols;
int startx= (parent.getWidth()-line2w*secondRowCount-secondRowCount-1)/2; int startx = (parent.getWidth() - line2w * secondRowCount - secondRowCount - 1) / 2;
for (int i = ncols, x = startx, y = insets.top + h + 1; i < ncomponents; i++, x += line2w + 1) { for (int i = ncols, x = startx, y = insets.top + h + 1; i < ncomponents; i++, x += line2w + 1) {
parent.getComponent(i).setBounds(x, y, line2w, h); parent.getComponent(i).setBounds(x, y, line2w, h);
} }

2
designer_base/src/com/fr/design/gui/ibutton/UITabGroup.java

@ -39,7 +39,7 @@ public class UITabGroup extends UIButtonGroup<Integer> {
if (number < BUTTON_NUMBER || isOneLineTab) { if (number < BUTTON_NUMBER || isOneLineTab) {
return super.getGridLayout(number); return super.getGridLayout(number);
} else if (number == BUTTON_NUMBER || number == SEVEN_NUMBER) { } else if (number == BUTTON_NUMBER || number == SEVEN_NUMBER) {
return new FiveButtonLayout(); return new FiveButtonLayout(2);
} else { } else {
return new GridLayout(2, 3, 1, 1); return new GridLayout(2, 3, 1, 1);
} }

686
designer_base/src/com/fr/design/gui/style/AlignmentPane.java

@ -7,8 +7,10 @@ package com.fr.design.gui.style;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver; import com.fr.design.event.GlobalNameObserver;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.fun.IndentationUnitProcessor; import com.fr.design.fun.IndentationUnitProcessor;
import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
@ -36,354 +38,378 @@ import java.util.Arrays;
* Pane to edit cell alignment. * Pane to edit cell alignment.
*/ */
public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameObserver { public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameObserver {
private static final int ANGEL = 90; private static final int ANGEL = 90;
private static final Dimension SPINNER_DIMENSION = new Dimension(60, 20);
private static final String[] TEXT = {Inter.getLocText("FR-Designer_StyleAlignment_Wrap_Text"), Inter.getLocText("FR-Designer_StyleAlignment_Single_Line"),
Inter.getLocText("FR-Designer_StyleAlignment_Single_Line(Adjust_Font)"), Inter.getLocText("FR-Designer_StyleAlignment_Multi_Line(Adjust_Font)")};
private static final String[] TEXT = {Inter.getLocText("StyleAlignment-Wrap_Text"), Inter.getLocText("StyleAlignment-Single_Line"), private static final String[] LAYOUT = {Inter.getLocText("FR-Designer-StyleAlignment_Layout_Default"), Inter.getLocText("FR-Designer-StyleAlignment_Layout_Image_Titled"),
Inter.getLocText("StyleAlignment-Single_Line(Adjust_Font)"), Inter.getLocText("StyleAlignment-Multi_Line(Adjust_Font)")}; Inter.getLocText("FR-Designer-StyleAlignment_Layout_Image_Extend"), Inter.getLocText("FR-Designer-StyleAlignment_Layout_Image_Adjust")};
private static final String[] LAYOUT = {Inter.getLocText("FR-Designer-StyleAlignment_Layout_Default"), Inter.getLocText("FR-Designer-StyleAlignment_Layout_Image_Titled"), private JPanel hPaneContainer;
Inter.getLocText("FR-Designer-StyleAlignment_Layout_Image_Extend"), Inter.getLocText("FR-Designer-StyleAlignment_Layout_Image_Adjust")}; private JPanel vPaneContainer;
private JPanel rotationBarCC;
private JPanel basicPane;
private JPanel seniorPane;
private JPanel hPaneContainer; private UIComboBox textComboBox;
private JPanel vPaneContainer; private UIComboBox textRotationComboBox;
private JPanel rotationBarCC; private UIComboBox imageLayoutComboBox;
private UIComboBox textComboBox; private UIButtonGroup<Integer> hAlignmentPane;// 左对齐 水平居中 右对齐 水平分散
private UIComboBox textRotationComboBox; private UIButtonGroup<Integer> vAlignmentPane;// 居上 垂直居中 居下
private UIComboBox imageLayoutComboBox;
private UIButtonGroup<Integer> hAlignmentPane;// 左对齐 水平居中 右对齐 水平分散 private UINumberDragPane rotationPane;
private UIButtonGroup<Integer> vAlignmentPane;// 居上 垂直居中 居下
private UINumberDragPane rotationPane; private UISpinner leftIndentSpinner;
private UISpinner rightIndentSpinner;
private UISpinner leftIndentSpinner; private UISpinner spaceBeforeSpinner;
private UISpinner rightIndentSpinner; private UISpinner spaceAfterSpinner;
private UISpinner lineSpaceSpinner;
private GlobalNameListener globalNameListener = null;
private IndentationUnitProcessor indentationUnitProcessor = null;
private UISpinner spaceBeforeSpinner; public AlignmentPane() {
private UISpinner spaceAfterSpinner; this.initComponents();
private UISpinner lineSpaceSpinner; }
private GlobalNameListener globalNameListener = null;
private IndentationUnitProcessor indentationUnitProcessor = null;
public AlignmentPane() {
this.initComponents();
}
protected void initComponents() { protected void initComponents() {
textComboBox = new UIComboBox(TEXT); textComboBox = new UIComboBox(TEXT);
imageLayoutComboBox = new UIComboBox(LAYOUT); imageLayoutComboBox = new UIComboBox(LAYOUT);
initTextRotationCombox(); initTextRotationCombox();
Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_s_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_s_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/defaultAlignment.png")}; BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/defaultAlignment.png")};
Integer[] hAlignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT, Integer.valueOf(Constants.DISTRIBUTED), Constants.NULL}; Integer[] hAlignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT, Integer.valueOf(Constants.DISTRIBUTED), Constants.NULL};
hAlignmentPane = new UIButtonGroup<Integer>(hAlignmentIconArray, hAlignment); hAlignmentPane = new UIButtonGroup<Integer>(hAlignmentIconArray, hAlignment);
hAlignmentPane.setAllToolTips(new String[]{Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Left"), Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Center"), Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Right"), hAlignmentPane.setAllToolTips(new String[]{Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Left"), Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Center"), Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Right"),
Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Distributed"),Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_DEFAULT")}); Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Distributed"), Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_DEFAULT")});
hPaneContainer = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); hPaneContainer = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
vPaneContainer = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); vPaneContainer = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
Icon[] vAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_top_normal.png"), Icon[] vAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_top_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_center_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_center_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_down_normal.png")}; BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_down_normal.png")};
Integer[] vAlignment = new Integer[]{Constants.TOP, Constants.CENTER, Constants.BOTTOM}; Integer[] vAlignment = new Integer[]{Constants.TOP, Constants.CENTER, Constants.BOTTOM};
vAlignmentPane = new UIButtonGroup<Integer>(vAlignmentIconArray, vAlignment); vAlignmentPane = new UIButtonGroup<Integer>(vAlignmentIconArray, vAlignment);
vAlignmentPane.setAllToolTips(new String[]{Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Top"), Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Center"), Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Bottom")}); vAlignmentPane.setAllToolTips(new String[]{Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Top"), Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Center"), Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Bottom")});
initOtherComponent(); initOtherComponent();
initAllNames(); initAllNames();
indentationUnitProcessor = ExtraDesignClassManager.getInstance().getSingle(IndentationUnitProcessor.MARK_STRING); indentationUnitProcessor = ExtraDesignClassManager.getInstance().getSingle(IndentationUnitProcessor.MARK_STRING);
if (null == indentationUnitProcessor){ if (null == indentationUnitProcessor) {
indentationUnitProcessor = new DefaultIndentationUnitProcessor(); indentationUnitProcessor = new DefaultIndentationUnitProcessor();
} }
} }
private void initOtherComponent() { private void initOtherComponent() {
hPaneContainer.add(hAlignmentPane); hPaneContainer.add(hAlignmentPane);
vPaneContainer.add(vAlignmentPane); vPaneContainer.add(vAlignmentPane);
rotationPane = new UINumberDragPane(-ANGEL, ANGEL); rotationPane = new UINumberDragPane(-ANGEL, ANGEL);
leftIndentSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0); leftIndentSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
rightIndentSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0); rightIndentSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
spaceBeforeSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0); spaceBeforeSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
spaceAfterSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0); spaceAfterSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
lineSpaceSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0); lineSpaceSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
rotationBarCC = new JPanel(new CardLayout()); rotationBarCC = new JPanel(new CardLayout());
rotationBarCC.add(rotationPane, "show"); rotationBarCC.add(rotationPane, "show");
rotationBarCC.add(new JPanel(), "hide"); rotationBarCC.add(new JPanel(), "hide");
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(createPane(), BorderLayout.CENTER); this.add(createPane(), BorderLayout.CENTER);
textRotationComboBox.addItemListener(new ItemListener() { textRotationComboBox.addItemListener(new ItemListener() {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
CardLayout cc = (CardLayout) rotationBarCC.getLayout(); CardLayout cc = (CardLayout) rotationBarCC.getLayout();
cc.show(rotationBarCC, textRotationComboBox.getSelectedIndex() == 0 ? "show" : "hide"); cc.show(rotationBarCC, textRotationComboBox.getSelectedIndex() == 0 ? "show" : "hide");
} }
}); });
} }
private void initTextRotationCombox(){ private void initTextRotationCombox() {
ArrayList<String> selectOption = new ArrayList<String>(); ArrayList<String> selectOption = new ArrayList<String>();
selectOption.add(Inter.getLocText("FR-Designer_Custom-Angle")); selectOption.add(Inter.getLocText("FR-Designer_Custom-Angle"));
VerticalTextProcessor processor = ExtraClassManager.getInstance().getSingle(VerticalTextProcessor.XML_TAG, DefaultVerticalTextProcessor.class); VerticalTextProcessor processor = ExtraClassManager.getInstance().getSingle(VerticalTextProcessor.XML_TAG, DefaultVerticalTextProcessor.class);
selectOption.addAll(Arrays.asList(processor.getComboxOption())); selectOption.addAll(Arrays.asList(processor.getComboxOption()));
textRotationComboBox = new UIComboBox(selectOption.toArray(new String[selectOption.size()])); textRotationComboBox = new UIComboBox(selectOption.toArray(new String[selectOption.size()]));
} }
private void initAllNames() { private void initAllNames() {
hAlignmentPane.setGlobalName(Inter.getLocText("FR-Designer-StyleAlignment_Pane_Horizontal")); hAlignmentPane.setGlobalName(Inter.getLocText("FR-Designer-StyleAlignment_Pane_Horizontal"));
vAlignmentPane.setGlobalName(Inter.getLocText("FR-Designer-StyleAlignment_Pane_Vertical")); vAlignmentPane.setGlobalName(Inter.getLocText("FR-Designer-StyleAlignment_Pane_Vertical"));
imageLayoutComboBox.setGlobalName(Inter.getLocText("Image-Image_Layout")); imageLayoutComboBox.setGlobalName(Inter.getLocText("FR-Designer_Image_Layout"));
textComboBox.setGlobalName(Inter.getLocText("StyleAlignment-Text_Style")); textComboBox.setGlobalName(Inter.getLocText("FR-Designer_StyleAlignment_Text_Style"));
textRotationComboBox.setGlobalName(Inter.getLocText("StyleAlignment-Text_Rotation")); textRotationComboBox.setGlobalName(Inter.getLocText("FR-Designer_StyleAlignment_Text_Rotation"));
rotationPane.setGlobalName(Inter.getLocText("StyleAlignment-Text_Rotation")); rotationPane.setGlobalName(Inter.getLocText("FR-Designer_StyleAlignment_Text_Rotation"));
leftIndentSpinner.setGlobalName(Inter.getLocText("Style-Left_Indent")); leftIndentSpinner.setGlobalName(Inter.getLocText("FR-Designer_Style_Left_Indent"));
rightIndentSpinner.setGlobalName(Inter.getLocText("Style-Right_Indent")); rightIndentSpinner.setGlobalName(Inter.getLocText("FR-Designer_Style_Right_Indent"));
spaceBeforeSpinner.setGlobalName(Inter.getLocText("Style-Spacing_Before")); spaceBeforeSpinner.setGlobalName(Inter.getLocText("FR-Designer_Style_Spacing_Before"));
spaceAfterSpinner.setGlobalName(Inter.getLocText("Style-Spacing_After")); spaceAfterSpinner.setGlobalName(Inter.getLocText("FR-Designer_Style_Spacing_After"));
lineSpaceSpinner.setGlobalName(Inter.getLocText("Style-Line_Spacing")); lineSpaceSpinner.setGlobalName(Inter.getLocText("FR-Designer_Style_Line_Spacing"));
} }
private JPanel createPane() {
private JPanel createPane() { JPanel jp1 = new JPanel(new BorderLayout());
JPanel jp1 = new JPanel(new BorderLayout(0, 10)); basicPane = new JPanel();
JPanel jp2 = new JPanel(new BorderLayout(0, 10)); seniorPane = new JPanel();
double p = TableLayout.PREFERRED; basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 290, 20, basicPane());
double f = TableLayout.FILL; seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 290, 20, seniorPane());
double[] columnSize1 = {p, f};
double[] rowSize1 = {p, p, p, p, p, p, p, p, p, p, p, p, p, p}; jp1.add(basicPane, BorderLayout.NORTH);
Component[][] components1 = new Component[][]{ jp1.add(seniorPane, BorderLayout.CENTER);
new Component[]{new UILabel(Inter.getLocText("FR-Designer-StyleAlignment_Pane_Style")), null},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-StyleAlignment_Pane_Horizontal") + ":", UILabel.RIGHT), hPaneContainer}, return jp1;
new Component[]{new UILabel(Inter.getLocText("FR-Designer-StyleAlignment_Pane_Vertical") + ":", UILabel.RIGHT), vPaneContainer}, }
new Component[]{new JSeparator(JSeparator.HORIZONTAL), null},
new Component[]{new UILabel(Inter.getLocText("Image-Image_Layout")), null}, private JPanel basicPane() {
new Component[]{imageLayoutComboBox, null}, double f = TableLayout.FILL;
new Component[]{new JSeparator(JSeparator.HORIZONTAL), null}, double p = TableLayout.PREFERRED;
new Component[]{new UILabel(Inter.getLocText("StyleAlignment-Text_Style")), null}, Component[][] components = new Component[][]{
new Component[]{textComboBox, null}, new Component[]{null, null},
new Component[]{new JSeparator(JSeparator.HORIZONTAL), null}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-StyleAlignment_Pane_Horizontal") + " ", SwingConstants.LEFT), hPaneContainer},
new Component[]{new UILabel(Inter.getLocText("StyleAlignment-Text_Rotation")), null}, new Component[]{null, null},
new Component[]{textRotationComboBox, null}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-StyleAlignment_Pane_Vertical") + " ", SwingConstants.RIGHT), vPaneContainer},
new Component[]{rotationBarCC, null}, new Component[]{null, null}
new Component[]{new JSeparator(JSeparator.HORIZONTAL), null}, };
}; double[] rowSize = {p, p, p, p, p, p};
double[] columnSize = {p, f};
double[] columnSize2 = {p, f}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
double[] rowSize2 = {p, p, p, p}; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
Component[][] components2 = new Component[][]{ }
new Component[]{new UILabel(Inter.getLocText("FR-Designer-StyleAlignment_Style_Indentation")), null},
new Component[]{new UILabel(Inter.getLocText("Style-Left_Indent") + ":", SwingConstants.RIGHT), creatSpinnerPane(leftIndentSpinner)}, private JPanel seniorPane() {
new Component[]{new UILabel(Inter.getLocText("Style-Right_Indent") + ":", SwingConstants.RIGHT), creatSpinnerPane(rightIndentSpinner)}, JPanel senPane = new JPanel(new BorderLayout());
new Component[]{new JSeparator(JSeparator.HORIZONTAL), null}, double f = TableLayout.FILL;
}; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
double[] columnSize3 = {p, f}; new Component[]{null, null},
double[] rowSize3 = {p, p, p, p}; new Component[]{new UILabel((Inter.getLocText("FR-Designer_Image_Layout")) + " ", SwingConstants.LEFT), imageLayoutComboBox},
Component[][] components3 = new Component[][]{ new Component[]{null, null},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-StyleAlignment_Style_Spacing")), null}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_StyleAlignment_Text_Style") + " ", SwingConstants.LEFT), textComboBox},
new Component[]{new UILabel(Inter.getLocText("Style-Spacing_Before") + ":", SwingConstants.RIGHT), creatSpinnerPane(spaceBeforeSpinner)}, new Component[]{null, null},
new Component[]{new UILabel(Inter.getLocText("Style-Spacing_After") + ":", SwingConstants.RIGHT), creatSpinnerPane(spaceAfterSpinner)}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_StyleAlignment_Text_Rotation") + " ", SwingConstants.LEFT), textRotationComboBox},
new Component[]{new UILabel(Inter.getLocText("Style-Line_Spacing") + ":", SwingConstants.RIGHT), creatSpinnerPane(lineSpaceSpinner)}, new Component[]{null, rotationBarCC},
}; new Component[]{null, null},
JPanel northPane = TableLayoutHelper.createTableLayoutPane(components1, rowSize1, columnSize1); };
JPanel centerPane = TableLayoutHelper.createTableLayoutPane(components2, rowSize2, columnSize2); double[] rowSize = {p, p, p, p, p, p, p, p};
JPanel southPane = TableLayoutHelper.createTableLayoutPane(components3, rowSize3, columnSize3); double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
jp2.add(centerPane, BorderLayout.NORTH); JPanel tempPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
jp2.add(southPane, BorderLayout.CENTER); senPane.add(tempPane, BorderLayout.NORTH);
jp1.add(northPane, BorderLayout.NORTH); senPane.add(seniorDownPane(), BorderLayout.CENTER);
jp1.add(jp2, BorderLayout.CENTER); return senPane;
return jp1;
} }
private JPanel creatSpinnerPane(Component comp) { private JPanel seniorDownPane() {
JPanel jp = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); double f = TableLayout.FILL;
jp.add(comp); double p = TableLayout.PREFERRED;
return jp; leftIndentSpinner.setPreferredSize(SPINNER_DIMENSION);
} rightIndentSpinner.setPreferredSize(SPINNER_DIMENSION);
spaceBeforeSpinner.setPreferredSize(SPINNER_DIMENSION);
/** spaceAfterSpinner.setPreferredSize(SPINNER_DIMENSION);
* 标题 lineSpaceSpinner.setPreferredSize(SPINNER_DIMENSION);
* @return 标题 Component[][] components = new Component[][]{
*/ new Component[]{null, null, null},
public String title4PopupWindow() { new Component[]{new UILabel((Inter.getLocText("FR-Designer-StyleAlignment_Style_Indentation")) + " ", SwingConstants.LEFT), creatSpinnerPane(leftIndentSpinner), creatSpinnerPane(rightIndentSpinner)},
return Inter.getLocText("FR-Designer-StyleAlignment_Style_Alignment"); new Component[]{null, new UILabel((Inter.getLocText("FR-Designer_Left")), SwingConstants.CENTER), new UILabel((Inter.getLocText("FR-Designer_Right")), SwingConstants.CENTER)},
} new Component[]{new UILabel((Inter.getLocText("FR-Designer-StyleAlignment_Style_PartSpacing")) + " ", SwingConstants.LEFT), creatSpinnerPane(spaceBeforeSpinner), creatSpinnerPane(spaceAfterSpinner)},
new Component[]{null, new UILabel((Inter.getLocText("FR-Designer_Front")), SwingConstants.CENTER), new UILabel((Inter.getLocText("FR-Designer_Behind")), SwingConstants.CENTER)},
/** new Component[]{new UILabel((Inter.getLocText("FR-Designer_Style_Line_Spacing")) + " ", SwingConstants.LEFT), creatSpinnerPane(lineSpaceSpinner), null},
* Populate cellstyle border. };
* double[] rowSize = {p, p, p, p, p, p};
* @param style the new style. double[] columnSize = {p, f, f};
*/ return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
public void populateBean(Style style) { }
hAlignmentPane.setSelectedItem(BaseUtils.getAlignment4Horizontal(style));
vAlignmentPane.setSelectedItem(style.getVerticalAlignment()); private JPanel creatSpinnerPane(Component comp) {
JPanel jp = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
if (style.getTextStyle() == Style.TEXTSTYLE_SINGLELINE) { jp.add(comp);
this.textComboBox.setSelectedIndex(1); return jp;
} else if (style.getTextStyle() == Style.TEXTSTYLE_SINGLELINEADJUSTFONT) { }
this.textComboBox.setSelectedIndex(2);
} else if (style.getTextStyle() == Style.TEXTSTYLE_MULTILINEADJUSTFONT) { /**
this.textComboBox.setSelectedIndex(3); * 标题
} else { *
this.textComboBox.setSelectedIndex(0); * @return 标题
} */
if (style.getVerticalText() == Style.VERTICALTEXT) { public String title4PopupWindow() {
textRotationComboBox.setSelectedIndex(style.getTextDirection() == Style.LEFT_TO_RIGHT ? 1 : 2); return Inter.getLocText("FR-Designer-StyleAlignment_Style_Alignment");
} else { }
textRotationComboBox.setSelectedIndex(0);
rotationPane.populateBean((double) style.getRotation()); /**
} * Populate cellstyle border.
if (style.getImageLayout() == Constants.IMAGE_TILED) {
imageLayoutComboBox.setSelectedIndex(1);
} else if (style.getImageLayout() == Constants.IMAGE_EXTEND) {
imageLayoutComboBox.setSelectedIndex(2);
} else if (style.getImageLayout() == Constants.IMAGE_ADJUST) {
imageLayoutComboBox.setSelectedIndex(3);
} else {
imageLayoutComboBox.setSelectedIndex(0);
}
int leftPadding = indentationUnitProcessor.paddingUnitProcessor(style.getPaddingLeft());
int rightPadding = indentationUnitProcessor.paddingUnitProcessor(style.getPaddingRight());
// alex:indent
this.leftIndentSpinner.setValue(new Integer(leftPadding));
this.rightIndentSpinner.setValue(new Integer(rightPadding));
this.spaceBeforeSpinner.setValue(style.getSpacingBefore());
this.spaceAfterSpinner.setValue(style.getSpacingAfter());
this.lineSpaceSpinner.setValue(style.getLineSpacing());
}
/**
* Update cellstyle border
*
* @param style the new style.
*/
public Style update(Style style) {
// peter:需要判断传递进来的值是否为null.
if (style == null) {
return style;
}
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("FR-Designer-StyleAlignment_Pane_Horizontal"))) {
Integer h = this.hAlignmentPane.getSelectedItem();
style = style.deriveHorizontalAlignment(h == null ? -1 : h);
}
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("FR-Designer-StyleAlignment_Pane_Vertical"))) {
Integer vAlign = this.vAlignmentPane.getSelectedItem();
if (vAlign != null) {
style = style.deriveVerticalAlignment(vAlign);
}
}
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("StyleAlignment-Text_Style"))) {
if (ComparatorUtils.equals(this.textComboBox.getSelectedItem(), TEXT[0])) {
style = style.deriveTextStyle(Style.TEXTSTYLE_WRAPTEXT);
} else if (ComparatorUtils.equals(this.textComboBox.getSelectedItem(), TEXT[1])) {
style = style.deriveTextStyle(Style.TEXTSTYLE_SINGLELINE);
} else if (ComparatorUtils.equals(this.textComboBox.getSelectedItem(), TEXT[2])) {
style = style.deriveTextStyle(Style.TEXTSTYLE_SINGLELINEADJUSTFONT);
} else {
style = style.deriveTextStyle(Style.TEXTSTYLE_MULTILINEADJUSTFONT);
}
}
style = updateImageLayout(style);
style = updateTextRotation(style);
style = updateOther(style);
return style;
}
private Style updateImageLayout(Style style) {
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("Image-Image_Layout"))) {
if (ComparatorUtils.equals(this.imageLayoutComboBox.getSelectedItem(), LAYOUT[1])) {
style = style.deriveImageLayout(Constants.IMAGE_TILED);
} else if (ComparatorUtils.equals(this.imageLayoutComboBox.getSelectedItem(), LAYOUT[2])) {
style = style.deriveImageLayout(Constants.IMAGE_EXTEND);
} else if (ComparatorUtils.equals(this.imageLayoutComboBox.getSelectedItem(), LAYOUT[3])) {
style = style.deriveImageLayout(Constants.IMAGE_ADJUST);
} else {
style = style.deriveImageLayout(Constants.IMAGE_CENTER);
}
}
return style;
}
private Style updateTextRotation(Style style) {
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("StyleAlignment-Text_Rotation"))) {
if (this.textRotationComboBox.getSelectedIndex() != 0) {
style = style.deriveVerticalText(Style.VERTICALTEXT);
style = style.deriveRotation(0);
style = style.deriveTextDirection(this.textRotationComboBox.getSelectedIndex() == 1 ? Style.LEFT_TO_RIGHT : Style.RIGHT_TO_LEFT);
} else {
style = style.deriveVerticalText(Style.HORIZONTALTEXT);
style = style.deriveRotation(rotationPane.updateBean().intValue());
}
}
return style;
}
private Style updateOther(Style style) {
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("Style-Left_Indent"))) {
style = style.derivePaddingLeft(indentationUnitProcessor.paddingUnitGainFromSpinner((int)(this.leftIndentSpinner.getValue())));
}
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("Style-Right_Indent"))) {
style = style.derivePaddingRight(indentationUnitProcessor.paddingUnitGainFromSpinner((int)(this.rightIndentSpinner.getValue())));
}
//间距
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("Style-Spacing_Before"))) {
style = style.deriveSpacingBefore((int) (this.spaceBeforeSpinner.getValue()));
}
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("Style-Spacing_After"))) {
style = style.deriveSpacingAfter((int) (this.spaceAfterSpinner.getValue()));
}
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("Style-Line_Spacing"))) {
style = style.deriveLineSpacing((int) (this.lineSpaceSpinner.getValue()));
}
return style;
}
/**
* 注册监听事件
* *
* @param listener 观察者监听事件 * @param style the new style.
*/ */
public void registerNameListener(GlobalNameListener listener) { public void populateBean(Style style) {
globalNameListener = listener; hAlignmentPane.setSelectedItem(BaseUtils.getAlignment4Horizontal(style));
} vAlignmentPane.setSelectedItem(style.getVerticalAlignment());
/** if (style.getTextStyle() == Style.TEXTSTYLE_SINGLELINE) {
* 是否响应监听 this.textComboBox.setSelectedIndex(1);
* } else if (style.getTextStyle() == Style.TEXTSTYLE_SINGLELINEADJUSTFONT) {
* @return this.textComboBox.setSelectedIndex(2);
*/ } else if (style.getTextStyle() == Style.TEXTSTYLE_MULTILINEADJUSTFONT) {
public boolean shouldResponseNameListener() { this.textComboBox.setSelectedIndex(3);
return false; } else {
} this.textComboBox.setSelectedIndex(0);
}
/** if (style.getVerticalText() == Style.VERTICALTEXT) {
* textRotationComboBox.setSelectedIndex(style.getTextDirection() == Style.LEFT_TO_RIGHT ? 1 : 2);
* @param name } else {
*/ textRotationComboBox.setSelectedIndex(0);
public void setGlobalName(String name) { rotationPane.populateBean((double) style.getRotation());
} }
if (style.getImageLayout() == Constants.IMAGE_TILED) {
imageLayoutComboBox.setSelectedIndex(1);
} else if (style.getImageLayout() == Constants.IMAGE_EXTEND) {
imageLayoutComboBox.setSelectedIndex(2);
} else if (style.getImageLayout() == Constants.IMAGE_ADJUST) {
imageLayoutComboBox.setSelectedIndex(3);
} else {
imageLayoutComboBox.setSelectedIndex(0);
}
int leftPadding = indentationUnitProcessor.paddingUnitProcessor(style.getPaddingLeft());
int rightPadding = indentationUnitProcessor.paddingUnitProcessor(style.getPaddingRight());
// alex:indent
this.leftIndentSpinner.setValue(new Integer(leftPadding));
this.rightIndentSpinner.setValue(new Integer(rightPadding));
this.spaceBeforeSpinner.setValue(style.getSpacingBefore());
this.spaceAfterSpinner.setValue(style.getSpacingAfter());
this.lineSpaceSpinner.setValue(style.getLineSpacing());
}
/**
* Update cellstyle border
*
* @param style the new style.
*/
public Style update(Style style) {
// peter:需要判断传递进来的值是否为null.
if (style == null) {
return style;
}
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("FR-Designer-StyleAlignment_Pane_Horizontal"))) {
Integer h = this.hAlignmentPane.getSelectedItem();
style = style.deriveHorizontalAlignment(h == null ? -1 : h);
}
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("FR-Designer-StyleAlignment_Pane_Vertical"))) {
Integer vAlign = this.vAlignmentPane.getSelectedItem();
if (vAlign != null) {
style = style.deriveVerticalAlignment(vAlign);
}
}
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("FR-Designer_StyleAlignment_Text_Style"))) {
if (ComparatorUtils.equals(this.textComboBox.getSelectedItem(), TEXT[0])) {
style = style.deriveTextStyle(Style.TEXTSTYLE_WRAPTEXT);
} else if (ComparatorUtils.equals(this.textComboBox.getSelectedItem(), TEXT[1])) {
style = style.deriveTextStyle(Style.TEXTSTYLE_SINGLELINE);
} else if (ComparatorUtils.equals(this.textComboBox.getSelectedItem(), TEXT[2])) {
style = style.deriveTextStyle(Style.TEXTSTYLE_SINGLELINEADJUSTFONT);
} else {
style = style.deriveTextStyle(Style.TEXTSTYLE_MULTILINEADJUSTFONT);
}
}
style = updateImageLayout(style);
style = updateTextRotation(style);
style = updateOther(style);
return style;
}
private Style updateImageLayout(Style style) {
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("FR-Designer_Image_Layout"))) {
if (ComparatorUtils.equals(this.imageLayoutComboBox.getSelectedItem(), LAYOUT[1])) {
style = style.deriveImageLayout(Constants.IMAGE_TILED);
} else if (ComparatorUtils.equals(this.imageLayoutComboBox.getSelectedItem(), LAYOUT[2])) {
style = style.deriveImageLayout(Constants.IMAGE_EXTEND);
} else if (ComparatorUtils.equals(this.imageLayoutComboBox.getSelectedItem(), LAYOUT[3])) {
style = style.deriveImageLayout(Constants.IMAGE_ADJUST);
} else {
style = style.deriveImageLayout(Constants.IMAGE_CENTER);
}
}
return style;
}
private Style updateTextRotation(Style style) {
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("FR-Designer_StyleAlignment_Text_Rotation"))) {
if (this.textRotationComboBox.getSelectedIndex() != 0) {
style = style.deriveVerticalText(Style.VERTICALTEXT);
style = style.deriveRotation(0);
style = style.deriveTextDirection(this.textRotationComboBox.getSelectedIndex() == 1 ? Style.LEFT_TO_RIGHT : Style.RIGHT_TO_LEFT);
} else {
style = style.deriveVerticalText(Style.HORIZONTALTEXT);
style = style.deriveRotation(rotationPane.updateBean().intValue());
}
}
return style;
}
private Style updateOther(Style style) {
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("FR-Designer_Style_Left_Indent"))) {
style = style.derivePaddingLeft(indentationUnitProcessor.paddingUnitGainFromSpinner((int) (this.leftIndentSpinner.getValue())));
}
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("FR-Designer_Style_Right_Indent"))) {
style = style.derivePaddingRight(indentationUnitProcessor.paddingUnitGainFromSpinner((int) (this.rightIndentSpinner.getValue())));
}
//间距
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("FR-Designer_Style_Spacing_Before"))) {
style = style.deriveSpacingBefore((int) (this.spaceBeforeSpinner.getValue()));
}
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("FR-Designer_Style_Spacing_After"))) {
style = style.deriveSpacingAfter((int) (this.spaceAfterSpinner.getValue()));
}
if (ComparatorUtils.equals(globalNameListener.getGlobalName(), Inter.getLocText("FR-Designer_Style_Line_Spacing"))) {
style = style.deriveLineSpacing((int) (this.lineSpaceSpinner.getValue()));
}
return style;
}
/**
* 注册监听事件
*
* @param listener 观察者监听事件
*/
public void registerNameListener(GlobalNameListener listener) {
globalNameListener = listener;
}
/**
* 是否响应监听
*
* @return
*/
public boolean shouldResponseNameListener() {
return false;
}
/**
* @param name
*/
public void setGlobalName(String name) {
}
} }

386
designer_base/src/com/fr/design/gui/style/BorderPane.java

@ -4,218 +4,214 @@ package com.fr.design.gui.style;
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved. * Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/ */
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.GridLayout;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.CellBorderStyle; import com.fr.base.CellBorderStyle;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.color.NewColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.design.style.color.NewColorSelectBox;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
/** /**
* @author zhou * @author zhou
* @since 2012-5-28下午6:22:04 * @since 2012-5-28下午6:22:04
*/ */
public class BorderPane extends AbstractBasicStylePane { public class BorderPane extends AbstractBasicStylePane {
private boolean insideMode = false; private boolean insideMode = false;
private UIToggleButton topToggleButton; private UIToggleButton topToggleButton;
private UIToggleButton horizontalToggleButton; private UIToggleButton horizontalToggleButton;
private UIToggleButton bottomToggleButton; private UIToggleButton bottomToggleButton;
private UIToggleButton leftToggleButton; private UIToggleButton leftToggleButton;
private UIToggleButton verticalToggleButton; private UIToggleButton verticalToggleButton;
private UIToggleButton rightToggleButton; private UIToggleButton rightToggleButton;
private UIToggleButton innerToggleButton; private UIToggleButton innerToggleButton;
private UIToggleButton outerToggleButton; private UIToggleButton outerToggleButton;
private LineComboBox currentLineCombo; private LineComboBox currentLineCombo;
private NewColorSelectBox currentLineColorPane; private NewColorSelectBox currentLineColorPane;
private JPanel panel; private JPanel panel;
private JPanel borderPanel; private JPanel borderPanel;
private JPanel backgroundPanel; private JPanel backgroundPanel;
private BackgroundPane backgroundPane; private BackgroundPane backgroundPane;
public BorderPane() { public BorderPane() {
this.initComponents(); this.initComponents();
} }
public static void main(String[] args){ public static void main(String[] args) {
JFrame jf = new JFrame("test"); JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane(); JPanel content = (JPanel) jf.getContentPane();
content.setLayout(new BorderLayout()); content.setLayout(new BorderLayout());
content.add(new BorderPane(), BorderLayout.CENTER); content.add(new BorderPane(), BorderLayout.CENTER);
GUICoreUtils.centerWindow(jf); GUICoreUtils.centerWindow(jf);
jf.setSize(290, 400); jf.setSize(290, 400);
jf.setVisible(true); jf.setVisible(true);
} }
protected void initComponents() {
initButtonsWithIcon(); protected void initComponents() {
this.setLayout(new BorderLayout(0, 6)); initButtonsWithIcon();
JPanel externalPane = new JPanel(new GridLayout(0, 4)); this.setLayout(new BorderLayout(0, 6));
externalPane.add(topToggleButton); JPanel externalPane = new JPanel(new GridLayout(0, 4));
externalPane.add(leftToggleButton); externalPane.add(topToggleButton);
externalPane.add(bottomToggleButton); externalPane.add(leftToggleButton);
externalPane.add(rightToggleButton); externalPane.add(bottomToggleButton);
JPanel insidePane = new JPanel(new GridLayout(0, 2)); externalPane.add(rightToggleButton);
insidePane.add(horizontalToggleButton); JPanel insidePane = new JPanel(new GridLayout(0, 2));
insidePane.add(verticalToggleButton); insidePane.add(horizontalToggleButton);
double f = TableLayout.FILL; insidePane.add(verticalToggleButton);
double p = TableLayout.PREFERRED; double f = TableLayout.FILL;
Component[][] components = new Component[][]{ double p = TableLayout.PREFERRED;
new Component[]{null,null}, Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Style") + " ", SwingConstants.LEFT), currentLineCombo}, new Component[]{null, null},
new Component[]{null,null}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Style") + " ", SwingConstants.LEFT), currentLineCombo},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Color") + " ", SwingConstants.LEFT), currentLineColorPane}, new Component[]{null, null},
new Component[]{null,null}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Color") + " ", SwingConstants.LEFT), currentLineColorPane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_outBorder") +" ", SwingConstants.LEFT),outerToggleButton = new UIToggleButton(BaseUtils.readIcon("com/fr/design/images/m_format/out.png"))}, new Component[]{null, null},
new Component[]{null,externalPane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_outBorder") + " ", SwingConstants.LEFT), outerToggleButton = new UIToggleButton(BaseUtils.readIcon("com/fr/design/images/m_format/out.png"))},
new Component[]{null,null}, new Component[]{null, externalPane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_inBorder") +" ", SwingConstants.LEFT),innerToggleButton = new UIToggleButton(BaseUtils.readIcon("com/fr/design/images/m_format/in.png"))}, new Component[]{null, null},
new Component[]{null,insidePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_inBorder") + " ", SwingConstants.LEFT), innerToggleButton = new UIToggleButton(BaseUtils.readIcon("com/fr/design/images/m_format/in.png"))},
new Component[]{null,null} new Component[]{null, insidePane},
}; new Component[]{null, null}
double[] rowSize = {p, p, p, p, p, p, p, p, p, p, p}; };
double[] columnSize = {p,f}; double[] rowSize = {p, p, p, p, p, p, p, p, p, p, p};
int[][] rowCount = {{1, 1},{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; double[] columnSize = {p, f};
panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
borderPanel = new UIExpandablePane(Inter.getLocText("FR-Designer_Border"),280,20,panel); panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM);
this.add(borderPanel,BorderLayout.NORTH); borderPanel = new UIExpandablePane(Inter.getLocText("FR-Designer_Border"), 280, 20, panel);
this.add(borderPanel, BorderLayout.NORTH);
backgroundPane = new BackgroundPane();
backgroundPanel = new UIExpandablePane(Inter.getLocText("FR-Designer_Background"),280,20,backgroundPane); backgroundPane = new BackgroundPane();
this.add(backgroundPanel,BorderLayout.CENTER); backgroundPanel = new UIExpandablePane(Inter.getLocText("FR-Designer_Background"), 280, 20, backgroundPane);
this.add(backgroundPanel, BorderLayout.CENTER);
outerToggleButton.addChangeListener(outerToggleButtonChangeListener);
innerToggleButton.addChangeListener(innerToggleButtonChangeListener); outerToggleButton.addChangeListener(outerToggleButtonChangeListener);
} innerToggleButton.addChangeListener(innerToggleButtonChangeListener);
}
ChangeListener outerToggleButtonChangeListener = new ChangeListener() {
@Override ChangeListener outerToggleButtonChangeListener = new ChangeListener() {
public void stateChanged(ChangeEvent e) { @Override
boolean value = outerToggleButton.isSelected(); public void stateChanged(ChangeEvent e) {
topToggleButton.setSelected(value); boolean value = outerToggleButton.isSelected();
bottomToggleButton.setSelected(value); topToggleButton.setSelected(value);
leftToggleButton.setSelected(value); bottomToggleButton.setSelected(value);
rightToggleButton.setSelected(value); leftToggleButton.setSelected(value);
} rightToggleButton.setSelected(value);
}; }
};
ChangeListener innerToggleButtonChangeListener = new ChangeListener() {
@Override ChangeListener innerToggleButtonChangeListener = new ChangeListener() {
public void stateChanged(ChangeEvent e) { @Override
boolean value = innerToggleButton.isSelected(); public void stateChanged(ChangeEvent e) {
horizontalToggleButton.setSelected(value); boolean value = innerToggleButton.isSelected();
verticalToggleButton.setSelected(value); horizontalToggleButton.setSelected(value);
} verticalToggleButton.setSelected(value);
}; }
};
private void initButtonsWithIcon(){
topToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/top.png")); private void initButtonsWithIcon() {
leftToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/left.png")); topToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/top.png"));
bottomToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/bottom.png")); leftToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/left.png"));
rightToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/right.png")); bottomToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/bottom.png"));
horizontalToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/horizontal.png")); rightToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/right.png"));
verticalToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/vertical.png")); horizontalToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/horizontal.png"));
this.currentLineCombo = new LineComboBox(CoreConstants.UNDERLINE_STYLE_ARRAY); verticalToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/vertical.png"));
this.currentLineColorPane = new NewColorSelectBox(100); this.currentLineCombo = new LineComboBox(CoreConstants.UNDERLINE_STYLE_ARRAY);
} this.currentLineColorPane = new NewColorSelectBox(100);
}
@Override
public String title4PopupWindow() { @Override
return Inter.getLocText("FR-Designer_Border"); public String title4PopupWindow() {
} return Inter.getLocText("FR-Designer_Cell");
}
@Override
public void populateBean(Style style) { @Override
if (style == null) { public void populateBean(Style style) {
style = Style.DEFAULT_STYLE; if (style == null) {
} style = Style.DEFAULT_STYLE;
}
CellBorderStyle cellBorderStyle = new CellBorderStyle();
cellBorderStyle.setTopStyle(style.getBorderTop()); CellBorderStyle cellBorderStyle = new CellBorderStyle();
cellBorderStyle.setTopColor(style.getBorderTopColor()); cellBorderStyle.setTopStyle(style.getBorderTop());
cellBorderStyle.setLeftStyle(style.getBorderLeft()); cellBorderStyle.setTopColor(style.getBorderTopColor());
cellBorderStyle.setLeftColor(style.getBorderLeftColor()); cellBorderStyle.setLeftStyle(style.getBorderLeft());
cellBorderStyle.setBottomStyle(style.getBorderBottom()); cellBorderStyle.setLeftColor(style.getBorderLeftColor());
cellBorderStyle.setBottomColor(style.getBorderBottomColor()); cellBorderStyle.setBottomStyle(style.getBorderBottom());
cellBorderStyle.setRightStyle(style.getBorderRight()); cellBorderStyle.setBottomColor(style.getBorderBottomColor());
cellBorderStyle.setRightColor(style.getBorderRightColor()); cellBorderStyle.setRightStyle(style.getBorderRight());
this.backgroundPane.populateBean(style.getBackground()); cellBorderStyle.setRightColor(style.getBorderRightColor());
this.populateBean(cellBorderStyle, false, style.getBorderTop(), style.getBorderTopColor()); this.backgroundPane.populateBean(style.getBackground());
this.populateBean(cellBorderStyle, false, style.getBorderTop(), style.getBorderTopColor());
}
}
public void populateBean(CellBorderStyle cellBorderStyle, boolean insideMode, int currentStyle, Color currentColor) {
this.insideMode = insideMode; public void populateBean(CellBorderStyle cellBorderStyle, boolean insideMode, int currentStyle, Color currentColor) {
this.insideMode = insideMode;
this.currentLineCombo.setSelectedLineStyle(cellBorderStyle.getTopStyle() == Constants.LINE_NONE ? Constants.LINE_THIN : cellBorderStyle.getTopStyle());
this.currentLineColorPane.setSelectObject(cellBorderStyle.getTopColor()); this.currentLineCombo.setSelectedLineStyle(cellBorderStyle.getTopStyle() == Constants.LINE_NONE ? Constants.LINE_THIN : cellBorderStyle.getTopStyle());
this.currentLineColorPane.setSelectObject(cellBorderStyle.getTopColor());
this.topToggleButton.setSelected(cellBorderStyle.getTopStyle() != Constants.LINE_NONE);
this.bottomToggleButton.setSelected(cellBorderStyle.getBottomStyle() != Constants.LINE_NONE); this.topToggleButton.setSelected(cellBorderStyle.getTopStyle() != Constants.LINE_NONE);
this.leftToggleButton.setSelected(cellBorderStyle.getLeftStyle() != Constants.LINE_NONE); this.bottomToggleButton.setSelected(cellBorderStyle.getBottomStyle() != Constants.LINE_NONE);
this.rightToggleButton.setSelected(cellBorderStyle.getRightStyle() != Constants.LINE_NONE); this.leftToggleButton.setSelected(cellBorderStyle.getLeftStyle() != Constants.LINE_NONE);
this.rightToggleButton.setSelected(cellBorderStyle.getRightStyle() != Constants.LINE_NONE);
this.horizontalToggleButton.setSelected(cellBorderStyle.getHorizontalStyle() != Constants.LINE_NONE);
this.verticalToggleButton.setSelected(cellBorderStyle.getVerticalStyle() != Constants.LINE_NONE); this.horizontalToggleButton.setSelected(cellBorderStyle.getHorizontalStyle() != Constants.LINE_NONE);
this.verticalToggleButton.setSelected(cellBorderStyle.getVerticalStyle() != Constants.LINE_NONE);
this.innerToggleButton.setSelected(cellBorderStyle.getInnerBorder() != Constants.LINE_NONE);
this.outerToggleButton.setSelected(cellBorderStyle.getOuterBorderStyle() != Constants.LINE_NONE); this.innerToggleButton.setSelected(cellBorderStyle.getInnerBorder() != Constants.LINE_NONE);
this.outerToggleButton.setSelected(cellBorderStyle.getOuterBorderStyle() != Constants.LINE_NONE);
this.innerToggleButton.setEnabled(this.insideMode); this.innerToggleButton.setEnabled(this.insideMode);
this.horizontalToggleButton.setEnabled(this.insideMode); this.horizontalToggleButton.setEnabled(this.insideMode);
this.verticalToggleButton.setEnabled(this.insideMode); this.verticalToggleButton.setEnabled(this.insideMode);
} }
public Style update(Style style) { public Style update(Style style) {
style = style.deriveBackground(backgroundPane.update()); style = style.deriveBackground(backgroundPane.update());
if (style == null) { if (style == null) {
style = Style.DEFAULT_STYLE; style = Style.DEFAULT_STYLE;
} }
CellBorderStyle cellBorderStyle = this.update(); CellBorderStyle cellBorderStyle = this.update();
style = style.deriveBorder(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor(), cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor(), style = style.deriveBorder(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor(), cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor(),
cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor(), cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor()); cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor(), cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor());
return style; return style;
} }
public CellBorderStyle update() { public CellBorderStyle update() {
int lineStyle = currentLineCombo.getSelectedLineStyle(); int lineStyle = currentLineCombo.getSelectedLineStyle();
Color lineColor = currentLineColorPane.getSelectObject(); Color lineColor = currentLineColorPane.getSelectObject();
CellBorderStyle cellBorderStyle = new CellBorderStyle(); CellBorderStyle cellBorderStyle = new CellBorderStyle();
cellBorderStyle.setTopColor(lineColor); cellBorderStyle.setTopColor(lineColor);
cellBorderStyle.setTopStyle(topToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setTopStyle(topToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setBottomColor(lineColor); cellBorderStyle.setBottomColor(lineColor);
cellBorderStyle.setBottomStyle(bottomToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setBottomStyle(bottomToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setLeftColor(lineColor); cellBorderStyle.setLeftColor(lineColor);
cellBorderStyle.setLeftStyle(leftToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setLeftStyle(leftToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setRightColor(lineColor); cellBorderStyle.setRightColor(lineColor);
cellBorderStyle.setRightStyle(rightToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setRightStyle(rightToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setVerticalColor(lineColor); cellBorderStyle.setVerticalColor(lineColor);
cellBorderStyle.setVerticalStyle(verticalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setVerticalStyle(verticalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setHorizontalColor(lineColor); cellBorderStyle.setHorizontalColor(lineColor);
cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
return cellBorderStyle; return cellBorderStyle;
} }
} }

47
designer_base/src/com/fr/design/gui/style/FRFontPane.java

@ -4,35 +4,34 @@ package com.fr.design.gui.style;
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved. * Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/ */
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Vector;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.design.constants.UIConstants;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver; import com.fr.design.event.GlobalNameObserver;
import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.DefaultValues; import com.fr.general.DefaultValues;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Vector;
/** /**
* Pane to edit Font. * Pane to edit Font.
@ -68,7 +67,7 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
this.initComponents(); this.initComponents();
} }
public static void main(String[] args){ public static void main(String[] args) {
JFrame jf = new JFrame("test"); JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane(); JPanel content = (JPanel) jf.getContentPane();
@ -209,7 +208,7 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
return style.deriveFRFont(frFont); return style.deriveFRFont(frFont);
} }
public static Vector<Integer> getFontSizes(){ public static Vector<Integer> getFontSizes() {
Vector<Integer> FONT_SIZES = new Vector<Integer>(); Vector<Integer> FONT_SIZES = new Vector<Integer>();
for (int i = 1; i < MAX_FONT_SIZE; i++) { for (int i = 1; i < MAX_FONT_SIZE; i++) {
FONT_SIZES.add(i); FONT_SIZES.add(i);
@ -240,20 +239,16 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
subPane = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/sub.png")); subPane = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/sub.png"));
subPane.setPreferredSize(BUTTON_SIZE); subPane.setPreferredSize(BUTTON_SIZE);
isSuperOrSubPane = new TwoButtonPane(superPane, subPane); isSuperOrSubPane = new TwoButtonPane(superPane, subPane);
// Component[] components_font = new Component[]{
// colorSelectPane, italic, bold, underline, isStrikethroughCheckBox, isShadowCheckBox
// };
Component[] components_font = new Component[]{ Component[] components_font = new Component[]{
colorSelectPane, underline, isStrikethroughCheckBox, isShadowCheckBox colorSelectPane, underline, isStrikethroughCheckBox, isShadowCheckBox
}; };
buttonPane = new JPanel(new BorderLayout()); buttonPane = new JPanel(new BorderLayout());
buttonPane.add(GUICoreUtils.createFlowPane(components_font, FlowLayout.LEFT, LayoutConstants.HGAP_SMALL)); buttonPane.add(GUICoreUtils.createFlowPane(components_font, FlowLayout.LEFT, LayoutConstants.HGAP_SMALL));
// buttonPane.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
linePane = new JPanel(new CardLayout()); linePane = new JPanel(new CardLayout());
initAllNames(); initAllNames();
setToolTips(); setToolTips();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(fontNameComboBox, BorderLayout.NORTH); // this.add(fontNameComboBox, BorderLayout.NORTH);
this.add(createPane(), BorderLayout.CENTER); this.add(createPane(), BorderLayout.CENTER);
DefaultValues defaultValues = FRContext.getDefaultValues(); DefaultValues defaultValues = FRContext.getDefaultValues();
populateBean(defaultValues.getFRFont()); populateBean(defaultValues.getFRFont());
@ -328,15 +323,11 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
} }
private JPanel createPane() { private JPanel createPane() {
double p = TableLayout.PREFERRED; JPanel createPane = new JPanel(new BorderLayout(3, 5));
double f = TableLayout.FILL; createPane.add(fontNameComboBox, BorderLayout.NORTH);
double[] columnSize = {f, f}; createPane.add(createLeftPane(), BorderLayout.CENTER);
double[] rowSize = {p,p}; createPane.add(createRightPane(), BorderLayout.EAST);
Component[][] components = new Component[][]{ return createPane;
new Component[]{null, null},
new Component[]{createLeftPane(), createRightPane()},
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
} }
/** /**

55
designer_base/src/com/fr/design/gui/style/FormatPane.java

@ -15,7 +15,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -24,7 +23,8 @@ import javax.swing.*;
import javax.swing.border.Border; import javax.swing.border.Border;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.text.Format; import java.text.Format;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -34,7 +34,7 @@ import java.text.SimpleDateFormat;
* @author zhou * @author zhou
* @since 2012-5-24上午10:57:00 * @since 2012-5-24上午10:57:00
*/ */
public class FormatPane extends AbstractBasicStylePane{ public class FormatPane extends AbstractBasicStylePane {
private static final long serialVersionUID = 724330854437726751L; private static final long serialVersionUID = 724330854437726751L;
private static final int LABLE_X = 4; private static final int LABLE_X = 4;
@ -61,6 +61,7 @@ public class FormatPane extends AbstractBasicStylePane{
private boolean isRightFormate; private boolean isRightFormate;
private boolean isDate = false; private boolean isDate = false;
private boolean isFormat = false; private boolean isFormat = false;
/** /**
* Constructor. * Constructor.
*/ */
@ -68,17 +69,6 @@ public class FormatPane extends AbstractBasicStylePane{
this.initComponents(TYPES); this.initComponents(TYPES);
} }
public static void main(String[] args){
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(new BorderLayout());
content.add(new FormatPane(), BorderLayout.CENTER);
GUICoreUtils.centerWindow(jf);
jf.setSize(290, 400);
jf.setVisible(true);
}
protected void initComponents(Integer[] types) { protected void initComponents(Integer[] types) {
this.setLayout(new BorderLayout(0, 4)); this.setLayout(new BorderLayout(0, 4));
iniSampleLable(); iniSampleLable();
@ -95,7 +85,7 @@ public class FormatPane extends AbstractBasicStylePane{
contentPane.add(sampleLabel, BorderLayout.NORTH); contentPane.add(sampleLabel, BorderLayout.NORTH);
centerPane = new JPanel(new CardLayout()); centerPane = new JPanel(new CardLayout());
centerPane.add(new JPanel(), "hide"); centerPane.add(new JPanel(), "hide");
centerPane.setPreferredSize(new Dimension(0, 0) ); centerPane.setPreferredSize(new Dimension(0, 0));
centerPane.add(contentPane, "show"); centerPane.add(contentPane, "show");
formatFontPane = new JPanel(new BorderLayout()); formatFontPane = new JPanel(new BorderLayout());
formatFontPane.add(centerPane, BorderLayout.NORTH); formatFontPane.add(centerPane, BorderLayout.NORTH);
@ -110,20 +100,20 @@ public class FormatPane extends AbstractBasicStylePane{
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null,null}, new Component[]{null, null},
new Component[]{new UILabel(Inter.getLocText("FR-Base_Format")+" ", SwingConstants.LEFT), typeComboBox }, new Component[]{new UILabel(Inter.getLocText("FR-Base_Format") + " ", SwingConstants.LEFT), typeComboBox},
new Component[]{null,centerPane}, new Component[]{null, centerPane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_FRFont"), SwingConstants.LEFT), frFontPane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_FRFont"), SwingConstants.LEFT), frFontPane},
new Component[]{null,null} new Component[]{null, null}
}; };
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p,f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1}, {1, 1}, {1, 3}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 3}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM);
this.add(panel,BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
} }
protected UIComboBoxRenderer createComBoxRender(){ protected UIComboBoxRenderer createComBoxRender() {
return new UIComboBoxRenderer() { return new UIComboBoxRenderer() {
@Override @Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
@ -174,10 +164,11 @@ public class FormatPane extends AbstractBasicStylePane{
/** /**
* 弹出框标题 * 弹出框标题
*
* @return 标题 * @return 标题
*/ */
public String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText("FR-Base_Format"); return Inter.getLocText("FR-Designer_Text");
} }
/** /**
@ -223,8 +214,8 @@ public class FormatPane extends AbstractBasicStylePane{
* 判断是否是数组有模式 * 判断是否是数组有模式
* *
* @param stringArray 字符串数组 * @param stringArray 字符串数组
* @param pattern 格式 * @param pattern 格式
* @return 是否是数组有模式 * @return 是否是数组有模式
*/ */
public static int isArrayContainPattern(String[] stringArray, String pattern) { public static int isArrayContainPattern(String[] stringArray, String pattern) {
for (int i = 0; i < stringArray.length; i++) { for (int i = 0; i < stringArray.length; i++) {
@ -301,20 +292,20 @@ public class FormatPane extends AbstractBasicStylePane{
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
if(e.getStateChange() == ItemEvent.SELECTED){ if (e.getStateChange() == ItemEvent.SELECTED) {
int contents = getFormatContents(); int contents = getFormatContents();
String[] items = FormatField.getInstance().getFormatArray(contents); String[] items = FormatField.getInstance().getFormatArray(contents);
CardLayout cardLayout = (CardLayout) centerPane.getLayout(); CardLayout cardLayout = (CardLayout) centerPane.getLayout();
if (isTextOrNull()) { if (isTextOrNull()) {
centerPane.setPreferredSize(new Dimension(0, 0) ); centerPane.setPreferredSize(new Dimension(0, 0));
cardLayout.show(centerPane, "hide"); cardLayout.show(centerPane, "hide");
} else { } else {
textField.removeAllItems(); textField.removeAllItems();
for (int i = 0; i < items.length; i++) { for (int i = 0; i < items.length; i++) {
textField.addItem(items[i]); textField.addItem(items[i]);
} }
centerPane.setPreferredSize(new Dimension(270, 70) ); centerPane.setPreferredSize(new Dimension(270, 70));
cardLayout.show(centerPane, "show"); cardLayout.show(centerPane, "show");
} }
isFormat = true; isFormat = true;
@ -326,7 +317,7 @@ public class FormatPane extends AbstractBasicStylePane{
ItemListener textFieldItemListener = new ItemListener() { ItemListener textFieldItemListener = new ItemListener() {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
if(e.getStateChange() == ItemEvent.SELECTED){ if (e.getStateChange() == ItemEvent.SELECTED) {
isFormat = true; isFormat = true;
refreshPreviewLabel(); refreshPreviewLabel();
} }
@ -348,7 +339,7 @@ public class FormatPane extends AbstractBasicStylePane{
* update * update
*/ */
public Style update(Style style) { public Style update(Style style) {
if (isFormat){ if (isFormat) {
isFormat = false; isFormat = false;
return style.deriveFormat(this.update()); return style.deriveFormat(this.update());
} else { } else {

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

@ -2033,3 +2033,20 @@ FR-Designer_Expand=Expand
FR-Designer_ExpendSort=ExpendSort FR-Designer_ExpendSort=ExpendSort
FR-Designer_ExpandD_Expandable=Expandable FR-Designer_ExpandD_Expandable=Expandable
FR-Designer_Read_failure=Read_failure FR-Designer_Read_failure=Read_failure
FR-Designer-StyleAlignment_Style_PartSpacing=PartSpacing
FR-Designer_Image_Layout=Image_Layout
FR-Designer_StyleAlignment_Text_Style=Text_Style
FR-Designer_StyleAlignment_Text_Rotation=Text_Rotation
FR-Designer_Style_Left_Indent=Left_Indent
FR-Designer_Style_Right_Indent=Right_Indent
FR-Designer_Style_Spacing_Before=Spacing_Before
FR-Designer_Style_Spacing_After=Spacing_After
FR-Designer_Style_Line_Spacing=Line_Spacing
FR-Designer_Left=Left
FR-Designer_Right=Right
FR-Designer_Front=Front
FR-Designer_Behind=Behind
FR-Designer_StyleAlignment_Wrap_Text=Wrap_Text
FR-Designer_StyleAlignment_Single_Line=Single_Line
FR-Designer_StyleAlignment_Single_Line(Adjust_Font)=Single_Line(Adjust_Font)
FR-Designer_StyleAlignment_Multi_Line(Adjust_Font)=Multi_Line(Adjust_Font)

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

@ -2033,3 +2033,20 @@ FR-Designer_Expand=Expand
FR-Designer_ExpendSort=ExpendSort FR-Designer_ExpendSort=ExpendSort
FR-Designer_ExpandD_Expandable=Expandable FR-Designer_ExpandD_Expandable=Expandable
FR-Designer_Read_failure=Read_failure FR-Designer_Read_failure=Read_failure
FR-Designer-StyleAlignment_Style_PartSpacing=PartSpacing
FR-Designer_Image_Layout=Image_Layout
FR-Designer_StyleAlignment_Text_Style=Text_Style
FR-Designer_StyleAlignment_Text_Rotation=Text_Rotation
FR-Designer_Style_Left_Indent=Left_Indent
FR-Designer_Style_Right_Indent=Right_Indent
FR-Designer_Style_Spacing_Before=Spacing_Before
FR-Designer_Style_Spacing_After=Spacing_After
FR-Designer_Style_Line_Spacing=Line_Spacing
FR-Designer_Left=Left
FR-Designer_Right=Right
FR-Designer_Front=Front
FR-Designer_Behind=Behind
FR-Designer_StyleAlignment_Wrap_Text=Wrap_Text
FR-Designer_StyleAlignment_Single_Line=Single_Line
FR-Designer_StyleAlignment_Single_Line(Adjust_Font)=Single_Line(Adjust_Font)
FR-Designer_StyleAlignment_Multi_Line(Adjust_Font)=Multi_Line(Adjust_Font)

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

@ -1989,24 +1989,40 @@ FR-Designer_Widget_Library=
FR-Designer_No_Settings_Available= FR-Designer_No_Settings_Available=
FR-Designer_Configured_Roles=\u69CB\u6210\u3055\u308C\u305F\u5F79\u5272 FR-Designer_Configured_Roles=\u69CB\u6210\u3055\u308C\u305F\u5F79\u5272
FR-Designer_Scale_EnlargeOrReduce= FR-Designer_Scale_EnlargeOrReduce=
FR-Designer_Scale_selfAdaptButton=\ FR-Designer_Scale_selfAdaptButton=
FR-Designer_Scale_customButton=\ FR-Designer_Scale_customButton=
FR-Designer_FRFont_Subscript=\ FR-Designer_FRFont_Subscript=
FR-Designer_FRFont_Superscript=\ FR-Designer_FRFont_Superscript=
FR-Designer_FRFont_Shadow=\ FR-Designer_FRFont_Shadow=
FR-Designer_FRFont_Strikethrough=\ FR-Designer_FRFont_Strikethrough=
FR-Designer_FRFont_Underline=\ FR-Designer_FRFont_Underline=
FR-Designer_FRFont_bold=\ FR-Designer_FRFont_bold=
FR-Designer_FRFont_italic=\ FR-Designer_FRFont_italic=
FR-Designer_FRFont_Foreground=\ FR-Designer_FRFont_Foreground=
FR-Designer_FRFont_Style=\ FR-Designer_FRFont_Style=
FR-Designer_FRFont_plain=\ FR-Designer_FRFont_plain=
FR-Designer_FRFont_bolditalic=\ FR-Designer_FRFont_bolditalic=
FR-Designer_outBorder=\ FR-Designer_outBorder=
FR-Designer_inBorder=\ FR-Designer_inBorder=
FR-Designer_ExpandD_Up_Father_Cell=\ FR-Designer_ExpandD_Up_Father_Cell=
FR-Designer_ExpandD_Expand_Direction=\ FR-Designer_ExpandD_Expand_Direction=
FR-Designer_Expand=\ FR-Designer_Expand=
FR-Designer_ExpendSort=\ FR-Designer_ExpendSort=
FR-Designer_ExpandD_Expandable=\ FR-Designer_ExpandD_Expandable=
FR-Designer_Read_failure=\ FR-Designer_Read_failure=
FR-Designer_Image_Layout=
FR-Designer_StyleAlignment_Text_Style=
FR-Designer_StyleAlignment_Text_Rotation=
FR-Designer_Style_Left_Indent=
FR-Designer_Style_Right_Indent=
FR-Designer_Style_Spacing_Before=
FR-Designer_Style_Spacing_After=
FR-Designer_Style_Line_Spacing=
FR-Designer_Left=
FR-Designer_Right=
FR-Designer_Front=
FR-Designer_Behind=
FR-Designer_StyleAlignment_Wrap_Text=
FR-Designer_StyleAlignment_Single_Line=
FR-Designer_StyleAlignment_Single_Line(Adjust_Font)=
FR-Designer_StyleAlignment_Multi_Line(Adjust_Font)=

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

@ -1989,23 +1989,39 @@ FR-Designer_Widget_Library=
FR-Designer_No_Settings_Available= FR-Designer_No_Settings_Available=
FR-Designer_Configured_Roles=\uC5ED\uD560\uC774\uAD6C\uC131\uB418\uC5C8\uC2B5\uB2C8\uB2E4. FR-Designer_Configured_Roles=\uC5ED\uD560\uC774\uAD6C\uC131\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
FR-Designer_Scale_EnlargeOrReduce= FR-Designer_Scale_EnlargeOrReduce=
FR-Designer_Scale_selfAdaptButton=\ FR-Designer_Scale_selfAdaptButton=
FR-Designer_FRFont_Subscript=\ FR-Designer_FRFont_Subscript=
FR-Designer_FRFont_Superscript=\ FR-Designer_FRFont_Superscript=
FR-Designer_FRFont_Shadow=\ FR-Designer_FRFont_Shadow=
FR-Designer_FRFont_Strikethrough=\ FR-Designer_FRFont_Strikethrough=
FR-Designer_FRFont_Underline=\ FR-Designer_FRFont_Underline=
FR-Designer_FRFont_bold=\ FR-Designer_FRFont_bold=
FR-Designer_FRFont_italic=\ FR-Designer_FRFont_italic=
FR-Designer_FRFont_Foreground=\ FR-Designer_FRFont_Foreground=
FR-Designer_FRFont_Style=\ FR-Designer_FRFont_Style=
FR-Designer_FRFont_plain=\ FR-Designer_FRFont_plain=
FR-Designer_FRFont_bolditalic=\ FR-Designer_FRFont_bolditalic=
FR-Designer_outBorder=\ FR-Designer_outBorder=
FR-Designer_inBorder=\ FR-Designer_inBorder=
FR-Designer_ExpandD_Up_Father_Cell=\ FR-Designer_ExpandD_Up_Father_Cell=
FR-Designer_ExpandD_Expand_Direction=\ FR-Designer_ExpandD_Expand_Direction=
FR-Designer_Expand=\ FR-Designer_Expand=
FR-Designer_ExpendSort=\ FR-Designer_ExpendSort=
FR-Designer_ExpandD_Expandable=\ FR-Designer_ExpandD_Expandable=
FR-Designer_Read_failure=\ FR-Designer_Read_failure=
FR-Designer_Image_Layout=
FR-Designer_StyleAlignment_Text_Style=
FR-Designer_StyleAlignment_Text_Rotation=
FR-Designer_Style_Left_Indent=
FR-Designer_Style_Right_Indent=
FR-Designer_Style_Spacing_Before=
FR-Designer_Style_Spacing_After=
FR-Designer_Style_Line_Spacing=
FR-Designer_Left=
FR-Designer_Right=
FR-Designer_Front=
FR-Designer_Behind=
FR-Designer_StyleAlignment_Wrap_Text=
FR-Designer_StyleAlignment_Single_Line=
FR-Designer_StyleAlignment_Single_Line(Adjust_Font)=
FR-Designer_StyleAlignment_Multi_Line(Adjust_Font)=

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

@ -2031,3 +2031,20 @@ FR-Designer_Expand=\u6269\u5C55
FR-Designer_ExpendSort=\u6269\u5C55\u540E\u6392\u5E8F FR-Designer_ExpendSort=\u6269\u5C55\u540E\u6392\u5E8F
FR-Designer_ExpandD_Expandable=\u53EF\u4F38\u5C55\u6027 FR-Designer_ExpandD_Expandable=\u53EF\u4F38\u5C55\u6027
FR-Designer_Read_failure=\u8BFB\u53D6\u5931\u8D25\uFF0C\u53EF\u80FD\u6E90\u6587\u4EF6\u5DF2\u635F\u574F FR-Designer_Read_failure=\u8BFB\u53D6\u5931\u8D25\uFF0C\u53EF\u80FD\u6E90\u6587\u4EF6\u5DF2\u635F\u574F
FR-Designer-StyleAlignment_Style_PartSpacing=\u6BB5\u95F4\u8DDD
FR-Designer_Image_Layout=\u56FE\u7247\u5E03\u5C40
FR-Designer_StyleAlignment_Text_Style=\u6587\u672C\u63A7\u5236
FR-Designer_StyleAlignment_Text_Rotation=\u6587\u672C\u65B9\u5411
FR-Designer_Style_Left_Indent=\u5DE6\u7F29\u8FDB
FR-Designer_Style_Right_Indent=\u53F3\u7F29\u8FDB
FR-Designer_Style_Spacing_Before=\u6BB5\u524D
FR-Designer_Style_Spacing_After=\u6BB5\u540E
FR-Designer_Style_Line_Spacing=\u884C\u95F4\u8DDD
FR-Designer_Left=\u5DE6
FR-Designer_Right=\u53F3
FR-Designer_Front=\u524D
FR-Designer_Behind=\u540E
FR-Designer_StyleAlignment_Wrap_Text=\u81EA\u52A8\u6362\u884C
FR-Designer_StyleAlignment_Single_Line=\u5355\u884C\u663E\u793A
FR-Designer_StyleAlignment_Single_Line(Adjust_Font)=\u5355\u884C\u663E\u793A(\u8C03\u6574\u5B57\u4F53)
FR-Designer_StyleAlignment_Multi_Line(Adjust_Font)=\u591A\u884C\u663E\u793A(\u8C03\u6574\u5B57\u4F53)

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

@ -2010,24 +2010,40 @@ FR-Designer_Float_Element=\u61F8\u6D6E\u5143\u7D20
FR-Designer_Widget_Library=\u7D44\u4EF6\u5EAB FR-Designer_Widget_Library=\u7D44\u4EF6\u5EAB
FR-Designer_No_Settings_Available=\u7121\u53EF\u7528\u914D\u5BD8\u9805\uFF01 FR-Designer_No_Settings_Available=\u7121\u53EF\u7528\u914D\u5BD8\u9805\uFF01
FR-Designer_Configured_Roles=\u5DF2\u914D\u7F6E\u89D2\u8272 FR-Designer_Configured_Roles=\u5DF2\u914D\u7F6E\u89D2\u8272
FR-Designer_Scale_selfAdaptButton=\ FR-Designer_Scale_selfAdaptButton=
FR-Designer_Scale_customButton=\ FR-Designer_Scale_customButton=
FR-Designer_FRFont_Subscript=\ FR-Designer_FRFont_Subscript=
FR-Designer_FRFont_Superscript=\ FR-Designer_FRFont_Superscript=
FR-Designer_FRFont_Shadow=\ FR-Designer_FRFont_Shadow=
FR-Designer_FRFont_Strikethrough=\ FR-Designer_FRFont_Strikethrough=
FR-Designer_FRFont_Underline=\ FR-Designer_FRFont_Underline=
FR-Designer_FRFont_bold=\ FR-Designer_FRFont_bold=
FR-Designer_FRFont_italic=\ FR-Designer_FRFont_italic=
FR-Designer_FRFont_Foreground=\ FR-Designer_FRFont_Foreground=
FR-Designer_FRFont_Style=\ FR-Designer_FRFont_Style=
FR-Designer_FRFont_plain=\ FR-Designer_FRFont_plain=
FR-Designer_FRFont_bolditalic=\ FR-Designer_FRFont_bolditalic=
FR-Designer_outBorder=\ FR-Designer_outBorder=
FR-Designer_inBorder=\ FR-Designer_inBorder=
FR-Designer_ExpandD_Up_Father_Cell=\ FR-Designer_ExpandD_Up_Father_Cell=
FR-Designer_ExpandD_Expand_Direction=\ FR-Designer_ExpandD_Expand_Direction=
FR-Designer_Expand=\ FR-Designer_Expand=
FR-Designer_ExpendSort=\ FR-Designer_ExpendSort=
FR-Designer_ExpandD_Expandable=\ FR-Designer_ExpandD_Expandable=
FR-Designer_Read_failure=\ FR-Designer_Read_failure=
FR-Designer_Image_Layout=
FR-Designer_StyleAlignment_Text_Style=
FR-Designer_StyleAlignment_Text_Rotation=
FR-Designer_Style_Left_Indent=
FR-Designer_Style_Right_Indent=
FR-Designer_Style_Spacing_Before=
FR-Designer_Style_Spacing_After=
FR-Designer_Style_Line_Spacing=
FR-Designer_Left=
FR-Designer_Right=
FR-Designer_Front=
FR-Designer_Behind=
FR-Designer_StyleAlignment_Wrap_Text=
FR-Designer_StyleAlignment_Single_Line=
FR-Designer_StyleAlignment_Single_Line(Adjust_Font)=
FR-Designer_StyleAlignment_Multi_Line(Adjust_Font)=

Loading…
Cancel
Save