Browse Source

Merge branch 'feature/10.0' of https://code.fineres.com/scm/~henry.wang/design into feature/10.0

feature/10.0
Henry.Wang 4 years ago
parent
commit
4a9c49662f
  1. 23
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java
  2. 17
      designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java
  3. 3
      designer-base/src/main/java/com/fr/design/extra/PluginFromStorePane.java
  4. 5
      designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java
  5. 3
      designer-base/src/main/java/com/fr/design/extra/PluginUpdatePane.java
  6. 51
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java
  7. 2
      designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterDialog.java
  8. 2
      designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterPane.java
  9. 3
      designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java
  10. 6
      designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java
  11. BIN
      designer-base/src/main/resources/com/fr/design/images/dashboard/guide.png
  12. 2
      designer-base/src/main/resources/com/fr/design/login/guide.js
  13. 2
      designer-base/src/main/resources/com/fr/design/login/login.js
  14. 4
      designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java
  15. 6
      designer-realize/src/main/java/com/fr/poly/creator/PolyElementCasePane.java
  16. BIN
      designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/smallsearch.png
  17. BIN
      designer-realize/src/main/resources/com/fr/design/mainframe/notificationCenter/normal.png
  18. BIN
      designer-realize/src/main/resources/com/fr/design/mainframe/notificationCenter/notificationCenterDot.png

23
designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java

@ -5,10 +5,10 @@ import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.design.border.UITitledBorder;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
@ -21,17 +21,13 @@ import com.fr.general.ComparatorUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.EncodeConstants;
import com.fr.stable.StringUtils;
import java.awt.event.InputMethodEvent;
import java.awt.event.InputMethodListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.swing.BorderFactory;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
@ -39,13 +35,18 @@ import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputMethodEvent;
import java.awt.event.InputMethodListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.io.File;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class JDBCDefPane extends JPanel {
public static final String DRIVER_TYPE = "driver_type";
@ -291,7 +292,7 @@ public class JDBCDefPane extends JPanel {
jdbcDatabase = new JDBCDatabaseConnection();
}
Object driveItem = this.driverComboBox.getSelectedItem();
jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString());
jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString().trim());
jdbcDatabase.setURL(this.urlTextField.getText().trim());
jdbcDatabase.setUser(this.userNameTextField.getText().trim());
jdbcDatabase.setPassword(new String(this.passwordTextField.getPassword()).trim());

17
designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java vendored

@ -34,11 +34,20 @@ public class RemoteWorkspace implements Workspace {
private volatile Boolean warDeploy;
private final SwingWorker<Void,Void> swingWorker;
RemoteWorkspace(WorkspaceClient client, WorkspaceConnectionInfo connection) {
this.client = client;
this.address = connection.getUrl();
this.connection = connection;
this.swingWorker = new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
client.close();
return null;
}
};
}
@Override
@ -125,13 +134,7 @@ public class RemoteWorkspace implements Workspace {
@Override
public void close() {
new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
client.close();
return null;
}
}.execute();
swingWorker.execute();
}
@Override

3
designer-base/src/main/java/com/fr/design/extra/PluginFromStorePane.java

@ -9,6 +9,7 @@ import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.manage.PluginManager;
import com.fr.plugin.manage.control.PluginExtraInfo;
import com.fr.plugin.manage.control.PluginTaskResult;
import com.fr.plugin.manage.control.ProgressCallback;
import com.fr.plugin.view.PluginView;
@ -206,7 +207,7 @@ public class PluginFromStorePane extends PluginAbstractLoadingViewPane<List<Plug
JSONObject latestPluginInfo = PluginUtils.getLatestPluginInfo(id);
String latestPluginVersion = (String) latestPluginInfo.get("version");
PluginMarker toPluginMarker = PluginMarker.create(id, latestPluginVersion);
PluginManager.getController().download(pluginMarker, new UpdateOnlineCallback(pluginMarker, toPluginMarker, pane));
PluginManager.getController().download(pluginMarker, new UpdateOnlineCallback(pluginMarker, toPluginMarker, pane), PluginExtraInfo.newBuilder().username(DesignerEnvManager.getEnvManager().getDesignerLoginUsername()).build());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}

5
designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java

@ -20,6 +20,7 @@ import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.context.PluginMarkerAdapter;
import com.fr.plugin.manage.PluginManager;
import com.fr.plugin.manage.control.PluginControllerHelper;
import com.fr.plugin.manage.control.PluginExtraInfo;
import com.fr.plugin.manage.control.PluginTask;
import com.fr.plugin.manage.control.PluginTaskCallback;
import com.fr.plugin.manage.control.PluginTaskResult;
@ -42,7 +43,7 @@ public class PluginOperateUtils {
PluginMarker marker = updateMarker2Online(pluginMarker);
//下载插件
PluginTask pluginTask = PluginTask.installTask(marker);
PluginControllerHelper.installOnline(pluginMarker, new InstallOnlineCallback(pluginTask, jsCallback));
PluginControllerHelper.installOnline(pluginMarker, new InstallOnlineCallback(pluginTask, jsCallback), PluginExtraInfo.newBuilder().username(DesignerEnvManager.getEnvManager().getDesignerLoginUsername()).build());
}
public static PluginMarker updateMarker2Online(PluginMarker pluginMarker) {
@ -76,7 +77,7 @@ public class PluginOperateUtils {
//当前已经安装的相同ID插件marker
PluginMarker currentMarker = PluginMarkerAdapter.create(PluginUtils.getInstalledPluginMarkerByID(pluginMarker.getPluginID()), pluginName);
PluginTask pluginTask = PluginTask.updateTask(currentMarker, toPluginMarker);
PluginControllerHelper.updateOnline(currentMarker, toPluginMarker, new UpdateOnlineCallback(pluginTask, jsCallback));
PluginControllerHelper.updateOnline(currentMarker, toPluginMarker, new UpdateOnlineCallback(pluginTask, jsCallback), PluginExtraInfo.newBuilder().username(DesignerEnvManager.getEnvManager().getDesignerLoginUsername()).build());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}

3
designer-base/src/main/java/com/fr/design/extra/PluginUpdatePane.java

@ -9,6 +9,7 @@ import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.manage.PluginManager;
import com.fr.plugin.manage.control.PluginExtraInfo;
import com.fr.plugin.manage.control.PluginTaskResult;
import com.fr.plugin.manage.control.ProgressCallback;
import com.fr.plugin.view.PluginView;
@ -180,7 +181,7 @@ public class PluginUpdatePane extends PluginAbstractLoadingViewPane<List<PluginV
JSONObject latestPluginInfo = PluginUtils.getLatestPluginInfo(pluginMarker.getPluginID());
String latestPluginVersion = (String) latestPluginInfo.get("version");
PluginMarker toPluginMarker = PluginMarker.create(pluginMarker.getPluginID(), latestPluginVersion);
PluginManager.getController().download(pluginMarker, new UpdateOnlineCallback(pluginMarker, toPluginMarker, pane));
PluginManager.getController().download(pluginMarker, new UpdateOnlineCallback(pluginMarker, toPluginMarker, pane), PluginExtraInfo.newBuilder().username(DesignerEnvManager.getEnvManager().getDesignerLoginUsername()).build());
} catch (Exception e) {
}

51
designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java

@ -7,12 +7,12 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ilist.JNameEdList;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.gui.ilist.ModNameActionListener;
import com.fr.design.gui.ilist.UIList;
import com.fr.design.gui.ilist.UINameEdList;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.widget.EventCreator;
import com.fr.form.event.Listener;
import com.fr.form.ui.Widget;
import com.fr.general.FRFont;
import com.fr.general.NameObject;
import com.fr.report.web.util.ReportEngineEventMapping;
import com.fr.stable.ArrayUtils;
@ -22,6 +22,7 @@ import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.DefaultListModel;
import javax.swing.JPanel;
import javax.swing.ListModel;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
@ -32,6 +33,7 @@ import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.MouseAdapter;
@ -47,7 +49,7 @@ import java.util.Map;
/**
* Created by kerry on 5/31/21
*/
public abstract class UIListGroupControlPane extends UIControlPane implements ListControlPaneProvider {
public abstract class UIListGroupControlPane extends UIControlPane implements ListControlPaneProvider {
private boolean isPopulating = false;
private UINameEdList selectNameEdList;
@ -142,6 +144,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements L
}
this.checkButtonEnabled();
refreshEventListWrapperPane();
this.checkGroupPaneSize();
isPopulating = false;
}
@ -209,6 +212,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements L
nameEdList.addModNameActionListener(new ModNameActionListener() {
@Override
public void nameModed(int index, String oldName, String newName) {
checkGroupPaneSize();
saveSettings();
}
});
@ -262,7 +266,6 @@ public abstract class UIListGroupControlPane extends UIControlPane implements L
}
private String switchLang(String eventName) {
// 在 properties 文件中找到相应的 key 值
String localeKey = ReportEngineEventMapping.getLocaleName(eventName);
@ -270,7 +273,6 @@ public abstract class UIListGroupControlPane extends UIControlPane implements L
}
/**
* 生成不重复的名字
*
@ -300,19 +302,60 @@ public abstract class UIListGroupControlPane extends UIControlPane implements L
public void onAddItem(NameableCreator creator) {
updateSelectedNameList(creator);
getCommonHandlers().onAddItem(creator);
checkGroupPaneSize();
}
@Override
public void onRemoveItem() {
getCommonHandlers().onRemoveItem();
refreshEventListWrapperPane();
checkGroupPaneSize();
}
@Override
public void onCopyItem() {
getCommonHandlers().onCopyItem();
checkGroupPaneSize();
}
private void checkGroupPaneSize() {
int width = 180;
Iterator<Map.Entry<String, ListWrapperPane>> iterator = nameEdListMap.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<String, ListWrapperPane> entry = iterator.next();
ListWrapperPane wrapperPane = entry.getValue();
UIList uiList = wrapperPane.getNameEdList();
width = Math.max(width, calculateUIListMaxCellWidth(uiList.getModel(), uiList.getFontMetrics(uiList.getFont())));
}
iterator = nameEdListMap.entrySet().iterator();
width += 40;
while (iterator.hasNext()) {
Map.Entry<String, ListWrapperPane> entry = iterator.next();
ListWrapperPane wrapperPane = entry.getValue();
UIList uiList = wrapperPane.getNameEdList();
uiList.setFixedCellWidth(width);
}
}
private int calculateUIListMaxCellWidth(ListModel model, FontMetrics fontMetrics) {
int width = 0;
for (int i = 0; i < model.getSize(); i++) {
Object element = model.getElementAt(i);
if (element != null) {
String text;
if (element instanceof ListModelElement) {
text = ((ListModelElement) element).wrapper.getName();
} else {
text = element.toString();
}
width = Math.max(width, fontMetrics.stringWidth(text));
}
}
return width;
}
@Override
public void onMoveUpItem() {
getCommonHandlers().onMoveUpItem();

2
designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterDialog.java

@ -147,7 +147,7 @@ public class NotificationCenterDialog extends JDialog {
deleteLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_Notifications") + "(" + NotificationCenter.getInstance().getNotificationsCount() + ")");
pack();
if (notificationNeedShow.size() == 0) {
centerWindow();
hideDialog();
}
NotificationCenterPane.getNotificationCenterPane().refreshButton();
}

2
designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterPane.java

@ -41,7 +41,7 @@ public class NotificationCenterPane extends BasicPane {
public void refreshButton() {
if (NotificationCenter.getInstance().getNotificationsCount() > 0) {
notificationCenterButton.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/notificationcenter/normal.png"));
notificationCenterButton.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/notificationcenter/notificationCenterDot.png"));
} else {
notificationCenterButton.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/notificationcenter/notificationCenter.png"));
}

3
designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java

@ -22,6 +22,7 @@ import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.manage.PluginManager;
import com.fr.plugin.manage.control.PluginControllerHelper;
import com.fr.plugin.manage.control.PluginExtraInfo;
import com.fr.plugin.manage.control.PluginTaskCallback;
import com.fr.plugin.manage.control.PluginTaskResult;
import com.fr.plugin.manage.control.ProgressCallback;
@ -345,7 +346,7 @@ public class VersionCheckUtils {
FineLoggerFactory.getLogger().info("installPlugin: " + result.getCurrentTask().getMarker().getPluginID());
}
}
});
}, PluginExtraInfo.newBuilder().username(DesignerEnvManager.getEnvManager().getDesignerLoginUsername()).build());
}
try {
latch.await();

6
designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java vendored

@ -18,7 +18,6 @@ import com.fr.json.JSONObject;
import com.fr.stable.StringUtils;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
@ -138,9 +137,14 @@ public class SyncFailedPluginsDialog extends JDialog {
return !restartButton.isEnabled();
}
private void hideDialog(){
this.dispose();
}
private MouseListener restartButtonClickListener = new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
hideDialog();
restartButton.setEnabled(false);
restartHelper.restartForUpdate(frame);
}

BIN
designer-base/src/main/resources/com/fr/design/images/dashboard/guide.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 KiB

After

Width:  |  Height:  |  Size: 308 KiB

2
designer-base/src/main/resources/com/fr/design/login/guide.js

File diff suppressed because one or more lines are too long

2
designer-base/src/main/resources/com/fr/design/login/login.js

File diff suppressed because one or more lines are too long

4
designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.app;
import com.fr.design.DesignerEnvManager;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.UIExpandDialog;
import com.fr.design.extra.exe.callback.InstallOnlineCallback;
@ -13,6 +14,7 @@ import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.context.PluginMarkerAdapter;
import com.fr.plugin.manage.PluginManager;
import com.fr.plugin.manage.control.PluginControllerHelper;
import com.fr.plugin.manage.control.PluginExtraInfo;
import com.fr.plugin.manage.control.PluginTask;
import com.fr.stable.StringUtils;
import com.fr.stable.TemplateIOErrorContextHolder;
@ -198,7 +200,7 @@ public class DesignerAppUtils {
Collection<PluginMarkerAdapter> uninstallPlugins = stringPluginMarkerAdapterMultimap.get(TemplateIOErrorContextHolder.NOT_INSTALLED_PLUGIN);
for (PluginMarker uninstallPlugin : uninstallPlugins) {
PluginTask pluginTask = PluginTask.installTask(uninstallPlugin);
PluginControllerHelper.installOnline(uninstallPlugin, new InstallOnlineCallback(pluginTask));
PluginControllerHelper.installOnline(uninstallPlugin, new InstallOnlineCallback(pluginTask), PluginExtraInfo.newBuilder().username(DesignerEnvManager.getEnvManager().getDesignerLoginUsername()).build());
}
}
}

6
designer-realize/src/main/java/com/fr/poly/creator/PolyElementCasePane.java

@ -13,12 +13,18 @@ import com.fr.report.poly.PolyECBlock;
*/
public abstract class PolyElementCasePane extends ElementCasePane<PolyECBlock> {
/**
* 水平方向在一个屏幕内可见的可扩展的列数
*/
private static final int HORIZONTAL_EXTENT_VALUE = 200;
public PolyElementCasePane(PolyECBlock block) {
super(block);
setSelection(new CellSelection(0, 0, 1, 1));
// 都不加这两个组件,当然他们也就没可见性了
setHorizontalScrollBarVisible(false);
setVerticalScrollBarVisible(false);
this.getGrid().setHorizontalExtent(HORIZONTAL_EXTENT_VALUE);
}
@Override

BIN
designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/smallsearch.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 B

After

Width:  |  Height:  |  Size: 546 B

BIN
designer-realize/src/main/resources/com/fr/design/mainframe/notificationCenter/normal.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 B

BIN
designer-realize/src/main/resources/com/fr/design/mainframe/notificationCenter/notificationCenterDot.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

Loading…
Cancel
Save