Browse Source

Merge pull request #3302 in DESIGN/design from final/10.0 to persist/10.0

* commit '58511a5ec86b426f64113b4dad85fd0f56d99ced':
  REPORT-44803 参数面板拖动组件大小右侧不能跟随显示大小--来源【客户需求 508884】 【问题原因】release已验收,传一份到final,10.0.12.1中间版本发布 【改动思路】release已验收,传一份到final,10.0.12.1中间版本发布
  REPORT-46713 && REPORT-46469 && REPORT-46735 【问题原因】release已经验收,提一份到final,10.0.12.1中间版本发布 【改动思路】release已经验收,提一份到final,10.0.12.1中间版本发布
persist/10.0
superman 4 years ago
parent
commit
b42693911f
  1. 4
      designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java
  2. 91
      designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java
  3. 4
      designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java
  4. 3
      designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java

4
designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java

@ -27,10 +27,6 @@ public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCr
public DictionaryPane() {
}
public DictionaryPane(boolean needTableDataChange) {
this.tableDataDictPane.setNeedTableDataChange(needTableDataChange);
}
@Override
protected void initLayout() {
this.setLayout(new BorderLayout(0, 4));

91
designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java

@ -64,7 +64,6 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
private ItemListener itemListener;
private UIObserverListener uiObserverListener;
private FormulaEditor localFormulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula"));
private boolean needTableDataChange = true;
public TableDataDictPane() {
initBasicComponets();
@ -72,14 +71,6 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
iniListener();
}
/**
* 设置为true后一旦触发TableDataComboBox的itemChange就会通过数据连接更换当前数据字典的列名List
* @param needTableDataChange
*/
public void setNeedTableDataChange(boolean needTableDataChange) {
this.needTableDataChange = needTableDataChange;
}
public static void main(String[] args) {
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
@ -169,58 +160,38 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
if (tableDataWrappe == null) {
return;
}
if (itemListener != null) {
itemListener.itemStateChanged(e);
localFormulaEditor.addChangeListener(event -> itemListener.itemStateChanged(e));
}
if (isNeedTableDataChange()) {
changeColumnsName();
List<String> namelist = tableDataWrappe.calculateColumnNameList();
String[] columnNames = null;
if (!namelist.isEmpty()) {
columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
} else {
columnNames = new String[]{StringUtils.EMPTY};
}
}
private void changeColumnsName() {
TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem();
SwingWorker<List<String>, Object> worker = new SwingWorker<List<String>, Object>() {
@Override
protected List<String> doInBackground() {
if (tableDataWrappe == null) {
return new ArrayList<>();
}
return tableDataWrappe.calculateColumnNameList();
}
// 实际值列名
ColumnNameEditor actualColumnNameEditor = new ColumnNameEditor(columnNames);
actualColumnNameEditor.addItemListener(itemListener);
// 实际值列序号
ColumnIndexEditor actualColumnIndexEditor = new ColumnIndexEditor(columnNames.length);
actualColumnIndexEditor.addItemListener(itemListener);
keyColumnPane.setEditors(new Editor[]{actualColumnNameEditor, actualColumnIndexEditor}, columnNames[0]);
@Override
protected void done() {
try {
List<String> namelist = get();
String[] columnNames = null;
if (!namelist.isEmpty()) {
columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
} else {
columnNames = new String[]{StringUtils.EMPTY};
}
// 实际值列名
ColumnNameEditor actualColumnNameEditor = new ColumnNameEditor(columnNames);
actualColumnNameEditor.addItemListener(itemListener);
// 实际值列序号
ColumnIndexEditor actualColumnIndexEditor = new ColumnIndexEditor(columnNames.length);
actualColumnIndexEditor.addItemListener(itemListener);
keyColumnPane.setEditors(new Editor[]{actualColumnNameEditor, actualColumnIndexEditor}, columnNames[0]);
localFormulaEditor.setEnabled(true);
// 显示值列名
ColumnNameEditor displayColumnNameEditor = new ColumnNameEditor(columnNames);
displayColumnNameEditor.addItemListener(itemListener);
// 显示值列序号
ColumnIndexEditor displayColumnIndexEditor = new ColumnIndexEditor(columnNames.length);
displayColumnIndexEditor.addItemListener(itemListener);
valueDictPane.setEditors(new Editor[]{displayColumnNameEditor, displayColumnIndexEditor, localFormulaEditor}, columnNames[0]);
} catch (InterruptedException | ExecutionException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
FormulaEditor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula"));
formulaEditor.setEnabled(true);
formulaEditor.addChangeListener(ee -> {
if (itemListener != null) {
itemListener.itemStateChanged(e);
}
};
worker.execute();
});
// 显示值列名
ColumnNameEditor displayColumnNameEditor = new ColumnNameEditor(columnNames);
displayColumnNameEditor.addItemListener(itemListener);
// 显示值列序号
ColumnIndexEditor displayColumnIndexEditor = new ColumnIndexEditor(columnNames.length);
displayColumnIndexEditor.addItemListener(itemListener);
valueDictPane.setEditors(new Editor[]{displayColumnNameEditor, displayColumnIndexEditor, formulaEditor}, columnNames[0]);
if (itemListener != null) {
itemListener.itemStateChanged(e);
}
}
@Override
@ -404,8 +375,4 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
public void registerDSChangeListener() {
tableDataNameComboBox.registerGlobalDSChangeListener();
}
public boolean isNeedTableDataChange() {
return needTableDataChange;
}
}

4
designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java

@ -183,12 +183,12 @@ public class FormDesignerUI extends ComponentUI {
x1 = 0;
x2 = 6;
y2 = y1 = bounds.y - designer.getVerticalScaleValue() + (k == 1 ? 0 : bounds.height);
text = Utils.objectToString(bounds.y);
text = Utils.objectToString(y1 + designer.getVerticalScaleValue());
} else {
y1 = 0;
y2 = 6;
x1 = x2 = bounds.x - designer.getHorizontalScaleValue()+ (k == 3 ? 0 : bounds.width);
text = Utils.objectToString(bounds.x);
text = Utils.objectToString(x1 + designer.getHorizontalScaleValue());
}
text += com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Indent_Pixel");
g2d.setColor(XCreatorConstants.RESIZE_BOX_BORDER_COLOR);

3
designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java

@ -28,8 +28,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override
protected void initComponents() {
super.initComponents();
dictPane = new DictionaryPane(false);
dictPane = new DictionaryPane();
}
@Override

Loading…
Cancel
Save