|
|
@ -1,6 +1,5 @@ |
|
|
|
package com.fr.design.mainframe.cell.settingpane; |
|
|
|
package com.fr.design.mainframe.cell.settingpane; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
|
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
import com.fr.design.expand.ExpandLeftFatherPane; |
|
|
|
import com.fr.design.expand.ExpandLeftFatherPane; |
|
|
@ -10,18 +9,23 @@ import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
|
|
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
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.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
|
|
|
import com.fr.general.IOUtils; |
|
|
|
import com.fr.report.cell.DefaultTemplateCellElement; |
|
|
|
import com.fr.report.cell.DefaultTemplateCellElement; |
|
|
|
import com.fr.report.cell.TemplateCellElement; |
|
|
|
import com.fr.report.cell.TemplateCellElement; |
|
|
|
import com.fr.report.cell.cellattr.CellExpandAttr; |
|
|
|
import com.fr.report.cell.cellattr.CellExpandAttr; |
|
|
|
import com.fr.report.elementcase.TemplateElementCase; |
|
|
|
import com.fr.report.elementcase.TemplateElementCase; |
|
|
|
import com.fr.stable.Constants; |
|
|
|
import com.fr.stable.Constants; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.Icon; |
|
|
|
import java.awt.*; |
|
|
|
import javax.swing.JPanel; |
|
|
|
|
|
|
|
import javax.swing.SwingConstants; |
|
|
|
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
|
|
|
import java.awt.Component; |
|
|
|
|
|
|
|
import java.awt.Rectangle; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 单元格扩展属性面板,是属性表面板的一个种类 |
|
|
|
* 单元格扩展属性面板,是属性表面板的一个种类 |
|
|
@ -38,58 +42,66 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { |
|
|
|
private JPanel layoutPane; |
|
|
|
private JPanel layoutPane; |
|
|
|
private JPanel basicPane; |
|
|
|
private JPanel basicPane; |
|
|
|
private JPanel seniorPane; |
|
|
|
private JPanel seniorPane; |
|
|
|
|
|
|
|
private CellExpandExtraAttrPane extraPane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @return |
|
|
|
* @return content panel |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public JPanel createContentPane() { |
|
|
|
public JPanel createContentPane() { |
|
|
|
String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Not_Expand"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Top_To_Bottom"), com.fr.design.i18n.Toolkit.i18nText("FIne-Design_Report_Utils_Left_To_Right")}; |
|
|
|
String[] nameArray = {Toolkit.i18nText("Fine-Design_Report_ExpandD_Not_Expand"), Toolkit.i18nText("Fine-Design_Report_Utils_Top_To_Bottom"), Toolkit.i18nText("FIne-Design_Report_Utils_Left_To_Right")}; |
|
|
|
Icon[][] iconArray = { |
|
|
|
Icon[][] iconArray = { |
|
|
|
{BaseUtils.readIcon("/com/fr/design/images/expand/none16x16.png"), BaseUtils.readIcon("/com/fr/design/images/expand/none16x16_selected@1x.png")}, |
|
|
|
{IOUtils.readIcon("/com/fr/design/images/expand/none16x16.png"), IOUtils.readIcon("/com/fr/design/images/expand/none16x16_selected@1x.png")}, |
|
|
|
{BaseUtils.readIcon("/com/fr/design/images/expand/vertical.png"), BaseUtils.readIcon("/com/fr/design/images/expand/vertical_selected@1x.png")}, |
|
|
|
{IOUtils.readIcon("/com/fr/design/images/expand/vertical.png"), IOUtils.readIcon("/com/fr/design/images/expand/vertical_selected@1x.png")}, |
|
|
|
{BaseUtils.readIcon("/com/fr/design/images/expand/landspace.png"), BaseUtils.readIcon("/com/fr/design/images/expand/landspace_selected@1x.png")} |
|
|
|
{IOUtils.readIcon("/com/fr/design/images/expand/landspace.png"), IOUtils.readIcon("/com/fr/design/images/expand/landspace_selected@1x.png")} |
|
|
|
}; |
|
|
|
}; |
|
|
|
Byte[] valueArray = {Constants.NONE, Constants.TOP_TO_BOTTOM, Constants.LEFT_TO_RIGHT}; |
|
|
|
Byte[] valueArray = {Constants.NONE, Constants.TOP_TO_BOTTOM, Constants.LEFT_TO_RIGHT}; |
|
|
|
expandDirectionButton = new UIButtonGroup<Byte>(iconArray, valueArray); |
|
|
|
expandDirectionButton = new UIButtonGroup<Byte>(iconArray, valueArray); |
|
|
|
expandDirectionButton.setAllToolTips(nameArray); |
|
|
|
expandDirectionButton.setAllToolTips(nameArray); |
|
|
|
leftFatherPane = new ExpandLeftFatherPane(); |
|
|
|
leftFatherPane = new ExpandLeftFatherPane(); |
|
|
|
rightFatherPane = new ExpandUpFatherPane(); |
|
|
|
rightFatherPane = new ExpandUpFatherPane(); |
|
|
|
horizontalExpandableCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Horizontal_Extendable")); |
|
|
|
horizontalExpandableCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_ExpandD_Horizontal_Extendable")); |
|
|
|
verticalExpandableCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Vertical_Extendable")); |
|
|
|
verticalExpandableCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_ExpandD_Vertical_Extendable")); |
|
|
|
sortAfterExpand = new SortExpandAttrPane(); |
|
|
|
sortAfterExpand = new SortExpandAttrPane(); |
|
|
|
initAllNames(); |
|
|
|
initAllNames(); |
|
|
|
return layoutPane(); |
|
|
|
return layoutPane(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initAllNames() { |
|
|
|
private void initAllNames() { |
|
|
|
expandDirectionButton.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Direction")); |
|
|
|
expandDirectionButton.setGlobalName(Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Direction")); |
|
|
|
leftFatherPane.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LeftParent")); |
|
|
|
leftFatherPane.setGlobalName(Toolkit.i18nText("Fine-Design_Report_LeftParent")); |
|
|
|
rightFatherPane.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Up_Father_Cell")); |
|
|
|
rightFatherPane.setGlobalName(Toolkit.i18nText("Fine-Design_Report_ExpandD_Up_Father_Cell")); |
|
|
|
horizontalExpandableCheckBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expandable")); |
|
|
|
horizontalExpandableCheckBox.setGlobalName(Toolkit.i18nText("Fine-Design_Report_ExpandD_Expandable")); |
|
|
|
verticalExpandableCheckBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expandable")); |
|
|
|
verticalExpandableCheckBox.setGlobalName(Toolkit.i18nText("Fine-Design_Report_ExpandD_Expandable")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel layoutPane() { |
|
|
|
private JPanel layoutPane() { |
|
|
|
layoutPane = new JPanel(new BorderLayout()); |
|
|
|
layoutPane = new JPanel(new BorderLayout()); |
|
|
|
basicPane = new JPanel(); |
|
|
|
basicPane = new JPanel(); |
|
|
|
seniorPane = new JPanel(); |
|
|
|
seniorPane = new JPanel(); |
|
|
|
basicPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic"), 223, 24, basicPane()); |
|
|
|
basicPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Basic"), 223, 24, basicPane()); |
|
|
|
seniorPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 223, 24, seniorPane()); |
|
|
|
seniorPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Advanced"), 223, 24, seniorPane()); |
|
|
|
layoutPane.add(basicPane, BorderLayout.NORTH); |
|
|
|
layoutPane.add(basicPane, BorderLayout.NORTH); |
|
|
|
layoutPane.add(seniorPane, BorderLayout.CENTER); |
|
|
|
layoutPane.add(seniorPane, BorderLayout.CENTER); |
|
|
|
return layoutPane; |
|
|
|
|
|
|
|
|
|
|
|
extraPane = CellExpandExtraAttrPane.getInstance(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel content = new JPanel(new BorderLayout()); |
|
|
|
|
|
|
|
content.add(layoutPane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
content.add(extraPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
return content; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel basicPane() { |
|
|
|
private JPanel basicPane() { |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
UILabel direction = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Direction"), SwingConstants.LEFT); |
|
|
|
UILabel direction = new UILabel(Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Direction"), SwingConstants.LEFT); |
|
|
|
JPanel directionPane = new JPanel(new BorderLayout()); |
|
|
|
JPanel directionPane = new JPanel(new BorderLayout()); |
|
|
|
directionPane.add(direction, BorderLayout.NORTH); |
|
|
|
directionPane.add(direction, BorderLayout.NORTH); |
|
|
|
UILabel left = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LeftParent"), SwingConstants.LEFT); |
|
|
|
UILabel left = new UILabel(Toolkit.i18nText("Fine-Design_Report_LeftParent"), SwingConstants.LEFT); |
|
|
|
JPanel leftPane = new JPanel(new BorderLayout()); |
|
|
|
JPanel leftPane = new JPanel(new BorderLayout()); |
|
|
|
leftPane.add(left, BorderLayout.NORTH); |
|
|
|
leftPane.add(left, BorderLayout.NORTH); |
|
|
|
UILabel up = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Up_Father_Cell"), SwingConstants.LEFT); |
|
|
|
UILabel up = new UILabel(Toolkit.i18nText("Fine-Design_Report_ExpandD_Up_Father_Cell"), SwingConstants.LEFT); |
|
|
|
JPanel upPane = new JPanel(new BorderLayout()); |
|
|
|
JPanel upPane = new JPanel(new BorderLayout()); |
|
|
|
upPane.add(up, BorderLayout.NORTH); |
|
|
|
upPane.add(up, BorderLayout.NORTH); |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
@ -107,7 +119,7 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { |
|
|
|
private JPanel seniorPane() { |
|
|
|
private JPanel seniorPane() { |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
UILabel expendSort = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Expend_Sort"), SwingConstants.LEFT); |
|
|
|
UILabel expendSort = new UILabel(Toolkit.i18nText("Fine-Design_Report_Expend_Sort"), SwingConstants.LEFT); |
|
|
|
JPanel expendSortPane = new JPanel(new BorderLayout()); |
|
|
|
JPanel expendSortPane = new JPanel(new BorderLayout()); |
|
|
|
expendSortPane.add(expendSort, BorderLayout.NORTH); |
|
|
|
expendSortPane.add(expendSort, BorderLayout.NORTH); |
|
|
|
horizontalExpandableCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); |
|
|
|
horizontalExpandableCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); |
|
|
@ -118,9 +130,9 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { |
|
|
|
new Component[]{verticalExpandableCheckBox, null}, |
|
|
|
new Component[]{verticalExpandableCheckBox, null}, |
|
|
|
new Component[]{expendSortPane, sortAfterExpand}, |
|
|
|
new Component[]{expendSortPane, sortAfterExpand}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
double[] rowSize = {p, p, p, 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, 3}, {1, 3}}; |
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; |
|
|
|
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, SENIOR_HORIZONTAL_GAP, LayoutConstants.VGAP_LARGE); |
|
|
|
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, SENIOR_HORIZONTAL_GAP, LayoutConstants.VGAP_LARGE); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -158,13 +170,15 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sortAfterExpand.populate(cellExpandAttr); |
|
|
|
sortAfterExpand.populate(cellExpandAttr); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extraPane.populate(cellElement); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String getIconPath() { |
|
|
|
public String getIconPath() { |
|
|
|
// return "com/fr/design/images/expand/cellAttr.gif";
|
|
|
|
// return "com/fr/design/images/expand/cellAttr.gif";
|
|
|
|
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Expand"); |
|
|
|
return Toolkit.i18nText("Fine-Design_Report_Expand"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -175,19 +189,19 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { |
|
|
|
cellExpandAttr = new CellExpandAttr(); |
|
|
|
cellExpandAttr = new CellExpandAttr(); |
|
|
|
cellElement.setCellExpandAttr(cellExpandAttr); |
|
|
|
cellElement.setCellExpandAttr(cellExpandAttr); |
|
|
|
} |
|
|
|
} |
|
|
|
if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Direction"))) { |
|
|
|
if (ComparatorUtils.equals(getGlobalName(), Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Direction"))) { |
|
|
|
cellExpandAttr.setDirection(expandDirectionButton.getSelectedItem()); |
|
|
|
cellExpandAttr.setDirection(expandDirectionButton.getSelectedItem()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LeftParent"))) { |
|
|
|
if (ComparatorUtils.equals(getGlobalName(), Toolkit.i18nText("Fine-Design_Report_LeftParent"))) { |
|
|
|
this.leftFatherPane.update(cellExpandAttr); |
|
|
|
this.leftFatherPane.update(cellExpandAttr); |
|
|
|
} |
|
|
|
} |
|
|
|
if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Up_Father_Cell"))) { |
|
|
|
if (ComparatorUtils.equals(getGlobalName(), Toolkit.i18nText("Fine-Design_Report_ExpandD_Up_Father_Cell"))) { |
|
|
|
this.rightFatherPane.update(cellExpandAttr); |
|
|
|
this.rightFatherPane.update(cellExpandAttr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// extendable
|
|
|
|
// extendable
|
|
|
|
if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expandable"))) { |
|
|
|
if (ComparatorUtils.equals(getGlobalName(), Toolkit.i18nText("Fine-Design_Report_ExpandD_Expandable"))) { |
|
|
|
if (horizontalExpandableCheckBox.isSelected()) { |
|
|
|
if (horizontalExpandableCheckBox.isSelected()) { |
|
|
|
if (verticalExpandableCheckBox.isSelected()) { |
|
|
|
if (verticalExpandableCheckBox.isSelected()) { |
|
|
|
cellExpandAttr.setExtendable(CellExpandAttr.Both_EXTENDABLE); |
|
|
|
cellExpandAttr.setExtendable(CellExpandAttr.Both_EXTENDABLE); |
|
|
@ -203,10 +217,11 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ExpandD_Sort_After_Expand"))) { |
|
|
|
if (ComparatorUtils.equals(getGlobalName(), Toolkit.i18nText("Fine-Design_Basic_ExpandD_Sort_After_Expand"))) { |
|
|
|
sortAfterExpand.update(cellExpandAttr); |
|
|
|
sortAfterExpand.update(cellExpandAttr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extraPane.update(cellElement); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -234,10 +249,10 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @return |
|
|
|
* @return title |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public String title4PopupWindow() { |
|
|
|
public String title4PopupWindow() { |
|
|
|
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Attribute"); |
|
|
|
return Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Attribute"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|