kerry 7 years ago
parent
commit
fd1a338f58
  1. 6
      designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java
  2. 2
      designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java
  3. 14
      designer/src/com/fr/design/mainframe/ReportFloatPane.java
  4. 58
      designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java
  5. 20
      designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java
  6. 60
      designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java
  7. 33
      designer/src/com/fr/design/present/BarCodePane.java
  8. 9
      designer/src/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java
  9. 1
      designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java
  10. 3
      designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java
  11. 10
      designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java
  12. 10
      designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java
  13. 13
      designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java
  14. 8
      designer/src/com/fr/quickeditor/CellQuickEditor.java
  15. 4
      designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java
  16. 76
      designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java
  17. 4
      designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java
  18. 4
      designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java
  19. 4
      designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java
  20. 4
      designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java
  21. 2
      designer/src/com/fr/quickeditor/floatquick/FloatImageQuickEditor.java
  22. 7
      designer/src/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java
  23. 1
      designer_base/src/com/fr/design/constants/UIConstants.java
  24. 5
      designer_base/src/com/fr/design/fun/WidgetPropertyUIProvider.java
  25. 11
      designer_base/src/com/fr/design/gui/style/FRFontPane.java
  26. 40
      designer_base/src/com/fr/design/gui/style/FormatPane.java
  27. 6
      designer_base/src/com/fr/design/locale/designer.properties
  28. 4
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  29. 8
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  30. 8
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  31. 6
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  32. 4
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  33. 25
      designer_base/src/com/fr/design/present/dict/FormulaDictPane.java
  34. 6
      designer_form/src/com/fr/design/designer/properties/mobile/BodyMobilePropertyUI.java
  35. 7
      designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyUI.java
  36. 22
      designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java
  37. 124
      designer_form/src/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java
  38. 13
      designer_form/src/com/fr/design/widget/ui/designer/mobile/MobileWidgetDefinePane.java

6
designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java

@ -69,13 +69,13 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
int i = goBox.getSelectedIndex();
if (i == BIND_GROUP) {
cardLayout.show(cardPane, "groupPane");
cardPane.setPreferredSize(new Dimension(155, 20));
cardPane.setPreferredSize(new Dimension(156, 20));
} else if (i == BIND_SELECTED) {
cardLayout.show(cardPane, "listPane");
cardPane.setPreferredSize(new Dimension(0, 0));
} else if (i == BIND_SUMMARY) {
cardLayout.show(cardPane, "summaryPane");
cardPane.setPreferredSize(new Dimension(155, 20));
cardPane.setPreferredSize(new Dimension(156, 20));
CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
cellExpandAttr.setDirection(Constants.NONE);
}
@ -84,7 +84,7 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
double[] columnSize = {p, f};
double[] rowSize = {p, p};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 8, 10);
}
private void initCardPane() {

2
designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java

@ -144,7 +144,7 @@ public class SelectedDataColumnPane extends BasicPane {
{dcLabel, columnNameComboBox}
};
this.setLayout(new BorderLayout());
this.add(TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p, p}, new double[]{p, f}));
this.add(TableLayoutHelper.createGapTableLayoutPane(components, new double[]{p, p, p}, new double[]{p, f}, 8, 10));
}

14
designer/src/com/fr/design/mainframe/ReportFloatPane.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.constants.UIConstants;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
@ -42,7 +43,14 @@ public class ReportFloatPane extends JPanel {
UIToolbar topToolBar = new UIToolbar();
topToolBar.setLayout(new BorderLayout());
insertFloatMenu = createInsertToolBar();
topToolBar.add(createButtonUI());
topToolBar.setPreferredSize(new Dimension(155,20));
topToolBar.add(createButtonUI(), BorderLayout.CENTER);
topToolBar.setBorder(BorderFactory.createEmptyBorder(-1, -1, -1, -1));
JPanel toolBarPane = new JPanel(new BorderLayout());
toolBarPane.add(topToolBar, BorderLayout.CENTER);
toolBarPane.setBorder(BorderFactory.createLineBorder(UIConstants.POP_DIALOG_BORDER));
toolBarPane.setPreferredSize(new Dimension(155,20));
UILabel emptyLabel = new UILabel();
emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));
@ -51,10 +59,10 @@ public class ReportFloatPane extends JPanel {
double[] columnSize = {p, p, p, f};
double[] rowSize = {p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(), new UILabel(Inter.getLocText("FR-Designer_Add_FloatElement")), emptyLabel, topToolBar},
new Component[]{new UILabel(), new UILabel(Inter.getLocText("FR-Designer_Add_FloatElement")), emptyLabel, toolBarPane},
};
JPanel leftTopPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
leftTopPane.setBorder(BorderFactory.createEmptyBorder(10, 4, 0, 13));
leftTopPane.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 15));
this.add(leftTopPane, BorderLayout.NORTH);
}

58
designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java

@ -63,7 +63,8 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
// 插入行策略
private UIButtonGroup insertRowPolicy;
private ValueEditorPane valueEditor;
private CardLayout insertRowLayout;
private JPanel insertRowPane;
private JPanel southContentPane;
private JPanel defaultValuePane;
@ -109,14 +110,41 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
defaultValuePane = new JPanel(new BorderLayout(4, 0));
valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane();
defaultValuePane.add(valueEditor, BorderLayout.CENTER);
defaultValuePane.setVisible(false);
insertRowLayout = new CardLayout();
insertRowPane = new JPanel(insertRowLayout);
insertRowPane.add(new JPanel(), "none");
insertRowPane.add(defaultValuePane, "content");
insertRowPane.setPreferredSize(new Dimension(0, 0));
insertRowPolicy.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
defaultValuePane.setVisible(insertRowPolicy.getSelectedIndex() == 1);
if (insertRowPolicy.getSelectedIndex() == 1) {
insertRowPane.setPreferredSize(new Dimension(100, 20));
insertRowLayout.show(insertRowPane, "content");
} else {
insertRowLayout.show(insertRowPane, "none");
insertRowPane.setPreferredSize(new Dimension(0, 0));
}
}
});
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize1 = {p, p};
double[] columnSize1 = {p, f};
int[][] rowCount1 = {{1, 1}, {1, 1}};
Component[][] components1 = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_CellWrite_InsertRow_Policy"), SwingConstants.LEFT), insertRowPolicy},
new Component[]{null, insertRowPane},
};
southContentPane = TableLayoutHelper.createGapTableLayoutPane(components1, rowSize1, columnSize1, rowCount1, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
JPanel seniorPane = new JPanel(new BorderLayout());
seniorPane.add(seniorUpPane(), BorderLayout.NORTH);
seniorPane.add(southContentPane, BorderLayout.CENTER);
southContentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
return seniorPane;
}
private JPanel seniorUpPane() {
JPanel fileNamePane = createNormal();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
@ -133,19 +161,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
new Component[]{new UILabel(Inter.getLocText("FR-Designer_CellWrite_ToolTip"), SwingConstants.RIGHT), tooltipTextField},
new Component[]{null, null},
};
JPanel seniorCenterPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
double[] rowSize1 = {p, p};
double[] columnSize1 = {p, f};
int[][] rowCount1 = {{1, 1}, {1, 1}};
Component[][] components1 = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_CellWrite_InsertRow_Policy"), SwingConstants.LEFT), insertRowPolicy},
new Component[]{null, defaultValuePane},
};
southContentPane = TableLayoutHelper.createGapTableLayoutPane(components1, rowSize1, columnSize1, rowCount1, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
JPanel seniorPane = new JPanel(new BorderLayout());
seniorPane.add(seniorCenterPane, BorderLayout.NORTH);
seniorPane.add(southContentPane, BorderLayout.CENTER);
return seniorPane;
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
}
private JPanel pagePane() {
@ -305,7 +321,13 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
} else {
insertRowPolicy.setSelectedIndex(0);
}
defaultValuePane.setVisible(insertRowPolicy.getSelectedIndex() == 1);
if (insertRowPolicy.getSelectedIndex() == 1) {
insertRowPane.setPreferredSize(new Dimension(100, 20));
insertRowLayout.show(insertRowPane, "content");
} else {
insertRowLayout.show(insertRowPane, "none");
insertRowPane.setPreferredSize(new Dimension(0, 0));
}
southContentPane.setVisible(true);
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (!jTemplate.isJWorkBook()) { //表单中报表块编辑屏蔽掉 插入行策略

20
designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java

@ -6,6 +6,7 @@ import com.fr.base.io.XMLReadHelper;
import com.fr.design.DesignerEnvManager;
import com.fr.general.FRLogLevel;
import com.fr.general.FRLogManager;
import com.fr.general.Inter;
import com.fr.general.LogDuration;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
@ -75,16 +76,17 @@ public class ErrorInfoLogAppender extends AppenderSkeleton {
}
private String readLogID(String log) {
int dotIndex = log.lastIndexOf(":");
if (dotIndex != -1) {
int end = Math.min(dotIndex + ERROR_LEN, log.length());
String logid = log.substring(dotIndex + 1, end).trim();
try {
Long.parseLong(logid);
return logid;
} catch (Exception ignore) {
String errorCode = Inter.getLocText("FR-Engine_ErrorCode-Prefix");
String[] matchs = log.split(errorCode + ".*?:");
if (matchs.length <= 1) {
return StringUtils.EMPTY;
}
String includeIDStr = matchs[1].trim();
try {
return Long.parseLong(includeIDStr.substring(0, ERROR_LEN)) + StringUtils.EMPTY;
} catch (Exception ignore) {
}
}
return StringUtils.EMPTY;

60
designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java

@ -1,7 +1,9 @@
package com.fr.design.mainframe.errorinfo;
import com.fr.base.FRContext;
import com.fr.general.*;
import com.fr.general.http.HttpClient;
import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import com.fr.stable.CodeUtils;
import com.fr.stable.EnvChangedListener;
@ -10,6 +12,8 @@ import com.fr.stable.StableUtils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
@ -45,7 +49,63 @@ public class ErrorInfoUploader {
return collector;
}
// 从云中心更新最新的解决方案文件
private void checkUpdateSolution(){
Thread updateThread = new Thread(new Runnable() {
@Override
public void run() {
String localCacheFilePath = StableUtils.pathJoin(ProductConstants.getEnvHome(), "solution", "solution.zip");
File localCacheZip = new File(localCacheFilePath);
if (needUpdate(localCacheZip)) {
downloadSolution(localCacheZip);
}
}
});
updateThread.start();
}
private void downloadSolution(File localCacheZip) {
try {
String downloadURL = SiteCenter.getInstance().acquireUrlByKind("solution.download", "http://cloud.fanruan.com/api/solution");
HttpClient hc = new HttpClient(downloadURL);
hc.asGet();
InputStream in = hc.getResponseStream();
StableUtils.makesureFileExist(localCacheZip);
FileOutputStream out = new FileOutputStream(localCacheZip);
IOUtils.copyBinaryTo(in, out);
out.close();
in.close();
IOUtils.unzip(localCacheZip, localCacheZip.getParent());
} catch (Exception e) {
FRContext.getLogger().debug(e.getMessage());
}
}
private boolean needUpdate(File localCacheZip){
if (localCacheZip.exists()) {
// 判断本地文件大小.
String checkURL = SiteCenter.getInstance().acquireUrlByKind("solution.check", "http://cloud.fanruan.com/api/checkUpdate");
HttpClient client = new HttpClient(checkURL);
client.asGet();
if (client.isServerAlive()){
try {
JSONObject res = new JSONObject(client.getResponseText());
// 简单粗暴, 直接判断文件大小.
return res.optLong("version") != localCacheZip.length();
} catch (JSONException ignore) {
}
}
return false;
}
return true;
}
public void sendErrorInfo(){
// 判断更新解决方案缓存.
checkUpdateSolution();
//读取文件夹里的json, 加入上传队列中.
File folder = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), FOLDER_NAME));
if (!folder.exists()) {

33
designer/src/com/fr/design/present/BarCodePane.java

@ -2,6 +2,7 @@ package com.fr.design.present;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
@ -85,7 +86,7 @@ public class BarCodePane extends FurtherBasicBeanPane<BarcodePresent> {
RCodesizespinner = new UIBasicSpinner(new SpinnerNumberModel(2, 1, 6, 1));
RCodeVersionComboBox = new UIComboBox();
RCodeErrorCorrectComboBox = new UIComboBox();
typeSetLabel = new UILabel(Inter.getLocText("Type_Set"), UILabel.RIGHT);
typeSetLabel = new UILabel(Inter.getLocText("Type_Set"), UILabel.LEFT);
initVersionComboBox();
initErrorCorrectComboBox();
@ -95,7 +96,9 @@ public class BarCodePane extends FurtherBasicBeanPane<BarcodePresent> {
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {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, 1, 1}};
barCodePreviewPane.setPreferredSize(new Dimension(0, 125));
typeComboBox.setPreferredSize(new Dimension(155,20));
final JPanel centerPane = new JPanel(new CardLayout());
Component[][] components = new Component[][]{
@ -103,7 +106,7 @@ public class BarCodePane extends FurtherBasicBeanPane<BarcodePresent> {
new Component[]{borderPane, null},
new Component[]{centerPane, null}
};
JPanel barCode = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel barCode = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE);
centerPane.add(getNormalPane(), "normal");
centerPane.add(getSpecialPane(), "special");
typeComboBox.addItemListener(new ItemListener() {
@ -145,21 +148,23 @@ public class BarCodePane extends FurtherBasicBeanPane<BarcodePresent> {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p, p, p, p};
double[] columnSize1 = {p, f, f};
double[] columnSize = {p, f, f};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}};
JPanel barWidthContainer = new JPanel(new FlowLayout(FlowLayout.LEFT, 2, 0));
barWidthContainer.add(barWidthSpinner);
JPanel barHeightContainer = new JPanel(new FlowLayout(FlowLayout.LEFT, 2, 0));
barHeightContainer.add(barHeightSpinner);
UILabel uiLabel = new UILabel(Inter.getLocText("Tree-Width") + ":", UILabel.RIGHT);
UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), UILabel.RIGHT);
uiLabel.setPreferredSize(typeSetLabel.getPreferredSize());
drawingTextCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
Component[][] components_normal = new Component[][]{
new Component[]{new UILabel("条形码大小", UILabel.LEFT), barWidthContainer, barHeightContainer},
new Component[]{null, new UILabel(Inter.getLocText("Tree-Width"), UILabel.CENTER), new UILabel(Inter.getLocText("Height"), UILabel.CENTER)},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Barcode_Size"), UILabel.LEFT), barWidthContainer, barHeightContainer},
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), UILabel.CENTER), new UILabel(Inter.getLocText("FR-Designer_Height"), UILabel.CENTER)},
new Component[]{drawingTextCheckBox, null, null}
};
JPanel normalPane = TableLayoutHelper.createTableLayoutPane(components_normal, rowSize, columnSize1);
JPanel normalPane = TableLayoutHelper.createGapTableLayoutPane(components_normal, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE);
return normalPane;
}
@ -167,17 +172,21 @@ public class BarCodePane extends FurtherBasicBeanPane<BarcodePresent> {
private JPanel getSpecialPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize1 = {p, p};
double[] columnSize = {p, p};
double[] rowSize = {p, p, p, p, p, p, p, p};
UILabel uiLabel = new UILabel(Inter.getLocText("RCodeVersion") + ":", UILabel.RIGHT);
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
UILabel uiLabel = new UILabel(Inter.getLocText("RCodeVersion"), UILabel.LEFT);
uiLabel.setPreferredSize(typeSetLabel.getPreferredSize());
RCodeVersionComboBox.setPreferredSize(new Dimension(155,20));
RCodeErrorCorrectComboBox.setPreferredSize(new Dimension(155,20));
RCodesizespinner.setPreferredSize(new Dimension(155,20));
Component[][] components_special = new Component[][]{
new Component[]{uiLabel, RCodeVersionComboBox},
new Component[]{new UILabel(Inter.getLocText("RCodeErrorCorrect") + ":", UILabel.RIGHT), RCodeErrorCorrectComboBox},
new Component[]{new UILabel(Inter.getLocText("RCodeDrawPix") + ":", UILabel.RIGHT), RCodesizespinner}
new Component[]{new UILabel(Inter.getLocText("RCodeErrorCorrect"), UILabel.LEFT), RCodeErrorCorrectComboBox},
new Component[]{new UILabel(Inter.getLocText("RCodeDrawPix"), UILabel.LEFT), RCodesizespinner}
};
JPanel specialPane = TableLayoutHelper.createTableLayoutPane(components_special, rowSize, columnSize1);
JPanel specialPane = TableLayoutHelper.createGapTableLayoutPane(components_special, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE);
return specialPane;
}

9
designer/src/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java

@ -24,15 +24,18 @@ public class BasicWidgetPropertySettingPane extends BasicPane {
public BasicWidgetPropertySettingPane() {
this.setLayout(new BorderLayout());
enableCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Visible"), true);
enableCheckBox.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
visibleCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Widget-Visible"), true);
enableCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
widgetNameComboBox = new ParameterTreeComboBox();
widgetNameComboBox.refreshTree();
JPanel widgetNamePane = new JPanel(new BorderLayout());
widgetNamePane.add(widgetNameComboBox, BorderLayout.CENTER);
widgetNamePane.setBorder(BorderFactory.createEmptyBorder(0,20,0,0));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Form-Widget_Name") + " "), widgetNameComboBox},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Form-Widget_Name")), widgetNamePane},
new Component[]{enableCheckBox, null},
new Component[]{visibleCheckBox, null},
};

1
designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java

@ -24,7 +24,6 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false);
directWriteCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
directWriteCheckBox.setPreferredSize(new Dimension(100, 30));
waterMarkDictPane = new WaterMarkDictPane();

3
designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java

@ -1,5 +1,6 @@
package com.fr.design.widget.ui;
import com.fr.base.FRContext;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog;
@ -83,7 +84,7 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
try {
pr = (ParameterProvider) parameterProvider.clone();
} catch (CloneNotSupportedException e1) {
e1.printStackTrace();
FRContext.getLogger().error(e1.getMessage(), e1);
}
list.add(pr);
}

10
designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java

@ -156,14 +156,12 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
@Override
protected JPanel setFirstContentPane() {
JPanel content = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
content.setLayout(FRGUIPaneFactory.createBorderLayout());
// richer:数字的允许直接编辑没有意义
JPanel content = FRGUIPaneFactory.createBorderLayout_S_Pane();
waterMarkDictPane = new WaterMarkDictPane();
waterMarkDictPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
content.add(waterMarkDictPane, BorderLayout.CENTER);
return waterMarkDictPane;
return content;
}

10
designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java

@ -58,18 +58,18 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
}
});
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.add(waterMarkDictPane, BorderLayout.CENTER);
JPanel content = FRGUIPaneFactory.createBorderLayout_S_Pane();
waterMarkDictPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
return jPanel;
content.add(waterMarkDictPane, BorderLayout.CENTER);
return content;
}
public JPanel setValidatePane(){
public JPanel setValidatePane() {
return regPane;
}
protected RegPane createRegPane() {
return new RegPane();
}

13
designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java

@ -1,18 +1,16 @@
package com.fr.design.widget.ui;
import java.awt.*;
import java.awt.event.KeyListener;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.*;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.WaterMark;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyListener;
public class WaterMarkDictPane extends JPanel {
private UITextField waterMarkTextField;
@ -25,7 +23,7 @@ public class WaterMarkDictPane extends JPanel {
waterMarkTextField = new UITextField(13);
UILabel emptyLabel = new UILabel();
emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 33, 0, 0));
emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
@ -36,7 +34,6 @@ public class WaterMarkDictPane extends JPanel {
double[] columnSize = {p, p, f};
int[][] rowCount = {{1, 1}};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
// JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(panel, BorderLayout.CENTER);
}

8
designer/src/com/fr/quickeditor/CellQuickEditor.java

@ -55,6 +55,8 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
emptyLabel.setPreferredSize(new Dimension(60, 20));
}
protected static final int VGAP = 10, HGAP = 8;
public CellQuickEditor() {
scrollBar = new UIScrollBar(UIScrollBar.VERTICAL) {
@ -101,7 +103,7 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
new Component[]{initTopContent(), null},
new Component[]{centerBody, null}
};
leftContentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
leftContentPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
this.setLayout(new BarLayout());
this.add(scrollBar);
this.add(leftContentPane);
@ -122,8 +124,8 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()},
new Component[]{insertContentLabel, cellElementEditButton},
};
JPanel topContent = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
topContent.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
JPanel topContent = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
topContent.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 0));
return topContent;
}

4
designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java

@ -34,10 +34,10 @@ public class CellBiasTextPainterEditor extends CellQuickEditor {
}
});
editButton.setOpaque(false);
content.add(TableLayoutHelper.createTableLayoutPane(new Component[][]{
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, editButton}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}), BorderLayout.CENTER);
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content;
}

76
designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -18,6 +18,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.MultilineLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
@ -54,6 +55,7 @@ import java.util.ArrayList;
public class CellDSColumnEditor extends CellQuickEditor {
private static final double P = TableLayout.PREFERRED, F = TableLayout.FILL;
private static final Color TIP_FONT_COLOR = new Color(0x7F333334, true);
private enum FilterType {
//前N个 后N个 奇数 偶数 自定义 未定义
@ -71,8 +73,6 @@ public class CellDSColumnEditor extends CellQuickEditor {
private JPanel cardContainer;
// 卡片布局TAB切换按钮
private UIHeadGroup tabsHeaderIconPane;
// 数据列基本设置
private DSColumnBasicEditorPane cellDSColumnBasicPane;
// 数据列高级设置
private DSColumnAdvancedEditorPane cellDSColumnAdvancedPane;
@ -156,7 +156,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
private void createPanes() {
paneList = new ArrayList<>();
/*基本设置面板*/
cellDSColumnBasicPane = new DSColumnBasicEditorPane();
DSColumnBasicEditorPane cellDSColumnBasicPane = new DSColumnBasicEditorPane();
paneList.add(cellDSColumnBasicPane);
/*高级设置面板*/
cellDSColumnAdvancedPane = new DSColumnAdvancedEditorPane();
@ -225,7 +225,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
Component[][] components = new Component[][]{
new Component[]{uiLabel, uiButton}
};
conditionPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
conditionPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
this.add(this.createContentPane(), BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
}
@ -272,7 +272,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
//条件过滤
new Component[]{this.conditionPane}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
}
}
@ -483,11 +483,11 @@ public class CellDSColumnEditor extends CellQuickEditor {
//数据倍数
UILabel multipleLabel = new UILabel(Inter.getLocText("Column_Multiple"));
multipleLabel.setPreferredSize(new Dimension(60, 20));
multiPane = TableLayoutHelper.createTableLayoutPane(new Component[][]{
multiPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{
multipleLabel, multiNumSpinner
}
}, new double[]{P}, new double[]{P, F}
}, new double[]{P}, new double[]{P, F}, HGAP, VGAP
);
multiNumPane.add(multiPane);
useMultiplyNumCheckBox.addActionListener(new ActionListener() {
@ -516,7 +516,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
{extendableDirectionPane},
{multiNumPane}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
}
@ -582,7 +582,9 @@ public class CellDSColumnEditor extends CellQuickEditor {
};
double[] rowSize = {P, P}, columnSize = {P, F};
this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.CENTER);
this.add(TableLayoutHelper.createGapTableLayoutPane(
components, rowSize, columnSize, HGAP, VGAP
), BorderLayout.CENTER);
}
@ -604,7 +606,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
if (noContent) {
centerPane.setPreferredSize(new Dimension(0, 0));
} else {
centerPane.setPreferredSize(new Dimension(155, 20));
centerPane.setPreferredSize(new Dimension(156, 20));
}
String sortFormula = dSColumn.getSortFormula();
if (sortFormula != null && sortFormula.length() >= 1) {
@ -678,14 +680,14 @@ public class CellDSColumnEditor extends CellQuickEditor {
setCardPaneLayout.show(setCardPane, FilterType.TOP.name());
tipCardPaneLayout.show(tipCardPane, FilterType.TOP.name());
//隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(155, 20));
setCardPane.setPreferredSize(new Dimension(156, 20));
tipCardPane.setPreferredSize(new Dimension(0, 0));
} else if (selectIndex == 2) {
//后N个
setCardPaneLayout.show(setCardPane, FilterType.BOTTOM.name());
tipCardPaneLayout.show(tipCardPane, FilterType.BOTTOM.name());
//隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(155, 20));
setCardPane.setPreferredSize(new Dimension(156, 20));
tipCardPane.setPreferredSize(new Dimension(0, 0));
} else if (selectIndex == 3) {
//奇数
@ -693,19 +695,19 @@ public class CellDSColumnEditor extends CellQuickEditor {
tipCardPaneLayout.show(tipCardPane, FilterType.ODD.name());
//隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0));
tipCardPane.setPreferredSize(new Dimension(221, 15));
tipCardPane.setPreferredSize(new Dimension(224, 40));
} else if (selectIndex == 4) {
setCardPaneLayout.show(setCardPane, FilterType.EVEN.name());
tipCardPaneLayout.show(tipCardPane, FilterType.EVEN.name());
//隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0));
tipCardPane.setPreferredSize(new Dimension(221, 15));
tipCardPane.setPreferredSize(new Dimension(224, 40));
} else if (selectIndex == 5) {
setCardPaneLayout.show(setCardPane, FilterType.SPECIFY.name());
tipCardPaneLayout.show(tipCardPane, FilterType.SPECIFY.name());
//显示set和tip
setCardPane.setPreferredSize(new Dimension(155, 20));
tipCardPane.setPreferredSize(new Dimension(221, 15));
setCardPane.setPreferredSize(new Dimension(156, 20));
tipCardPane.setPreferredSize(new Dimension(224, 40));
} else {
setCardPaneLayout.show(setCardPane, FilterType.UNDEFINE.name());
tipCardPaneLayout.show(tipCardPane, FilterType.UNDEFINE.name());
@ -713,7 +715,10 @@ public class CellDSColumnEditor extends CellQuickEditor {
setCardPane.setPreferredSize(new Dimension(0, 0));
tipCardPane.setPreferredSize(new Dimension(0, 0));
}
setCardPane.revalidate();
tipCardPane.revalidate();
setCardPane.repaint();
tipCardPane.repaint();
}
});
//配置展示CardLayout
@ -737,28 +742,29 @@ public class CellDSColumnEditor extends CellQuickEditor {
//奇数 UILabel 占一行作为提示信息
setCardPane.add(new JPanel(), FilterType.ODD.name());
tipCardPane.add(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1")
+ "," + Inter.getLocText("BindColumn-Odd_Selected_(1,3,5...)")), FilterType.ODD.name());
MultilineLabel oddTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Odd_Tip"));
oddTip.setForeground(TIP_FONT_COLOR);
tipCardPane.add(oddTip, FilterType.ODD.name());
//偶数 UILabel 占一行作为提示信息
setCardPane.add(new JPanel(), FilterType.EVEN.name());
tipCardPane.add(new UILabel(Inter.getLocText("BindColumn-Result_Serial_Number_Start_From_1")
+ "," + Inter.getLocText("BindColumn-Even_Selected_(2,4,6...)")), FilterType.EVEN.name());
MultilineLabel evenTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Even_Tip"));
evenTip.setForeground(TIP_FONT_COLOR);
tipCardPane.add(evenTip, FilterType.EVEN.name());
//输入框占用右半边,提示信息占一行
serialTextField = new UITextField(16);
setCardPane.add(serialTextField, FilterType.SPECIFY.name());
tipCardPane.add(new UILabel(
Inter.getLocText(new String[]{
"Format", "BindColumn-Result_Serial_Number_Start_From_1", "Inner_Parameter", "Group_Count"},
new String[]{": 1,2-3,5,8 ", ",", "$__count__"})), FilterType.SPECIFY.name());
MultilineLabel specifyTip = new MultilineLabel(Inter.getLocText("FS-Designer_DS_Filter_Specify_Tip"));
specifyTip.setForeground(TIP_FONT_COLOR);
tipCardPane.add(specifyTip, FilterType.SPECIFY.name());
this.add(TableLayoutHelper.createTableLayoutPane(new Component[][]{
this.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
{filterLabel, rsComboBox},
{null, setCardPane},
{tipCardPane, null}
}, new double[]{P, P, P}, new double[]{P, F}), BorderLayout.CENTER);
}, new double[]{P, P, P}, new double[]{P, F}, HGAP, VGAP), BorderLayout.CENTER);
}
public void populate(CellElement cellElement) {
@ -776,30 +782,30 @@ public class CellDSColumnEditor extends CellQuickEditor {
case SelectCount.TOP:
this.topFormulaPane.populate(selectCount.getFormulaCount());
//隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(155, 20));
setCardPane.setPreferredSize(new Dimension(156, 20));
tipCardPane.setPreferredSize(new Dimension(0, 0));
break;
case SelectCount.BOTTOM:
this.bottomFormulaPane.populate(selectCount.getFormulaCount());
//隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(155, 20));
setCardPane.setPreferredSize(new Dimension(156, 20));
tipCardPane.setPreferredSize(new Dimension(0, 0));
break;
case SelectCount.SPECIFY:
this.serialTextField.setText(selectCount.getSerial());
//显示set和tip
setCardPane.setPreferredSize(new Dimension(155, 20));
tipCardPane.setPreferredSize(new Dimension(221, 15));
setCardPane.setPreferredSize(new Dimension(156, 20));
tipCardPane.setPreferredSize(new Dimension(224, 40));
break;
case SelectCount.EVEN:
//隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0));
tipCardPane.setPreferredSize(new Dimension(221, 15));
tipCardPane.setPreferredSize(new Dimension(224, 40));
break;
case SelectCount.ODD:
//隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0));
tipCardPane.setPreferredSize(new Dimension(221, 15));
tipCardPane.setPreferredSize(new Dimension(224, 40));
break;
default:
//隐藏set和tip
@ -949,9 +955,9 @@ public class CellDSColumnEditor extends CellQuickEditor {
UILabel customValueLabel = new UILabel(Inter.getLocText("FR-Designer_Display_Value"));
customValueLabel.setPreferredSize(new Dimension(60, 20));
formulaField = new JFormulaField("$$$");
this.add(TableLayoutHelper.createTableLayoutPane(new Component[][]{
this.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{customValueLabel, formulaField},
}, new double[]{P}, new double[]{P, F}), BorderLayout.CENTER);
}, new double[]{P}, new double[]{P, F}, HGAP, VGAP), BorderLayout.CENTER);
}
public void populate(CellElement cellElement) {

4
designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java

@ -120,10 +120,10 @@ public class CellFormulaQuickEditor extends CellQuickEditor {
pane.add(formulaButton, BorderLayout.EAST);
content.add(pane, BorderLayout.NORTH);
return TableLayoutHelper.createTableLayoutPane(new Component[][]{
return TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, content}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL});
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP);
}
@Override

4
designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java

@ -42,10 +42,10 @@ public class CellImageQuickEditor extends CellQuickEditor {
}
});
editButton.setOpaque(false);
content.add(TableLayoutHelper.createTableLayoutPane(new Component[][]{
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, editButton}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}), BorderLayout.CENTER);
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content;
}

4
designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java

@ -29,10 +29,10 @@ public class CellRichTextEditor extends CellQuickEditor {
JPanel content = new JPanel(new BorderLayout());
richTextButton = new UIButton();
richTextButton.setOpaque(false);
content.add(TableLayoutHelper.createTableLayoutPane(new Component[][]{
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, richTextButton}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}), BorderLayout.CENTER);
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content;
}

4
designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java

@ -30,10 +30,10 @@ public class CellSubReportEditor extends CellQuickEditor {
JPanel content = new JPanel(new BorderLayout());
subReportButton = new UIButton();
subReportButton.setOpaque(false);
content.add(TableLayoutHelper.createTableLayoutPane(new Component[][]{
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, subReportButton}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}), BorderLayout.CENTER);
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content;
}

2
designer/src/com/fr/quickeditor/floatquick/FloatImageQuickEditor.java

@ -42,7 +42,7 @@ public class FloatImageQuickEditor extends FloatQuickEditor {
JPanel pane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 78, 10, 17));
this.setBorder(BorderFactory.createEmptyBorder(10, 75, 10, 15));
this.add(pane, BorderLayout.CENTER);

7
designer/src/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.base.Formula;
import com.fr.base.Style;
import com.fr.base.TextFormat;
import com.fr.design.constants.UIConstants;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.ElementCasePane;
@ -37,7 +38,7 @@ public class FloatStringQuickEditor extends FloatQuickEditor {
JPanel pane = new JPanel(new BorderLayout(5, 0));
pane.add(stringTextField, BorderLayout.CENTER);
pane.add(formulaButton, BorderLayout.EAST);
pane.setBorder(BorderFactory.createEmptyBorder(0,0,0,7));
pane.setBorder(BorderFactory.createEmptyBorder(0,0,0,5));
formulaButton.setVisible(false);
this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
@ -50,7 +51,7 @@ public class FloatStringQuickEditor extends FloatQuickEditor {
stringTextField.setLineWrap(true);
stringTextField.setWrapStyleWord(true);
stringTextField.setMargin(new Insets(5, 5, 5, 5));
stringTextField.setBorder(BorderFactory.createLineBorder(Color.gray));
stringTextField.setBorder(BorderFactory.createLineBorder(UIConstants.POP_DIALOG_BORDER));
stringTextField.setBackground(Color.WHITE);
}
@ -73,7 +74,7 @@ public class FloatStringQuickEditor extends FloatQuickEditor {
Formula formula = (Formula) value;
str = formula.getContent();
stringTextField.setLineWrap(false);
this.setBorder(BorderFactory.createEmptyBorder(10, 78, 10, 10));
this.setBorder(BorderFactory.createEmptyBorder(10, 75, 10, 10));
reserveInResult = formula.isReserveInResult();
reserveOnWriteOrAnaly = formula.isReserveOnWriteOrAnaly();
} else {

1
designer_base/src/com/fr/design/constants/UIConstants.java

@ -19,6 +19,7 @@ public interface UIConstants {
public static final Icon BLACK_ICON = BaseUtils.readIcon("/com/fr/base/images/cell/blank.gif");
public static final Border CELL_ATTR_ZEROBORDER = BorderFactory.createEmptyBorder(0 ,0, 0, 0);
public static final Border CELL_ATTR_EMPTYBORDER = BorderFactory.createEmptyBorder(0 ,10, 0, 0);
public static final Border CELL_ATTR_NORMALBORDER = BorderFactory.createEmptyBorder(0 ,10, 0, 15);

5
designer_base/src/com/fr/design/fun/WidgetPropertyUIProvider.java

@ -1,5 +1,6 @@
package com.fr.design.fun;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.stable.fun.mark.Mutable;
@ -12,7 +13,11 @@ public interface WidgetPropertyUIProvider extends Mutable {
int CURRENT_LEVEL = 1;
@Deprecated
AbstractPropertyTable createWidgetAttrTable();
//fanglei: 9.0新界面采用pane,不再用JTable
BasicPane createWidgetAttrPane();
String tableTitle();
}

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

@ -302,12 +302,13 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
double f = TableLayout.FILL;
double[] columnSize = {p};
double[] rowSize = {p, p, p};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{fontSizeStyleComboBox},
new Component[]{buttonPane},
new Component[]{createLinePane()}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
}
private JPanel createRightPane() {
@ -315,17 +316,19 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p};
int[][] rowCount = {{1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{fontSizeComboBox},
new Component[]{isSuperOrSubPane}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
}
private JPanel createPane() {
JPanel createPane = new JPanel(new BorderLayout(3, 5));
JPanel createPane = new JPanel(new BorderLayout());
createPane.add(fontNameComboBox, BorderLayout.NORTH);
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{createLeftPane(), createRightPane()}}, TableLayoutHelper.FILL_LASTCOLUMN, 5, 7);
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{createLeftPane(), createRightPane()}}, TableLayoutHelper.FILL_LASTCOLUMN, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE);
jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
createPane.add(jPanel, BorderLayout.CENTER);
return createPane;
}

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

@ -42,6 +42,7 @@ public class FormatPane extends AbstractBasicStylePane {
private static final int LABLE_DELTA_WIDTH = 8;
private static final int LABLE_HEIGHT = 15; //标签背景的范围
private static final int CURRENCY_FLAG_POINT = 6;
private static final Border LEFT_BORDER = BorderFactory.createEmptyBorder(0,30,0,0);
private static final Integer[] TYPES = new Integer[]{FormatContents.NULL, FormatContents.NUMBER, FormatContents.CURRENCY, FormatContents.PERCENT, FormatContents.SCIENTIFIC,
FormatContents.DATE, FormatContents.TIME, FormatContents.TEXT};
@ -76,7 +77,7 @@ public class FormatPane extends AbstractBasicStylePane {
contentPane = new JPanel(new BorderLayout(0, 4)) {
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, 70);
return new Dimension(super.getPreferredSize().width, 65);
}
};
typeComboBox = new UIComboBox(types);
@ -84,37 +85,44 @@ public class FormatPane extends AbstractBasicStylePane {
typeComboBox.setRenderer(render);
typeComboBox.addItemListener(itemListener);
contentPane.add(sampleLabel, BorderLayout.NORTH);
centerPane = new JPanel(new CardLayout());
centerPane.add(new JPanel(), "hide");
centerPane.setPreferredSize(new Dimension(0, 0));
centerPane.add(contentPane, "show");
formatFontPane = new JPanel(new BorderLayout());
formatFontPane.add(centerPane, BorderLayout.NORTH);
formatFontPane.add(new FRFontPane(), BorderLayout.CENTER);
txtCenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.add(txtCenterPane, BorderLayout.CENTER);
txtCenterPane = new JPanel(new BorderLayout());
textField = new UIComboBox(FormatField.getInstance().getFormatArray(getFormatContents()));
textField.addItemListener(textFieldItemListener);
textField.setEditable(true);
txtCenterPane.add(textField, BorderLayout.NORTH);
contentPane.add(txtCenterPane, BorderLayout.CENTER);
centerPane = new JPanel(new CardLayout());
centerPane.add(new JPanel(), "hide");
centerPane.setPreferredSize(new Dimension(0, 0));
centerPane.add(contentPane, "show");
frFontPane = new FRFontPane();
UILabel font = new UILabel(Inter.getLocText("FR-Designer_FRFont"), SwingConstants.LEFT);
JPanel fontPane = new JPanel(new BorderLayout());
fontPane.add(font, BorderLayout.NORTH);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
typeComboBox.setPreferredSize(new Dimension(155,20));
JPanel typePane = new JPanel(new BorderLayout());
typePane.add(typeComboBox, BorderLayout.CENTER);
typePane.setBorder(LEFT_BORDER);
centerPane.setBorder(LEFT_BORDER);
frFontPane.setBorder(LEFT_BORDER);
Component[][] components = new Component[][]{
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), typePane},
new Component[]{null, centerPane},
new Component[]{fontPane, frFontPane},
new Component[]{null, null}
};
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, f};
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);
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
this.add(panel, BorderLayout.CENTER);
}
@ -310,7 +318,7 @@ public class FormatPane extends AbstractBasicStylePane {
for (int i = 0; i < items.length; i++) {
textField.addItem(items[i]);
}
centerPane.setPreferredSize(new Dimension(270, 70));
centerPane.setPreferredSize(new Dimension(270, 65));
cardLayout.show(centerPane, "show");
}
isFormat = true;

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

@ -2119,4 +2119,8 @@ FR-Designer_Widget_Return_Path=return path
FR-Designer_Widget_Display_Position=Display Position
FR-Designer_Size_Limit=Size_Limit
FR-Designer_Widget_Name=Widget Name
FR-Designer_Coords_And_Size=Coords & Size
FR-Designer_Coords_And_Size=Coords & Size
FR-Designer_Barcode_Size=Barcode_Size
FS-Designer_DS_Filter_Odd_Tip=Odd_Tip
FS-Designer_DS_Filter_Even_Tip=Even_Tip
FS-Designer_DS_Filter_Specify_Tip=Specify_Tip

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

@ -2116,3 +2116,7 @@ FR-Designer_Widget_Display_Position=Display Position
FR-Designer_Size_Limit=Size_Limit
FR-Designer_Widget_Name=Widget Name
FR-Designer_Coords_And_Size=Coords & Size
FR-Designer_Barcode_Size=Barcode_Size
FS-Designer_DS_Filter_Odd_Tip=Odd_Tip
FS-Designer_DS_Filter_Even_Tip=Even_Tip
FS-Designer_DS_Filter_Specify_Tip=Specify_Tip

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

@ -2109,7 +2109,7 @@ FR-Designer_Use_Params_Template=
FR-Designer_Label_Name=
FR-Designer_Insert_Formula=
FR-Designer_Not_Support_Authority_Edit=\u3053\u306E\u8981\u7D20\u306F\u6A29\u9650\u5236\u5FA1\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093
FR-Designer_Dynamic_Parameter=\
FR-Designer_Dynamic_Parameter=
FR-Designer_Remove_Item=
FR-Designer_Widget_No_Repeat=
FR-Designer_Widget_Error_Tip=
@ -2118,4 +2118,8 @@ FR-Designer_Widget_Return_Path=
FR-Designer_Widget_Display_Position=
FR-Designer_Size_Limit=
FR-Designer_Widget_Name=
FR-Designer_Coords_And_Size=
FR-Designer_Coords_And_Size=
FR-Designer_Barcode_Size=
FS-Designer_DS_Filter_Odd_Tip=
FS-Designer_DS_Filter_Even_Tip=
FS-Designer_DS_Filter_Specify_Tip=

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

@ -2109,7 +2109,7 @@ FR-Designer_Use_Params_Template=
FR-Designer_Label_Name=
FR-Designer_Add_Event=
FR-Designer_Not_Support_Authority_Edit=\uD574\uB2F9\uC694\uC18C\uB294\uAD8C\uD55C\uCEE8\uD2B8\uB864\uC744\uC9C0\uC6D0\uD558\uC9C0\uC54A\uC2B5\uB2C8\uB2E4.
FR-Designer_Dynamic_Parameter=\
FR-Designer_Dynamic_Parameter=
FR-Designer_Remove_Item=
FR-Designer_Widget_No_Repeat=
FR-Designer_Widget_Error_Tip=
@ -2118,4 +2118,8 @@ FR-Designer_Widget_Return_Path=
FR-Designer_Widget_Display_Position=
FR-Designer_Size_Limit=
FR-Designer_Widget_Name=
FR-Designer_Coords_And_Size=
FR-Designer_Coords_And_Size=
FR-Designer_Barcode_Size=
FS-Designer_DS_Filter_Odd_Tip=
FS-Designer_DS_Filter_Even_Tip=
FS-Designer_DS_Filter_Specify_Tip=

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

@ -2126,4 +2126,8 @@ FR-Designer_Widget_Return_Path=\u7ED3\u679C\u8FD4\u56DE\u5B8C\u6574\u5C42\u6B21\
FR-Designer_Widget_Display_Position=\u663E\u793A\u4F4D\u7F6E
FR-Designer_Size_Limit=\u5927\u5C0F\u9650\u5236
FR-Designer_Widget_Name=\u63A7\u4EF6\u540D\u79F0
FR-Designer_Coords_And_Size=\u5750\u6807\u00B7\u5C3A\u5BF8
FR-Designer_Coords_And_Size=\u5750\u6807\u00B7\u5C3A\u5BF8
FR-Designer_Barcode_Size=\u6761\u5F62\u7801\u5927\u5C0F
FS-Designer_DS_Filter_Odd_Tip=\u63D0\u793A\uFF1A\u5E8F\u53F7\u4ECE1\u5F00\u59CB\uFF0C\u9009\u62E9\u4E86\u5947\u6570\u96C6(1,3,5...)
FS-Designer_DS_Filter_Even_Tip=\u63D0\u793A\uFF1A\u5E8F\u53F7\u4ECE1\u5F00\u59CB\uFF0C\u9009\u62E9\u4E86\u5076\u6570\u96C6(2,4,6...)
FS-Designer_DS_Filter_Specify_Tip=\u63D0\u793A\uFF1A\u683C\u5F0F\u4E3A1,2-3,5,8\uFF0C\u5E8F\u53F7\u4ECE1\u5F00\u59CB\uFF0C\u5185\u503C\u53C2\u6570$_count_\u8868\u793A\u603B\u4E2A\u6570

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

@ -2119,3 +2119,7 @@ FR-Designer_Widget_Display_Position=
FR-Designer_Size_Limit=
FR-Designer_Widget_Name=
FR-Designer_Coords_And_Size=
FR-Designer_Barcode_Size=
FS-Designer_DS_Filter_Odd_Tip=\u63D0\u793A\uFF1A\u5E8F\u865F\u5F9E1\u958B\u59CB\uFF0C\u9078\u64C7\u4E86\u5947\u6578\u96C6(1,3,5...)
FS-Designer_DS_Filter_Even_Tip=\u63D0\u793A\uFF1A\u5E8F\u865F\u5F9E1\u958B\u59CB\uFF0C\u9078\u64C7\u4E86\u5076\u6578\u96C6(2,4,6...)
FS-Designer_DS_Filter_Specify_Tip=\u63D0\u793A\uFF1A\u683C\u5F0F\u70BA1,2-3,5,8\uFF0C\u5E8F\u865F\u5F9E1\u958B\u59CB\uFF0C\u5185\u7F6E\u53C3\u6578$_count_\u8868\u793A\u7E02\u500B\u6578

25
designer_base/src/com/fr/design/present/dict/FormulaDictPane.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.base.Formula;
import com.fr.data.impl.FormulaDictionary;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.editor.editor.FormulaEditor;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
@ -40,8 +41,9 @@ public class FormulaDictPane extends FurtherBasicBeanPane<FormulaDictionary> {
private void initComponents() {
keyFormulaEditor = new FormulaEditor();
keyFormulaEditor.setColumns(EDITOR_COLUMN);
JPanel keyFormulaContainer = new JPanel(new FlowLayout(FlowLayout.RIGHT));
keyFormulaEditor.setPreferredSize(new Dimension(148, 20));
JPanel keyFormulaContainer = new JPanel(new FlowLayout(FlowLayout.RIGHT, 5, 0));
keyFormulaContainer.setBorder(BorderFactory.createEmptyBorder(0,-5,0,-5));
keyFormulaEditor.setPreferredSize(new Dimension(144, 20));
Icon icon = BaseUtils.readIcon("/com/fr/design/images/m_insert/formula.png");
keyFormulaContainer.add(new JLabel(icon));
keyFormulaContainer.add(keyFormulaEditor);
@ -52,30 +54,31 @@ public class FormulaDictPane extends FurtherBasicBeanPane<FormulaDictionary> {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p, p, p, p};
double[] rowSize = {p, p, p};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
UILabel tag = new UILabel(Inter.getLocText("Formula_Dictionary_Display_Examples_Html"));
tag.setPreferredSize(new Dimension(225,20));
JPanel t = new JPanel(new BorderLayout());
t.add(tag, BorderLayout.NORTH);
t.add(tag, BorderLayout.CENTER);
Formula vf = new Formula("$$$");
valueFormulaEditor = new FormulaEditor("", vf);
JPanel valueFormulaContainer = new JPanel(new FlowLayout(FlowLayout.RIGHT));
valueFormulaEditor.setPreferredSize(new Dimension(148, 20));
JPanel valueFormulaContainer = new JPanel(new FlowLayout(FlowLayout.RIGHT, 5, 0));
valueFormulaContainer.setBorder(BorderFactory.createEmptyBorder(0,-5,0,-5));
valueFormulaEditor.setPreferredSize(new Dimension(144, 20));
valueFormulaContainer.add(new JLabel(icon));
valueFormulaContainer.add(valueFormulaEditor);
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Actual_Value"), UILabel.LEFT), keyFormulaContainer},
new Component[]{null, null},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Display_Value"), UILabel.LEFT), valueFormulaContainer},
new Component[]{null, null},
new Component[]{t, null}
new Component[]{tag, null}
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE);
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);

6
designer_form/src/com/fr/design/designer/properties/mobile/BodyMobilePropertyUI.java

@ -3,6 +3,7 @@ package com.fr.design.designer.properties.mobile;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider;
import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.general.Inter;
@ -27,6 +28,11 @@ public class BodyMobilePropertyUI extends AbstractWidgetPropertyUIProvider {
return new BodyAppRelayoutTable(xCreator);
}
@Override
public BasicPane createWidgetAttrPane() {
return null;
}
@Override
public String tableTitle() {
return Inter.getLocText("FR-Designer_Mobile-Attr");

7
designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyUI.java

@ -2,8 +2,10 @@ package com.fr.design.designer.properties.mobile;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XElementCase;
import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider;
import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.design.widget.ui.designer.mobile.ElementCaseDefinePane;
import com.fr.general.Inter;
/**
@ -22,6 +24,11 @@ public class ElementCasePropertyUI extends AbstractWidgetPropertyUIProvider {
return new ElementCasePropertyTable(xCreator);
}
@Override
public BasicPane createWidgetAttrPane() {
return new ElementCaseDefinePane(xCreator);
}
@Override
public String tableTitle() {
return Inter.getLocText("FR-Designer_Mobile-Attr");

22
designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java

@ -6,12 +6,14 @@ import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.*;
import com.fr.design.designer.properties.EventPropertyTable;
import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.widget.ui.FormWidgetCardPane;
import com.fr.design.widget.ui.designer.mobile.MobileWidgetDefinePane;
import com.fr.form.ui.Widget;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
@ -35,6 +37,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
private FormWidgetCardPane formWidgetCardPane; // 控件的属性表
private EventPropertyTable eventTable; // 控件的事件表
private List<AbstractPropertyTable> widgetPropertyTables; // 这个变量应该是保存控件拓展的属性tab
private List<MobileWidgetDefinePane> mobileExtraPropertyPanes; // 保存9.0设计器下移动端拓展的属性tab,舍弃JTable
private FormDesigner designer; // 当前designer
private UIScrollPane psp; // 用来装载属性表table的容器
private UIScrollPane esp; //用来装载事件table的容器
@ -97,6 +100,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
return;
}
widgetPropertyTables = new ArrayList<AbstractPropertyTable>();
mobileExtraPropertyPanes = new ArrayList<>();
//依次创建属性表、事件表、移动端表,再将它们整合到TabPane中去
this.createPropertyTable();
@ -113,8 +117,10 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
private void initTables() {
formWidgetCardPane.populate();
eventTable.refresh();
for (AbstractPropertyTable propertyTable : widgetPropertyTables) {
propertyTable.initPropertyGroups(designer);
if (mobileExtraPropertyPanes != null) {
for (MobileWidgetDefinePane extraPane : mobileExtraPropertyPanes) {
extraPane.initPropertyGroups(designer);
}
}
}
@ -211,12 +217,12 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
wsp.add(downPanel);
} else {
for (WidgetPropertyUIProvider widgetAttrProvider : widgetAttrProviders) {
AbstractPropertyTable propertyTable = widgetAttrProvider.createWidgetAttrTable();
widgetPropertyTables.add(propertyTable);
designer.addDesignerEditListener(new WidgetPropertyDesignerAdapter(formWidgetCardPane));
UIScrollPane uiScrollPane = new UIScrollPane(getExtraBodyTable(propertyTable));
wsp.add(uiScrollPane);
MobileWidgetDefinePane extraPane = (MobileWidgetDefinePane) widgetAttrProvider.createWidgetAttrPane();
if (extraPane != null) {
mobileExtraPropertyPanes.add(extraPane);
designer.addDesignerEditListener(new WidgetPropertyDesignerAdapter(formWidgetCardPane));
wsp.add(extraPane);
}
}
}
}

124
designer_form/src/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java

@ -0,0 +1,124 @@
package com.fr.design.widget.ui.designer.mobile;
import com.fr.base.mobile.MobileFitAttrState;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
/**
* 报表块-移动端属性面板
*
* Created by fanglei on 2017/8/8.
*/
public class ElementCaseDefinePane extends MobileWidgetDefinePane{
private static final String[] ITEMS = {
MobileFitAttrState.HORIZONTAL.description(),
MobileFitAttrState.VERTICAL.description(),
MobileFitAttrState.BIDIRECTIONAL.description(),
MobileFitAttrState.NONE.description()
};
private XCreator xCreator; // 当前选中控件的xCreator
private FormDesigner designer; // 当前设计器
private UIComboBox hComboBox; // 横屏下拉框
private UIComboBox vComboBox;// 竖屏下拉框
private UICheckBox heightRestrictCheckBox; // 手机显示限制高度复选框
private UILabel maxHeightLabel;
private UISpinner maxHeightSpinner; // 最大高度Spinner
public ElementCaseDefinePane (XCreator xCreator) {
this.xCreator = xCreator;
}
@Override
protected String title4PopupWindow() {
return "ElementCase";
}
@Override
public void initPropertyGroups(Object source) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner();
this.hComboBox = new UIComboBox(ITEMS);
this.vComboBox = new UIComboBox(ITEMS);
this.heightRestrictCheckBox = new UICheckBox(Inter.getLocText("Form-EC_heightrestrict"));
this.maxHeightLabel = new UILabel(Inter.getLocText("Form-EC_heightpercent"), SwingConstants.LEFT);
this.maxHeightSpinner = new UISpinner(0, 1, 0.01, 0.75);
maxHeightSpinner.setVisible(false);
maxHeightLabel.setVisible(false);
Component[][] components = new Component[][]{
new Component[] {new UILabel(Inter.getLocText("FR-Designer_Mobile-Horizontal"), SwingConstants.LEFT), hComboBox},
new Component[] {new UILabel(Inter.getLocText("FR-Designer_Mobile-Vertical"), SwingConstants.LEFT), vComboBox},
new Component[] {heightRestrictCheckBox, null},
new Component[] {maxHeightLabel, maxHeightSpinner}
};
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 30, LayoutConstants.VGAP_LARGE);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
final JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane();
panelWrapper.add(panel, BorderLayout.NORTH);
UIExpandablePane folderPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Fit"), 280, 20, panelWrapper);
this.add(folderPane, BorderLayout.NORTH);
this.bingListeners2Widgets();
this.repaint();
}
public void bingListeners2Widgets() {
this.hComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
((ElementCaseEditor)xCreator.toData()).setHorziontalAttr(MobileFitAttrState.parse(hComboBox.getSelectedIndex() + 1));
}
});
this.vComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
((ElementCaseEditor)xCreator.toData()).setVerticalAttr(MobileFitAttrState.parse(vComboBox.getSelectedIndex() + 1));
}
});
this.heightRestrictCheckBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
boolean isHeightRestrict = heightRestrictCheckBox.isSelected();
((ElementCaseEditor)xCreator.toData()).setHeightRestrict(isHeightRestrict);
maxHeightSpinner.setVisible(isHeightRestrict);
maxHeightLabel.setVisible(isHeightRestrict);
}
});
this.maxHeightSpinner.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
((ElementCaseEditor)xCreator.toData()).setHeightPercent(maxHeightSpinner.getValue());
}
});
}
}

13
designer_form/src/com/fr/design/widget/ui/designer/mobile/MobileWidgetDefinePane.java

@ -0,0 +1,13 @@
package com.fr.design.widget.ui.designer.mobile;
import com.fr.design.dialog.BasicPane;
/**
* 所有移动端需要拓展的属性面板均继承此类
*
* Created by fanglei on 2017/8/8.
*/
public abstract class MobileWidgetDefinePane extends BasicPane{
//初始化panel数据再repaint
public abstract void initPropertyGroups(Object source);
}
Loading…
Cancel
Save