Browse Source

Merge branch 'release/11.0' of https://code.fineres.com/scm/~lucian.chen/design into release/11.0

bugfix/11.0
lucian 3 years ago
parent
commit
e6f8169b22
  1. 14
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java
  2. 2
      designer-base/src/main/java/com/fr/design/gui/style/ReportBackgroundSpecialPane.java
  3. 2
      designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java
  4. 11
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  5. 9
      designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java
  6. 42
      designer-base/src/main/java/com/fr/design/startup/Install4jStartupNotificationProvider.java
  7. 4
      designer-base/src/main/java/com/fr/design/style/color/ColorCell.java
  8. 13
      designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java
  9. 12
      designer-base/src/main/java/com/fr/design/utils/TemplateUtils.java
  10. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithThemeStyle.java
  11. 3
      designer-realize/src/main/java/com/fr/design/webattr/WriteWebSettingPane.java

14
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java

@ -10,11 +10,10 @@ import com.fr.design.editlock.EditLockUtils;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UILockButton; import com.fr.design.gui.ibutton.UILockButton;
import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionConfig;
import com.fr.general.ComparatorUtils; import com.fr.report.LockItem;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.server.connection.DBConnectAuth; import com.fr.workspace.server.connection.DBConnectAuth;
import com.fr.report.LockItem;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import java.awt.Dimension; import java.awt.Dimension;
@ -96,6 +95,7 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
continue; continue;
} }
Connection connection = mgr.getConnection(conName); Connection connection = mgr.getConnection(conName);
// nameList依赖items方法初始化,父类ItemEditableComboBoxPanel里异步执行item方法
filterConnection(connection, conName, nameList); filterConnection(connection, conName, nameList);
} }
@ -140,12 +140,10 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
} else { } else {
String s = DesignerEnvManager.getEnvManager().getRecentSelectedConnection(); String s = DesignerEnvManager.getEnvManager().getRecentSelectedConnection();
if (StringUtils.isNotBlank(s)) { if (StringUtils.isNotBlank(s)) {
for (int i = 0; i < this.getConnectionSize(); i++) { // 之前的写法有多线程问题,nameList异步尚未初始化完成的时候,这里可能无法匹配设置数据连接名称,导致DBTableDataPane打开后连接面板空白
String t = this.getConnection(i); // 这里的需求无非是设置上一次使用的数据连接,做个简单检查这个连接是否存在即可,存在就设置
if (ComparatorUtils.equals(s, t)) { if (ConnectionConfig.getInstance().getConnection(s) != null) {
this.setSelectedItem(s); this.setSelectedItem(s);
break;
}
} }
} }
// alex:如果这个ComboBox还是没有选中,那么选中第一个 // alex:如果这个ComboBox还是没有选中,那么选中第一个

2
designer-base/src/main/java/com/fr/design/gui/style/ReportBackgroundSpecialPane.java

@ -29,7 +29,7 @@ public class ReportBackgroundSpecialPane extends BackgroundPane {
protected BackgroundQuickPane[] supportKindsOfBackgroundUI() { protected BackgroundQuickPane[] supportKindsOfBackgroundUI() {
NullBackgroundQuickPane nullBackgroundPane = new NullBackgroundQuickPane(); NullBackgroundQuickPane nullBackgroundPane = new NullBackgroundQuickPane();
ColorBackgroundQuickPane colorBackgroundPane = new ColorBackgroundQuickPane(); ColorBackgroundQuickPane colorBackgroundPane = new ColorBackgroundQuickPane(true);
colorBackgroundPane.registerChangeListener(new UIObserverListener() { colorBackgroundPane.registerChangeListener(new UIObserverListener() {
@Override @Override
public void doChange() { public void doChange() {

2
designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java

@ -42,7 +42,7 @@ public abstract class JavaScriptActionPane extends UIComboBoxPane<JavaScript> {
protected List<FurtherBasicBeanPane<? extends JavaScript>> initPaneList() { protected List<FurtherBasicBeanPane<? extends JavaScript>> initPaneList() {
List<FurtherBasicBeanPane<? extends JavaScript>> paneList = new ArrayList<FurtherBasicBeanPane<? extends JavaScript>>(); List<FurtherBasicBeanPane<? extends JavaScript>> paneList = new ArrayList<FurtherBasicBeanPane<? extends JavaScript>>();
// JS脚本,表单提交,提交入库,流程管理,发送邮件. 703中去掉表单提交和流程管理 // JS脚本,表单提交,提交入库,流程管理,发送邮件. 703中去掉表单提交和流程管理
paneList.add(new JavaScriptImplPane(getDefaultArgs())); paneList.add(new JavaScriptImplPane(getDefaultArgs(),true));
// paneList.add(new FormSubmitJavaScriptPane(this)); // paneList.add(new FormSubmitJavaScriptPane(this));
contentDBManiPane = new ArrayList(); contentDBManiPane = new ArrayList();
contentDBManiPane.add(createDBManipulationPane()); contentDBManiPane.add(createDBManipulationPane());

11
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -1016,6 +1016,17 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
} }
} }
public byte[] exportData() throws Exception {
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
BaseBook target = getTarget();
if (target != null) {
target.export(outputStream);
return outputStream.toByteArray();
}
}
return new byte[0];
}
protected boolean export() throws Exception { protected boolean export() throws Exception {
return this.getTarget().export(TemplateResourceManager.getResource().saveTemplate(getEditingFILE())); return this.getTarget().export(TemplateResourceManager.getResource().saveTemplate(getEditingFILE()));

9
designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java

@ -16,10 +16,9 @@ public class ColorBackgroundQuickPane extends BackgroundQuickPane {
private NewColorSelectBox colorSelectBox; private NewColorSelectBox colorSelectBox;
public ColorBackgroundQuickPane(boolean supportTransparent) {
public ColorBackgroundQuickPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
colorSelectBox = new NewColorSelectBox(100) { colorSelectBox = new NewColorSelectBox(100, supportTransparent) {
@Override @Override
public boolean shouldResponseChangeListener() { public boolean shouldResponseChangeListener() {
// ColorBackgroundQuickPane注册监听器ChangeListenerImpl的逻辑不能丢,因为里面有修改字段backgroundChange的逻辑. // ColorBackgroundQuickPane注册监听器ChangeListenerImpl的逻辑不能丢,因为里面有修改字段backgroundChange的逻辑.
@ -33,6 +32,10 @@ public class ColorBackgroundQuickPane extends BackgroundQuickPane {
this.add(colorSelectBox, BorderLayout.NORTH); this.add(colorSelectBox, BorderLayout.NORTH);
} }
public ColorBackgroundQuickPane() {
this(false);
}
public void populateBean(Background background) { public void populateBean(Background background) {
ColorBackground colorBackgroud = (ColorBackground) background; ColorBackground colorBackgroud = (ColorBackground) background;
populateColor(colorBackgroud.getColor()); populateColor(colorBackgroud.getColor());

42
designer-base/src/main/java/com/fr/design/startup/Install4jStartupNotificationProvider.java

@ -1,6 +1,10 @@
package com.fr.design.startup; package com.fr.design.startup;
import com.install4j.api.launcher.StartupNotification; import com.fr.invoke.Reflect;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
/** /**
* @author Starryi * @author Starryi
@ -18,18 +22,30 @@ public class Install4jStartupNotificationProvider implements FineStartupNotifica
@Override @Override
public void registerStartupListener(Listener listener) { public void registerStartupListener(Listener listener) {
boolean supported = false; Class<?> StartupNotificationListenerClass = Reflect.on("com.install4j.api.launcher.StartupNotification$Listener").type();
try { if (StartupNotificationListenerClass == null) {
supported = Class.forName("com.install4j.api.launcher.StartupNotification") != null; return;
} catch (Throwable ignored) {} }
if (supported) { ListenerHandler mHandler = new ListenerHandler(listener);
StartupNotification.registerStartupListener(new StartupNotification.Listener() { Object listenerCallbackInstance = Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] { StartupNotificationListenerClass }, mHandler);
@Override Reflect.on("com.install4j.api.launcher.StartupNotification").call("registerStartupListener", listenerCallbackInstance);
public void startupPerformed(String parameters) { }
listener.startupPerformed(parameters);
} private static class ListenerHandler implements InvocationHandler {
}); private final Listener listener;
public ListenerHandler(Listener listener) {
this.listener = listener;
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (args[0] instanceof String) {
String parameters = (String) args[0];
listener.startupPerformed(parameters);
}
return null;
} }
} }
} }

4
designer-base/src/main/java/com/fr/design/style/color/ColorCell.java

@ -100,11 +100,13 @@ public class ColorCell extends JComponent implements ColorSelectable {
if (e == null || e.getID() == MouseEvent.MOUSE_RELEASED) { if (e == null || e.getID() == MouseEvent.MOUSE_RELEASED) {
colorSelectable.setColor(this.getColor()); colorSelectable.setColor(this.getColor());
colorSelectable.colorSetted(this); // 先添加最近使用
if (this.getColor() != null) { if (this.getColor() != null) {
int rgb = this.getColor().getRGB(); int rgb = this.getColor().getRGB();
DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(new Color(rgb)); DesignerEnvManager.getEnvManager().getColorConfigManager().addToColorQueue(new Color(rgb));
} }
// 这边会获取到最近使用颜色并更新 添加逻辑需要放到前面 否则不会及时更新
colorSelectable.colorSetted(this);
} }
if (e != null) { if (e != null) {

13
designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java

@ -20,13 +20,20 @@ public class NewColorSelectBox extends AbstractSelectBox<Color> implements UIObs
private static final long serialVersionUID = 2782150678943960557L; private static final long serialVersionUID = 2782150678943960557L;
private Color color; private Color color;
private NewColorSelectPane colorPane = new NewColorSelectPane(false); private NewColorSelectPane colorPane;
private UIObserverListener uiObserverListener; private UIObserverListener uiObserverListener;
private String newColorSelectBoxName = ""; private String newColorSelectBoxName = "";
private GlobalNameListener globalNameListener = null; private GlobalNameListener globalNameListener = null;
private boolean supportTransparent;
public NewColorSelectBox(int preferredWidth) { public NewColorSelectBox(int preferredWidth) {
initBox(preferredWidth); this(preferredWidth, false);
}
public NewColorSelectBox(int preferredWidth, boolean supportTransparent) {
this.colorPane = new NewColorSelectPane(supportTransparent);
this.supportTransparent = supportTransparent;
initBox(preferredWidth);
iniListener(); iniListener();
} }
@ -58,7 +65,7 @@ public class NewColorSelectBox extends AbstractSelectBox<Color> implements UIObs
*/ */
public JPanel initWindowPane(double preferredWidth) { public JPanel initWindowPane(double preferredWidth) {
// 下拉的时候重新生成面板,以刷新最近使用颜色 // 下拉的时候重新生成面板,以刷新最近使用颜色
colorPane = new NewColorSelectPane(false); colorPane = new NewColorSelectPane(this.supportTransparent);
colorPane.setColor(this.getSelectObject()); colorPane.setColor(this.getSelectObject());
colorPane.addChangeListener(new ChangeListener() { colorPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {

12
designer-base/src/main/java/com/fr/design/utils/TemplateUtils.java

@ -1,7 +1,6 @@
package com.fr.design.utils; package com.fr.design.utils;
import com.fr.base.extension.FileExtension; import com.fr.base.extension.FileExtension;
import com.fr.base.io.BaseBook;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.TemplateTreePane; import com.fr.design.file.TemplateTreePane;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
@ -17,9 +16,9 @@ import com.fr.stable.CoreConstants;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.server.lock.TplOperator; import com.fr.workspace.server.lock.TplOperator;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import java.io.OutputStream;
/** /**
* @author hades * @author hades
@ -65,12 +64,7 @@ public class TemplateUtils {
if (!needOpen) { if (!needOpen) {
// 从当前编辑模板中生成备份文件 // 从当前编辑模板中生成备份文件
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); content = template.exportData();
BaseBook target = template.getTarget();
if (target != null) {
target.export(outputStream);
content = outputStream.toByteArray();
}
} else { } else {
content = WorkContext.getWorkResource().readFully(oldPath); content = WorkContext.getWorkResource().readFully(oldPath);
} }

2
designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithThemeStyle.java

@ -25,7 +25,7 @@ public class VanChartBackgroundPaneWithThemeStyle extends VanChartBackgroundPane
} }
}); });
paneList.add(new NullBackgroundQuickPane()); paneList.add(new NullBackgroundQuickPane());
paneList.add(new ColorBackgroundQuickPane()); paneList.add(new ColorBackgroundQuickPane(true));
paneList.add(new ImageBackgroundQuickPane(false)); paneList.add(new ImageBackgroundQuickPane(false));
paneList.add(new VanChartGradientPane()); paneList.add(new VanChartGradientPane());
} }

3
designer-realize/src/main/java/com/fr/design/webattr/WriteWebSettingPane.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UINoThemeColorButton;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
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;
@ -44,7 +45,7 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
protected JPanel createOtherSetPane() { protected JPanel createOtherSetPane() {
colorBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Background_Of_Current_Row") + ":"); colorBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Background_Of_Current_Row") + ":");
colorBox.setSelected(true); colorBox.setSelected(true);
colorButton = new UIColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/background.png")); colorButton = new UINoThemeColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/background.png"));
colorBox.addActionListener(new ActionListener() { colorBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
colorButton.setEnabled(colorBox.isSelected()); colorButton.setEnabled(colorBox.isSelected());

Loading…
Cancel
Save