Browse Source

Merge pull request #2598 in DESIGN/design from bugfix/10.0 to feature/10.0

* commit 'ac8216a9eb4882cce9149582d24ab710f2db6b08':
  REPORT-39914 创建远程工作目录问题
  CHART-16173 柱形图富文本标签时文本方向调整成横向
  更新:将StoreProcedureDataWrapper中无用的dialog及相关逻辑移除,将原本以dialog为父窗口的两个AutoProgressBar的父窗口也修改为new JFrame(),避免出现二级弹窗被遮盖的问题
  更新:将两个SwingWorker合并,将注释掉的代码和多余的逻辑删除
  REPORT-40822 存储过程数据集》编辑界面点击预览,预览框出现在编辑界面背面 【问题原因】设计器中,在弹窗的弹窗场景里,如果是使用DesignerContext.getDesignerFrame()获取父弹窗的话有点问题,会造成第二级的弹窗位于第一级弹窗背后。另外这里的预览会有闪屏现象,原因是在StoreProcedureDataWrapper中会在一个SwingWorker中将dialog(测试的时候发现这个dialog一直没有预览数据)置为可见,但是在另一个SwingWorker中又会将其置为不可见,然后在后续逻辑中重新构建一个包含预览数据的弹窗弹出,这样会造成弹窗又开又关又开,闪屏 【改动思路】传入new JFrame()作为父弹窗,就可以保证预览的弹窗在最上层了;关于闪屏,这边改为第一个空白的dialog置为可见那行代码注释掉,然后自己测试,修改前后预览失败的表现基本一致(修改后无闪屏);另外还修改了一些导包问题
persist/11.0
superman 4 years ago
parent
commit
ac05f54e6a
  1. 4
      designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java
  2. 67
      designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/StoreProcedureDataWrapper.java
  3. 2
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java
  4. 12
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java
  5. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

4
designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java

@ -442,7 +442,7 @@ public class PreviewTablePane extends BasicPane {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
previewTablePane.fireLoadedListener(); previewTablePane.fireLoadedListener();
previewTablePane.showWindow(DesignerContext.getDesignerFrame()).setVisible(true); previewTablePane.showWindow(new JFrame()).setVisible(true);
} }
/** /**
@ -475,7 +475,7 @@ public class PreviewTablePane extends BasicPane {
}; };
prieviewPane.setLayout(FRGUIPaneFactory.createBorderLayout()); prieviewPane.setLayout(FRGUIPaneFactory.createBorderLayout());
prieviewPane.add(tabPreviewpane, BorderLayout.CENTER); prieviewPane.add(tabPreviewpane, BorderLayout.CENTER);
prieviewPane.showWindow(DesignerContext.getDesignerFrame()).setVisible(true); prieviewPane.showWindow(new JFrame()).setVisible(true);
} }
private void populateStoreDataSQL() throws Exception { private void populateStoreDataSQL() throws Exception {

67
designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/StoreProcedureDataWrapper.java

@ -7,17 +7,16 @@ import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.data.operator.DataOperator; import com.fr.data.operator.DataOperator;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.preview.PreviewTablePane; import com.fr.design.data.datapane.preview.PreviewTablePane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.iprogressbar.AutoProgressBar; import com.fr.design.gui.iprogressbar.AutoProgressBar;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JOptionPane; import javax.swing.JFrame;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -50,7 +49,6 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
private AutoProgressBar connectionBar; private AutoProgressBar connectionBar;
private ProcedureDataModel[] dataModels; private ProcedureDataModel[] dataModels;
private SwingWorker worker; private SwingWorker worker;
private BasicDialog dialog;
private int previewModel; private int previewModel;
public StoreProcedureDataWrapper(StoreProcedure storeProcedure, String storeprocedureName, String dsName) { public StoreProcedureDataWrapper(StoreProcedure storeProcedure, String storeprocedureName, String dsName) {
@ -71,19 +69,8 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
if (needLoad) { if (needLoad) {
setWorker(); setWorker();
} }
dialog = PreviewTablePane.getInstance().getDialog(); loadingBar = new AutoProgressBar(new JFrame(), Toolkit.i18nText("Fine-Design_Basic_Loading_Data"), "", 0, 100) {
dialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
getWorker().cancel(true);
}
public void doCancel() {
getWorker().cancel(true);
}
});
loadingBar = new AutoProgressBar(dialog, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Data"), "", 0, 100) {
public void doMonitorCanceled() { public void doMonitorCanceled() {
getDialog().setVisible(false);
getWorker().cancel(true); getWorker().cancel(true);
} }
}; };
@ -93,17 +80,17 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
* 数据集执行结果返回的所有字段 * 数据集执行结果返回的所有字段
* *
* @return 数据集执行结果返回的所有字段 * @return 数据集执行结果返回的所有字段
* *
* *
* @date 2014-12-3-下午7:43:17 * @date 2014-12-3-下午7:43:17
* *
*/ */
public List<String> calculateColumnNameList() { public List<String> calculateColumnNameList() {
if (columnNameList != null) { if (columnNameList != null) {
return columnNameList; return columnNameList;
} }
if (!createStore(false)) { if (!createStore(false)) {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_No_TableData")); FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Engine_No_TableData"));
return new ArrayList<String>(); return new ArrayList<String>();
} }
columnNameList = Arrays.asList(procedureDataModel.getColumnName()); columnNameList = Arrays.asList(procedureDataModel.getColumnName());
@ -114,10 +101,10 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
* 生成子节点 * 生成子节点
* *
* @return 节点数组 * @return 节点数组
* *
* *
* @date 2014-12-3-下午7:06:47 * @date 2014-12-3-下午7:06:47
* *
*/ */
public ExpandMutableTreeNode[] load() { public ExpandMutableTreeNode[] load() {
List<String> namelist; List<String> namelist;
@ -160,25 +147,16 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
/** /**
* 预览数据 * 预览数据
* *
* @param previewModel 预览模式, 全部还是一个 * @param previewModel 预览模式, 全部还是一个
* *
* *
* @date 2014-12-3-下午7:05:50 * @date 2014-12-3-下午7:05:50
* *
*/ */
public void previewData(final int previewModel) { public void previewData(final int previewModel) {
this.previewModel = previewModel; this.previewModel = previewModel;
new SwingWorker() { connectionBar = new AutoProgressBar(new JFrame(), Toolkit.i18nText("Fine-Design_Basic_Utils_Now_Create_Connection"), "", 0, 100) {
protected Object doInBackground() throws Exception {
loadingBar.close();
PreviewTablePane.resetPreviewTable();
dialog.setVisible(true);
return null;
}
}.execute();
connectionBar = new AutoProgressBar(dialog, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Now_Create_Connection"), "", 0, 100) {
public void doMonitorCanceled() { public void doMonitorCanceled() {
connectionBar.close(); connectionBar.close();
worker.cancel(true); worker.cancel(true);
@ -190,13 +168,13 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
private void setWorker() { private void setWorker() {
worker = new SwingWorker<Void, Void>() { worker = new SwingWorker<Void, Void>() {
protected Void doInBackground() throws Exception { protected Void doInBackground() throws Exception {
loadingBar.close();
PreviewTablePane.resetPreviewTable();
connectionBar.start(); connectionBar.start();
boolean status = DataOperator.getInstance().testConnection(((StoreProcedure) getTableData()).getDatabaseConnection()); boolean status = DataOperator.getInstance().testConnection(((StoreProcedure) getTableData()).getDatabaseConnection());
if (!status) { if (!status) {
connectionBar.close(); connectionBar.close();
// bug 61345 预览失败时,关闭窗口 throw new Exception(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"));
dialog.setVisible(false);
throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"));
} }
connectionBar.close(); connectionBar.close();
storeProcedure.resetDataModelList(); storeProcedure.resetDataModelList();
@ -208,7 +186,6 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
try { try {
get(); get();
loadingBar.close(); loadingBar.close();
dialog.setVisible(false);
switch (previewModel) { switch (previewModel) {
case StoreProcedureDataWrapper.PREVIEW_ALL: case StoreProcedureDataWrapper.PREVIEW_ALL:
PreviewTablePane.previewStoreDataWithAllDs(dataModels); PreviewTablePane.previewStoreDataWithAllDs(dataModels);
@ -228,10 +205,6 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
}; };
} }
private BasicDialog getDialog() {
return this.dialog;
}
private SwingWorker getWorker() { private SwingWorker getWorker() {
return this.worker; return this.worker;
} }
@ -240,10 +213,10 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
/** /**
* 预览返回的一个数据集 * 预览返回的一个数据集
* *
* *
* @date 2014-12-3-下午7:42:53 * @date 2014-12-3-下午7:42:53
* *
*/ */
public void previewData() { public void previewData() {
previewData(-1, -1); previewData(-1, -1);
@ -253,13 +226,13 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
/** /**
* 预览返回的一个数据集带有显示值和实际值的标记结果 * 预览返回的一个数据集带有显示值和实际值的标记结果
* *
* @param keyIndex 实际值 * @param keyIndex 实际值
* @param valueIndex 显示值 * @param valueIndex 显示值
* *
* *
* @date 2014-12-3-下午7:42:27 * @date 2014-12-3-下午7:42:27
* *
*/ */
public void previewData(final int keyIndex, final int valueIndex) { public void previewData(final int keyIndex, final int valueIndex) {
PreviewTablePane.previewStoreData(procedureDataModel, keyIndex, valueIndex); PreviewTablePane.previewStoreData(procedureDataModel, keyIndex, valueIndex);

2
designer-base/src/main/java/com/fr/env/RemoteEnvPane.java vendored

@ -332,6 +332,8 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
this.remoteWorkspaceURL = RemoteWorkspaceURL.createDefaultURL(); this.remoteWorkspaceURL = RemoteWorkspaceURL.createDefaultURL();
this.usernameInput.setText(StringUtils.EMPTY); this.usernameInput.setText(StringUtils.EMPTY);
this.passwordInput.setText(StringUtils.EMPTY); this.passwordInput.setText(StringUtils.EMPTY);
this.certPathInput.setText(StringUtils.EMPTY);
this.certSecretKeyInput.setText(StringUtils.EMPTY);
this.rememberPwdCheckbox.setSelected(true); this.rememberPwdCheckbox.setSelected(true);
} }

12
designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java

@ -22,8 +22,16 @@ public class VanChartColumnPlotLabelDetailPane extends VanChartPlotLabelDetailPa
AttrTooltipContent content = detail.getContent(); AttrTooltipContent content = detail.getContent();
UIButtonGroup<Integer> orientation = getOrientation(); UIButtonGroup<Integer> orientation = getOrientation();
if (orientation != null) { if (orientation != null && content != null) {
orientation.setEnabled(content != null && !content.isRichText()); if (content.isRichText()) {
orientation.setSelectedIndex(HORIZONTAL_INDEX);
detail.setHorizontal(true);
orientation.setEnabled(false);
} else {
orientation.setEnabled(true);
}
} }
} }

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

@ -36,7 +36,7 @@ import java.awt.Component;
public class VanChartPlotLabelDetailPane extends BasicPane { public class VanChartPlotLabelDetailPane extends BasicPane {
private static final long serialVersionUID = -22438250307946275L; private static final long serialVersionUID = -22438250307946275L;
private static final int HORIZONTAL_INDEX = 0; public static final int HORIZONTAL_INDEX = 0;
private BasicBeanPane<AttrTooltipContent> dataLabelContentPane; private BasicBeanPane<AttrTooltipContent> dataLabelContentPane;

Loading…
Cancel
Save