Browse Source

Pull request #4609: 无jira任务,合代码冲突

Merge in DESIGN/design from ~PENGDA/design:feature/big-screen to feature/big-screen

* commit '8426be5860d117972f2d128198d8b94bde88bb34':
  REPORT-51958 远程环境检测及同步
  fix
  CHART-19525 富文本编辑框设置为可调整
  修改延迟时间
  REPORT-51360 设计器消息提醒
  REPORT-53706 关闭按钮样式调整
  REPORT-51958 远程环境检测及同步
  REPORT-51958 远程环境检测及同步
  REPORT-51958 远程环境检测及同步
  REPORT-53806【组件复用】组件生成时,数据集查询的数据集变成了内置数据集,而不是保留查询
feature/big-screen
ju|剧浩宇 3 years ago
parent
commit
daa50294bf
  1. 5
      designer-base/src/main/java/com/fr/design/dialog/NotificationDialog.java
  2. 17
      designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java
  3. 1
      designer-base/src/main/java/com/fr/design/gui/UILookAndFeel.java
  4. 120
      designer-base/src/main/java/com/fr/design/login/message/DesignerMessageHelper.java
  5. 69
      designer-base/src/main/java/com/fr/design/login/message/DesignerModuleClickType.java
  6. 31
      designer-base/src/main/java/com/fr/design/login/message/NotificationJumpType.java
  7. 333
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  8. 4
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  9. 40
      designer-base/src/main/java/com/fr/design/notification/Notification.java
  10. 42
      designer-base/src/main/java/com/fr/design/notification/NotificationCenter.java
  11. 222
      designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterDialog.java
  12. 54
      designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterPane.java
  13. 14
      designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java
  14. 5
      designer-base/src/main/java/com/fr/env/CheckServiceDialog.java
  15. 6
      designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java
  16. BIN
      designer-base/src/main/resources/com/fr/design/images/lookandfeel/deleteIcon.png
  17. 11
      designer-base/src/main/resources/com/fr/design/login/guide.css
  18. 2
      designer-base/src/main/resources/com/fr/design/login/guide.js
  19. BIN
      designer-base/src/main/resources/com/fr/design/login/img/icon_install_normal.png
  20. 44
      designer-base/src/main/resources/com/fr/design/login/login.css
  21. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java
  22. 14
      designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentCreator.java
  23. 5
      designer-realize/src/main/java/com/fr/start/MainDesigner.java
  24. 2
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
  25. BIN
      designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/smallsearch.png
  26. BIN
      designer-realize/src/main/resources/com/fr/design/mainframe/notificationCenter/notificationCenter.png
  27. BIN
      designer-realize/src/main/resources/com/fr/design/mainframe/notificationCenter/notificationCenterDot.png

5
designer-base/src/main/java/com/fr/design/dialog/NotificationDialog.java

@ -4,6 +4,8 @@ package com.fr.design.dialog;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.notification.Notification;
import com.fr.design.notification.NotificationCenter;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
@ -46,6 +48,7 @@ public class NotificationDialog extends JDialog {
} }
public void initComponents(int messageType, String message, boolean isModal,NotificationDialogAction action) { public void initComponents(int messageType, String message, boolean isModal,NotificationDialogAction action) {
NotificationCenter.getInstance().addNotification(new Notification(messageType,message,action));
notificationDialogAction = action; notificationDialogAction = action;
setModal(isModal); setModal(isModal);
setResizable(false); setResizable(false);
@ -116,7 +119,7 @@ public class NotificationDialog extends JDialog {
propertyName = "OptionPane.newMessageIcon"; propertyName = "OptionPane.newMessageIcon";
break; break;
case 2: case 2:
propertyName = "OptionPane.warningIcon"; propertyName = "OptionPane.circularWarningIcon";
break; break;
default: default:
return null; return null;

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

1
designer-base/src/main/java/com/fr/design/gui/UILookAndFeel.java

@ -179,6 +179,7 @@ public class UILookAndFeel extends MetalLookAndFeel {
table.put("OptionPane.circularWarningIcon", loadIcon("circularWarningIcon.png", this)); table.put("OptionPane.circularWarningIcon", loadIcon("circularWarningIcon.png", this));
table.put("OptionPane.newMessageIcon", loadIcon("newMessageIcon.png", this)); table.put("OptionPane.newMessageIcon", loadIcon("newMessageIcon.png", this));
table.put("OptionPane.circularErrorIcon", loadIcon("circularErrorIcon.png", this)); table.put("OptionPane.circularErrorIcon", loadIcon("circularErrorIcon.png", this));
table.put("OptionPane.deleteIcon", loadIcon("deleteIcon.png", this));
table.put("OptionPane.questionIcon", loadIcon("QuestionIcon.png", this)); table.put("OptionPane.questionIcon", loadIcon("QuestionIcon.png", this));
table.put("OptionPane.tipIcon", loadIcon("TipIcon.png", this)); table.put("OptionPane.tipIcon", loadIcon("TipIcon.png", this));
table.put("ScrollPane.border", new UIScrollPaneBorder()); table.put("ScrollPane.border", new UIScrollPaneBorder());

120
designer-base/src/main/java/com/fr/design/login/message/DesignerMessageHelper.java

@ -0,0 +1,120 @@
package com.fr.design.login.message;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.DesignerEnvManager;
import com.fr.design.dialog.NotificationDialog;
import com.fr.design.dialog.NotificationDialogAction;
import com.fr.design.event.DesignerOpenedListener;
import com.fr.design.login.utils.DesignerLoginUtils;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.BrowseUtils;
import com.fr.general.CloudCenter;
import com.fr.general.http.HttpToolbox;
import com.fr.json.JSON;
import com.fr.json.JSONFactory;
import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
/**
* @author Lanlan
* @version 10.0
* Created by Lanlan on 2021/6/11
*/
public class DesignerMessageHelper {
private static final long DELAY = 7L;
private static final String STATUS = "status";
private static final String DATA = "data";
private static final String SUCCESS = "success";
private static final String MESSAGE_ID = "messageId";
private static final String TITLE = "title";
private static final String BODY = "body";
private static final String JUMP_TYPE = "jumpType";
private static final String JUMP_TO = "jumpTo";
private static DesignerMessageHelper instance;
private DesignerMessageHelper() {
}
public static DesignerMessageHelper getInstance() {
if (instance == null) {
instance = new DesignerMessageHelper();
}
return instance;
}
public void prepareShowMessage() {
DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() {
@Override
public void designerOpened() {
ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("DesignerMessageHelper"));
service.schedule(new Runnable() {
@Override
public void run() {
try {
pullLatestMessageAndShow();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}, DELAY, TimeUnit.MINUTES);
service.shutdown();
}
});
}
private void pullLatestMessageAndShow() throws Exception {
String url = CloudCenter.getInstance().acquireUrlByKind("designer.message.push", "https://market.fanruan.com/api/v1/message/designer");
Map<String, String> params = new HashMap<>();
params.put("designerId", DesignerEnvManager.getEnvManager().getUUID());
String result = HttpToolbox.post(url, params);
JSONObject response = JSONFactory.createJSON(JSON.OBJECT, result);
String status = response.optString(STATUS);
if (SUCCESS.equals(status)) {
JSONObject data = response.optJSONObject(DATA);
String messageId = data.optString(MESSAGE_ID);
String title = data.optString(TITLE);
String body = data.optString(BODY);
int jumpType = data.optInt(JUMP_TYPE);
String jumpTo = data.optString(JUMP_TO);
if (StringUtils.isNotEmpty(messageId) && StringUtils.isNotEmpty(title) && StringUtils.isNotEmpty(body) && jumpType > 0 && StringUtils.isNotEmpty(jumpTo)) {
NotificationJumpType notificationJumpType = NotificationJumpType.valueOf(jumpType);
if (notificationJumpType == NotificationJumpType.WEB_URL) {
NotificationDialog.Builder()
.owner(DesignerContext.getDesignerFrame())
.title(title)
.modal(true)
.messageType(NotificationDialog.NEW_MESSAGE)
.message(body)
.notificationDialogAction(new NotificationDialogAction() {
@Override
public void doClick() {
String ssoUrl = DesignerLoginUtils.generateDesignerSSOUrl(jumpTo);
BrowseUtils.browser(ssoUrl);
}
})
.build()
.setVisible(true);
} else if (notificationJumpType == NotificationJumpType.DESIGNER_MODULE) {
DesignerModuleClickType designerModuleClickType = DesignerModuleClickType.valueOf(jumpTo);
NotificationDialog.Builder()
.owner(DesignerContext.getDesignerFrame())
.title(title)
.modal(true)
.messageType(NotificationDialog.NEW_MESSAGE)
.message(body)
.notificationDialogAction(designerModuleClickType.getAction())
.build()
.setVisible(true);
}
}
}
}
}

69
designer-base/src/main/java/com/fr/design/login/message/DesignerModuleClickType.java

@ -0,0 +1,69 @@
package com.fr.design.login.message;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.dialog.NotificationDialogAction;
import com.fr.design.extra.WebViewDlgHelper;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.upm.UpmFinder;
import com.fr.design.utils.DesignUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import com.fr.stable.os.Arch;
import com.fr.stable.os.OperatingSystem;
/**
* @author Lanlan
* @version 10.0
* Created by Lanlan on 2021/6/11
*/
public enum DesignerModuleClickType {
PLUGIN("PLUGIN", new NotificationDialogAction() {
@Override
public void doClick() {
try {
if (Arch.getArch() == Arch.ARM || OperatingSystem.isLinux() || SupportOSImpl.MACOS_WEB_PLUGIN_MANAGEMENT.support()) {
DesignUtils.visitEnvServerByParameters("#management/plugin", null, null);
return;
}
if (ServerPreferenceConfig.getInstance().isUseOptimizedUPM() || SupportOSImpl.MACOS_NEW_PLUGIN_MANAGEMENT.support()) {
UpmFinder.showUPMDialog();
} else {
WebViewDlgHelper.createPluginDialog();
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}),
REUSE("REUSE", new NotificationDialogAction() {
@Override
public void doClick() {
try {
// TODO
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}),
UNKNOWN(StringUtils.EMPTY, new NotificationDialogAction() {
@Override
public void doClick() {
}
});
private String jumpTo;
private NotificationDialogAction action;
DesignerModuleClickType(String jumpTo, NotificationDialogAction action) {
this.jumpTo = jumpTo;
this.action = action;
}
public String getJumpTo() {
return jumpTo;
}
public NotificationDialogAction getAction() {
return action;
}
}

31
designer-base/src/main/java/com/fr/design/login/message/NotificationJumpType.java

@ -0,0 +1,31 @@
package com.fr.design.login.message;
/**
* @author Lanlan
* @version 10.0
* Created by Lanlan on 2021/6/11
*/
public enum NotificationJumpType {
WEB_URL(1),
DESIGNER_MODULE(2),
UNKNOWN(-1);
private int jumpType;
NotificationJumpType(int jumpType) {
this.jumpType = jumpType;
}
public int getJumpType() {
return jumpType;
}
public static NotificationJumpType valueOf(int jumpType) {
for(NotificationJumpType value : NotificationJumpType.values()) {
if(value.getJumpType() == jumpType) {
return value;
}
}
return UNKNOWN;
}
}

333
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -6,6 +6,7 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.chart.exception.ChartNotFoundException; import com.fr.base.chart.exception.ChartNotFoundException;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
@ -21,16 +22,24 @@ import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.MutilTempalteTabPane; import com.fr.design.file.MutilTempalteTabPane;
import com.fr.design.file.NewTemplatePane;
import com.fr.design.file.SaveSomeTemplatePane; import com.fr.design.file.SaveSomeTemplatePane;
import com.fr.design.file.TemplateTreePane; import com.fr.design.file.TemplateTreePane;
import com.fr.design.fun.OemProcessor; import com.fr.design.fun.OemProcessor;
import com.fr.design.fun.TitlePlaceProcessor;
import com.fr.design.fun.impl.AbstractTemplateTreeShortCutProvider; import com.fr.design.fun.impl.AbstractTemplateTreeShortCutProvider;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenu.UIMenuHighLight;
import com.fr.design.gui.iprogressbar.ProgressDialog; import com.fr.design.gui.iprogressbar.ProgressDialog;
import com.fr.design.gui.iscrollbar.UIScrollBar; import com.fr.design.gui.iscrollbar.UIScrollBar;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.loghandler.LogMessageBar;
import com.fr.design.mainframe.toolbar.ToolBarMenuDock; import com.fr.design.mainframe.toolbar.ToolBarMenuDock;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.mainframe.vcs.common.VcsHelper; import com.fr.design.mainframe.vcs.common.VcsHelper;
import com.fr.design.menu.MenuManager;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.os.impl.MacOsAddListenerAction; import com.fr.design.os.impl.MacOsAddListenerAction;
import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.os.impl.SupportOSImpl;
@ -42,35 +51,47 @@ import com.fr.file.FILE;
import com.fr.file.FILEFactory; import com.fr.file.FILEFactory;
import com.fr.file.FileFILE; import com.fr.file.FileFILE;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.invoke.Reflect; import com.fr.invoke.Reflect;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.image4j.codec.ico.ICODecoder; import com.fr.stable.image4j.codec.ico.ICODecoder;
import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.OperatingSystem;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter; import com.fr.stable.os.support.OSSupportCenter;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.start.OemHandler; import com.fr.start.OemHandler;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
import com.fr.workspace.connect.WorkspaceConnectionInfo; import com.fr.workspace.connect.WorkspaceConnectionInfo;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
import org.jetbrains.annotations.Nullable;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JLayeredPane; import javax.swing.JLayeredPane;
import javax.swing.JMenuBar;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.WindowConstants; import javax.swing.WindowConstants;
import javax.swing.border.MatteBorder;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Point; import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.DataFlavor;
@ -105,6 +126,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
private static final long serialVersionUID = -8732559571067484460L; private static final long serialVersionUID = -8732559571067484460L;
private static final int LEFT_ALIGN_GAP = -5;
private static final int MENU_HEIGHT = 26; private static final int MENU_HEIGHT = 26;
private static final Integer SECOND_LAYER = 100; private static final Integer SECOND_LAYER = 100;
@ -115,6 +138,22 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
private ToolBarMenuDock ad; private ToolBarMenuDock ad;
private DesktopCardPane centerTemplateCardPane;
private JPanel toolbarPane;
private JComponent toolbarComponent;
private JPanel menuPane;
private JMenuBar menuBar;
private JPanel eastCenterPane;
private UIToolbar combineUp;
private NewTemplatePane newWorkBookPane;
private Icon closeMode; private Icon closeMode;
private JLayeredPane layeredPane = this.getLayeredPane(); private JLayeredPane layeredPane = this.getLayeredPane();
@ -236,8 +275,37 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
// the content pane // the content pane
basePane.setLayout(new BorderLayout()); basePane.setLayout(new BorderLayout());
toolbarPane = new JPanel() {
@Override
public Dimension getPreferredSize() {
basePane.add(CenterRegionContainerPane.getInstance(), BorderLayout.CENTER); Dimension dim = super.getPreferredSize();
// dim.height = TOOLBAR_HEIGHT;
return dim;
}
};
toolbarPane.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel eastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
eastPane.add(ad.createLargeToolbar(), BorderLayout.WEST);
eastCenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
combineUpTooBar();
eastCenterPane.add(combineUp, BorderLayout.NORTH);
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.add(newWorkBookPane = ad.getNewTemplatePane(), BorderLayout.WEST);
panel.add(MutilTempalteTabPane.getInstance(), BorderLayout.CENTER);
eastCenterPane.add(panel, BorderLayout.CENTER);
eastPane.add(eastCenterPane, BorderLayout.CENTER);
toolbarPane.add(eastPane, BorderLayout.NORTH);
toolbarPane.add(new UIMenuHighLight(), BorderLayout.SOUTH);
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.add(centerTemplateCardPane = new DesktopCardPane(), BorderLayout.CENTER);
centerPane.add(toolbarPane, BorderLayout.NORTH);
basePane.add(centerPane, BorderLayout.CENTER);
laoyoutWestPane(); laoyoutWestPane();
basePane.add(EastRegionContainerPane.getInstance(), BorderLayout.EAST); basePane.add(EastRegionContainerPane.getInstance(), BorderLayout.EAST);
basePane.setBounds(0, 0, contentWidth, contentHeight); basePane.setBounds(0, 0, contentWidth, contentHeight);
@ -345,7 +413,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
public DesktopCardPane getCenterTemplateCardPane() { public DesktopCardPane getCenterTemplateCardPane() {
return CenterRegionContainerPane.getInstance().getCenterTemplateCardPane(); return centerTemplateCardPane;
} }
/** /**
@ -353,10 +421,82 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
*/ */
protected void initMenuPane() { protected void initMenuPane() {
basePane.add(NorthRegionContainerPane.getInstance(), BorderLayout.NORTH); menuPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
menuPane.add(new UIMenuHighLight(), BorderLayout.SOUTH);
menuPane.add(initNorthEastPane(ad), BorderLayout.EAST);
basePane.add(menuPane, BorderLayout.NORTH);
this.resetToolkitByPlus(null); this.resetToolkitByPlus(null);
} }
/**
* @param ad 菜单栏
* @return panel
*/
protected JPanel initNorthEastPane(final ToolBarMenuDock ad) {
//hugh: private修改为protected方便oem的时候修改右上的组件构成
//顶部日志+登陆按钮
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
//优先级为-1,保证最后全面刷新一次
GeneralContext.listenPluginRunningChanged(new PluginEventListener(-1) {
@Override
public void on(PluginEvent event) {
refreshNorthEastPane(northEastPane, ad);
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (DesignerContext.getDesignerFrame() == null) {
return;
}
DesignerContext.getDesignerFrame().refresh();
DesignerContext.getDesignerFrame().repaint();
}
});
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraDesign);
}
});
refreshNorthEastPane(northEastPane, ad);
return northEastPane;
}
private void refreshNorthEastPane(final JPanel northEastPane, final ToolBarMenuDock ad) {
northEastPane.removeAll();
northEastPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
northEastPane.add(LogMessageBar.getInstance());
TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING);
if (processor != null) {
final Component[] bbsLoginPane = {null};
OSSupportCenter.buildAction(new OSBasedAction() {
@Override
public void execute(Object... objects) {
bbsLoginPane[0] = ad.createBBSLoginPane();
}
}, SupportOSImpl.USERINFOPANE);
processor.hold(northEastPane, LogMessageBar.getInstance(), bbsLoginPane[0]);
}
northEastPane.add(ad.createAlphaFinePane());
if (!DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) {
ad.createAlphaFinePane().setVisible(false);
}
northEastPane.add(ad.createNotificationCenterPane());
OSSupportCenter.buildAction(new OSBasedAction() {
@Override
public void execute(Object... objects) {
northEastPane.add(ad.createBBSLoginPane());
}
}, SupportOSImpl.USERINFOPANE);
}
public void initTitleIcon() { public void initTitleIcon() {
try { try {
@ -533,6 +673,94 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
this.closeMode = closeMode; this.closeMode = closeMode;
} }
/**
* 创建上工具栏
*/
private void combineUpTooBar() {
combineUp = new UIToolbar(FlowLayout.LEFT);
combineUp.setBorder(new MatteBorder(new Insets(0, LEFT_ALIGN_GAP, 1, 0), UIConstants.LINE_COLOR));
combineUp.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 2));
setUpUpToolBar(null);
}
/**
* 重置上工具栏
*/
private void resetCombineUpTooBar(JComponent[] toolbar4Form) {
combineUp.removeAll();
setUpUpToolBar(toolbar4Form);
}
/**
* 填充上工具栏的中的工具
*
* @param toolbar4Form 目标组件
*/
private void setUpUpToolBar(@Nullable JComponent[] toolbar4Form) {
UIButton[] fixButtons = ad.createUp();
for (UIButton fixButton : fixButtons) {
combineUp.add(fixButton);
}
if (!DesignModeContext.isAuthorityEditing()) {
combineUp.addSeparator(new Dimension(2, 16));
if (toolbar4Form != null) {
for (JComponent jComponent : toolbar4Form) {
combineUp.add(jComponent);
}
}
//添加检测按钮
addCheckButton();
}
//添加分享按钮
addShareButton();
//添加插件中的按钮
addExtraButtons();
}
private void addExtraButtons() {
JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jt == null) {
return;
}
UIButton[] extraButtons = jt.createExtraButtons();
for (UIButton extraButton : extraButtons) {
combineUp.add(extraButton);
}
if (extraButtons.length > 0) {
combineUp.addSeparator(new Dimension(2, 16));
}
}
private void addCheckButton() {
JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jt == null) {
return;
}
combineUp.addSeparator(new Dimension(2, 16));
UIButton[] checkButtons = jt.createCheckButton();
for (UIButton checkButton : checkButtons) {
combineUp.add(checkButton);
}
}
private void addShareButton() {
JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jt == null) {
return;
}
combineUp.addSeparator(new Dimension(2, 16));
UIButton[] shareButtons = jt.createShareButton();
for (UIButton shareButton : shareButtons) {
combineUp.add(shareButton);
}
}
/** /**
* 检查 * 检查
* *
@ -540,9 +768,16 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
* @param al 组件名称 * @param al 组件名称
*/ */
public void checkCombineUp(boolean flag, ArrayList<String> al) { public void checkCombineUp(boolean flag, ArrayList<String> al) {
CenterRegionContainerPane.getInstance().checkCombineUp(flag, al); //Yvan: 检查当前是否为WORK_SHEET状态,因为只有WORK_SHEET中含有格式刷组件,此时是不需要进行checkComponentsByNames的
JTemplate<?, ?> jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jTemplate != null) {
// 第一个条件满足后还需要添加一重判断,判断是编辑报表块还是参数面板,编辑报表块时则直接return
if (jTemplate.getMenuState() == DesignState.WORK_SHEET && !jTemplate.isUpMode()) {
return;
}
combineUp.checkComponentsByNames(flag, al);
}
} }
/** /**
* 刷新工具条. * 刷新工具条.
@ -552,10 +787,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
this.ad.updateToolBarDef(); this.ad.updateToolBarDef();
} }
ToolBarMenuDock getToolBarMenuDock() {
return this.ad;
}
/** /**
* 重置相关的工具条. * 重置相关的工具条.
* *
@ -567,9 +798,22 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
plus = ToolBarMenuDock.NULLAVOID; plus = ToolBarMenuDock.NULLAVOID;
} }
NorthRegionContainerPane.getInstance().resetToolkitByPlus(plus, ad); DesignState designState = new DesignState(plus);
MenuManager.getInstance().setMenus4Designer(designState);
if (menuBar == null) {
menuPane.add(menuBar = ad.createJMenuBar(plus), BorderLayout.CENTER);
} else {
ad.resetJMenuBar(menuBar, plus);
}
resetCombineUpTooBar(ad.resetUpToolBar(plus));
if (toolbarComponent != null) {
toolbarPane.remove(toolbarComponent);
}
CenterRegionContainerPane.getInstance().resetToolkitByPlus(plus, ad); // 颜色,字体那些按钮的工具栏
toolbarPane.add(toolbarComponent = ad.resetToolBar(toolbarComponent, plus), BorderLayout.CENTER);
this.checkToolbarMenuEnable(); this.checkToolbarMenuEnable();
this.validate(); this.validate();
@ -577,13 +821,16 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
} }
public void refreshUIToolBar() { public void refreshUIToolBar() {
CenterRegionContainerPane.getInstance().refreshUIToolBar(); if (toolbarComponent instanceof UIToolbar) {
((UIToolbar ) toolbarComponent).refreshUIToolBar();
}
combineUp.refreshUIToolBar();
this.ad.updateEnable(); this.ad.updateEnable();
} }
public JComponent getToolbarComponent() { public JComponent getToolbarComponent() {
return CenterRegionContainerPane.getInstance().getToolbarComponent(); return this.toolbarComponent;
} }
/** /**
@ -591,7 +838,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
*/ */
public void needToAddAuhtorityPaint() { public void needToAddAuhtorityPaint() {
CenterRegionContainerPane.getInstance().needToAddAuhtorityPaint(); newWorkBookPane.setButtonGray(DesignModeContext.isAuthorityEditing());
// 进入或退出权限编辑模式,通知插件 // 进入或退出权限编辑模式,通知插件
Set<ShortCut> extraShortCuts = ExtraDesignClassManager.getInstance().getExtraShortCuts(); Set<ShortCut> extraShortCuts = ExtraDesignClassManager.getInstance().getExtraShortCuts();
@ -709,7 +956,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
*/ */
public JTemplate<?, ?> getSelectedJTemplate() { public JTemplate<?, ?> getSelectedJTemplate() {
return getCenterTemplateCardPane().getSelectedJTemplate(); return this.centerTemplateCardPane.getSelectedJTemplate();
} }
/** /**
@ -738,14 +985,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
if (jt == null || jt.getEditingFILE() == null) { if (jt == null || jt.getEditingFILE() == null) {
return; return;
} }
if (currentTemplateDeactivateFail()) {
return;
}
jt.addJTemplateActionListener(this); jt.addJTemplateActionListener(this);
jt.addTargetModifiedListener(this); jt.addTargetModifiedListener(this);
jt.addJTemplateActionListener(VcsHelper.getInstance()); jt.addJTemplateActionListener(VcsHelper.getInstance());
getCenterTemplateCardPane().showJTemplate(jt); centerTemplateCardPane.showJTemplate(jt);
refreshBaseContentPane(jt);
setTitle(); setTitle();
layeredPane.repaint(); layeredPane.repaint();
} }
@ -763,57 +1006,11 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
if (jt == null || jt.getEditingFILE() == null) { if (jt == null || jt.getEditingFILE() == null) {
return; return;
} }
if (currentTemplateDeactivateFail()) { centerTemplateCardPane.showJTemplate(jt);
return;
}
getCenterTemplateCardPane().showJTemplate(jt);
refreshBaseContentPane(jt);
setTitle(); setTitle();
layeredPane.repaint(); layeredPane.repaint();
} }
/**
* 当前模板 停用失败
*
* @return 是否停用失败
*/
private boolean currentTemplateDeactivateFail() {
JTemplate currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
return currentEditingTemplate != null && !currentEditingTemplate.deactivateTemplate();
}
/**
* 根据模板刷新 设计器整个界面
*
* @param jTemplate 当前模板
*/
private void refreshBaseContentPane(JTemplate jTemplate) {
JComponent north = jTemplate.north4DesignerFrame(),
center = jTemplate.center4DesignerFrame(),
west = jTemplate.west4DesignerFrame(),
east = jTemplate.east4DesignerFrame();
basePane.removeAll();
if (north != null) {
basePane.add(north, BorderLayout.NORTH);
}
if (center != null) {
basePane.add(center, BorderLayout.CENTER);
}
if (west != null) {
basePane.add(west, BorderLayout.WEST);
}
if (east != null) {
basePane.add(east, BorderLayout.EAST);
}
layeredPane.repaint();
layeredPane.revalidate();
}
/** /**
* 对象侦听 * 对象侦听
* *

4
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -466,6 +466,10 @@ public abstract class ToolBarMenuDock {
return new UILabel(); return new UILabel();
} }
public Component createNotificationCenterPane(){
return new UILabel();
}
protected MenuDef createServerMenuDef(ToolBarMenuDockPlus plus) { protected MenuDef createServerMenuDef(ToolBarMenuDockPlus plus) {
MenuDef menuDef = new MenuDef(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic__M_Server"), 'S'); MenuDef menuDef = new MenuDef(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic__M_Server"), 'S');

40
designer-base/src/main/java/com/fr/design/notification/Notification.java

@ -0,0 +1,40 @@
package com.fr.design.notification;
import com.fr.design.dialog.NotificationDialogAction;
public class Notification {
private int type;
private String message;
private NotificationDialogAction notificationDialogAction;
public static final int ERROR_MESSAGE = 0;
public static final int NEW_MESSAGE = 1;
public static final int WARNING_MESSAGE = 2;
public Notification(int type,String message,NotificationDialogAction notificationDialogAction){
this.type = type;
this.message = message;
this.notificationDialogAction = notificationDialogAction;
}
public Notification(String message){
this.type = WARNING_MESSAGE;
this.message = message;
this.notificationDialogAction = new NotificationDialogAction() {
@Override
public void doClick() {
//do nothing
}
};
}
public NotificationDialogAction getNotificationDialogAction() {
return notificationDialogAction;
}
public int getType(){
return type;
}
public String getMessage(){
return message;
}
}

42
designer-base/src/main/java/com/fr/design/notification/NotificationCenter.java

@ -0,0 +1,42 @@
package com.fr.design.notification;
import com.fr.design.notification.ui.NotificationCenterPane;
import java.util.ArrayList;
import java.util.List;
public class NotificationCenter {
private static NotificationCenter notificationCenter = new NotificationCenter();
private List<Notification> notifications;
private NotificationCenter(){
notifications = new ArrayList<>();
}
public static NotificationCenter getInstance(){
return notificationCenter;
}
public void addNotification(Notification message){
notifications.add(message);
NotificationCenterPane.getNotificationCenterPane().refreshButton();
}
public int getNotificationsCount(){
return notifications.size();
}
public void removeNotification(int index){
notifications.remove(index);
NotificationCenterPane.getNotificationCenterPane().refreshButton();
}
public Notification getNotification(int index){
return notifications.get(index);
}
public void clearAllNotifications(){
notifications.clear();
NotificationCenterPane.getNotificationCenterPane().refreshButton();
}
}

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

@ -0,0 +1,222 @@
package com.fr.design.notification.ui;
import com.fr.design.dialog.NotificationDialogAction;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.notification.Notification;
import com.fr.design.notification.NotificationCenter;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Toolkit;
import java.awt.Window;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.UIManager;
public class NotificationCenterDialog extends JDialog {
private ArrayList<NotificationPane> notificationNeedShow;
private JPanel centerPanel;
private UILabel deleteLabel;
private static final int NOTIFICATIONCOUNT = 5;
public NotificationCenterDialog(Frame parent) {
super(parent, true);
setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Notification"));
setResizable(false);
notificationNeedShow = new ArrayList<>();
initComponents();
}
public void initComponents() {
centerPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
addNotification();
deleteLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_Notifications") + "(" + NotificationCenter.getInstance().getNotificationsCount() + ")");
deleteLabel.setForeground(Color.BLUE);
deleteLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
NotificationCenter.getInstance().clearAllNotifications();
centerPanel.removeAll();
addNotification();
pack();
deleteLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_Notifications") + "(" + NotificationCenter.getInstance().getNotificationsCount() + ")");
if (notificationNeedShow.size() == 0) {
hideDialog();
}
}
});
JPanel deletePane = new JPanel(FRGUIPaneFactory.createCenterFlowLayout());
deletePane.add(deleteLabel);
deletePane.setPreferredSize(new Dimension(240, 30));
add(centerPanel, BorderLayout.CENTER);
add(deletePane, BorderLayout.SOUTH);
pack();
centerWindow();
}
private void hideDialog() {
this.dispose();
}
private void addNotification() {
notificationNeedShow.clear();
int size = NotificationCenter.getInstance().getNotificationsCount();
for (int i = NOTIFICATIONCOUNT; i > 0; i--) {
int j = size - i;
if (j >= 0) {
Notification notification = NotificationCenter.getInstance().getNotification(j);
NotificationPane notificationPane = new NotificationPane(notification.getType(), notification.getMessage(), i, notification.getNotificationDialogAction());
notificationNeedShow.add(notificationPane);
}
}
size = notificationNeedShow.size();
for (int i = size - 1; i >= 0; i--) {
centerPanel.add(notificationNeedShow.get(i));
}
}
private void centerWindow() {
Window win = this;
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension winSize = win.getSize();
if (winSize.height > screenSize.height) {
winSize.height = screenSize.height;
}
if (winSize.width > screenSize.width) {
winSize.width = screenSize.width;
}
//这里设置位置:水平居中,竖直偏上
win.setLocation(screenSize.width - winSize.width - 90, 50);
}
/**
* 一条消息面板
*/
class NotificationPane extends JPanel {
private int index;
private UILabel messageLabel;
private UILabel messageIcon;
private NotificationDialogAction notificationDialogAction;
public NotificationPane(int type, String message, int index, NotificationDialogAction notificationDialogAction) {
this.index = index;
this.notificationDialogAction = notificationDialogAction;
this.setLayout(FRGUIPaneFactory.createBorderLayout());
setTypeIcon(getIconForType(type));
setNotification(message);
setDeleteIcon();
}
public void setTypeIcon(Icon icon) {
messageIcon = new UILabel(icon);
messageIcon.addMouseListener(messageAndIconListener);
JPanel messageIconPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
messageIconPanel.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8));
messageIconPanel.add(messageIcon);
add(messageIconPanel, BorderLayout.WEST);
}
public void setDeleteIcon() {
UILabel deleteIcon = new UILabel(UIManager.getIcon("OptionPane.deleteIcon"));
JPanel deleteIconPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
deleteIconPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 7));
deleteIconPane.add(deleteIcon);
deleteIconPane.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
NotificationCenter.getInstance().removeNotification(NotificationCenter.getInstance().getNotificationsCount() - index);
centerPanel.removeAll();
addNotification();
deleteLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_Notifications") + "(" + NotificationCenter.getInstance().getNotificationsCount() + ")");
pack();
if (notificationNeedShow.size() == 0) {
hideDialog();
}
NotificationCenterPane.getNotificationCenterPane().refreshButton();
}
@Override
public void mouseEntered(MouseEvent e) {
deleteIcon.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
@Override
public void mouseExited(MouseEvent e) {
deleteIcon.setCursor(Cursor.getDefaultCursor());
}
});
add(deleteIconPane, BorderLayout.EAST);
}
public int getIndex() {
return index;
}
public void setNotification(String message) {
messageLabel = new UILabel("<html>" + message + "</html>");
messageLabel.addMouseListener(messageAndIconListener);
JPanel labelPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
labelPanel.add(messageLabel);
this.add(labelPanel, BorderLayout.CENTER);
}
protected Icon getIconForType(int messageType) {
String propertyName;
switch (messageType) {
case 0:
propertyName = "OptionPane.circularErrorIcon";
break;
case 1:
propertyName = "OptionPane.newMessageIcon";
break;
case 2:
propertyName = "OptionPane.circularWarningIcon";
break;
default:
return null;
}
return UIManager.getIcon(propertyName);
}
private MouseListener messageAndIconListener = new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
hideDialog();
notificationDialogAction.doClick();
}
@Override
public void mouseEntered(MouseEvent e) {
messageLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
messageIcon.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
messageLabel.setForeground(new Color(250, 170, 57));
}
@Override
public void mouseExited(MouseEvent e) {
messageLabel.setCursor(Cursor.getDefaultCursor());
messageIcon.setCursor(Cursor.getDefaultCursor());
messageLabel.setForeground(Color.BLACK);
}
};
}
}

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

@ -0,0 +1,54 @@
package com.fr.design.notification.ui;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.notification.NotificationCenter;
import com.fr.general.IOUtils;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
public class NotificationCenterPane extends BasicPane {
private static NotificationCenterPane notificationCenterPane = new NotificationCenterPane();
private static UIButton notificationCenterButton;
private NotificationCenterPane() {
setPreferredSize(new Dimension(24, 24));
setLayout(new BorderLayout());
notificationCenterButton = new UIButton();
notificationCenterButton.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/notificationcenter/notificationCenter.png"));
notificationCenterButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Show_Notification"));
notificationCenterButton.set4ToolbarButton();
notificationCenterButton.setRolloverEnabled(false);
this.add(notificationCenterButton);
notificationCenterButton.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
NotificationCenterDialog notificationCenterDialog = new NotificationCenterDialog(DesignerContext.getDesignerFrame());
notificationCenterDialog.setVisible(true);
}
});
this.setBackground(UIConstants.TEMPLATE_TAB_PANE_BACKGROUND);
}
public static NotificationCenterPane getNotificationCenterPane() {
return notificationCenterPane;
}
public void refreshButton() {
if (NotificationCenter.getInstance().getNotificationsCount() > 0) {
notificationCenterButton.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/notificationcenter/notificationCenterDot.png"));
} else {
notificationCenterButton.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/notificationcenter/notificationCenter.png"));
}
}
@Override
protected String title4PopupWindow() {
return "NotificationCenter";
}
}

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

@ -2,11 +2,14 @@ package com.fr.design.versioncheck;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.dialog.NotificationDialog;
import com.fr.design.dialog.NotificationDialogAction;
import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.DesignerWorkspaceType; import com.fr.design.env.DesignerWorkspaceType;
import com.fr.design.env.RemoteWorkspace; import com.fr.design.env.RemoteWorkspace;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.env.CheckServiceDialog;
import com.fr.env.VersionCheckMessageDialog; import com.fr.env.VersionCheckMessageDialog;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
@ -68,8 +71,15 @@ public class VersionCheckUtils {
public static void showVersionCheckDialog(String envName) { public static void showVersionCheckDialog(String envName) {
if (!VersionCheckUtils.versionCheck(envName)) { if (!VersionCheckUtils.versionCheck(envName)) {
VersionCheckMessageDialog versionCheckMessageDialog = new VersionCheckMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Sync_Check_Brief_Info"), envName); NotificationDialog notificationDialog = new NotificationDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Sync_Prompt"),
versionCheckMessageDialog.setVisible(true); true, NotificationDialog.WARNING_MESSAGE, Toolkit.i18nText("Fine-Design_Basic_Sync_Check_Brief_Info"), new NotificationDialogAction() {
@Override
public void doClick() {
CheckServiceDialog checkServiceDialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), GeneralUtils.readFullBuildNO(), getRemoteBranch(envName),getNoExistServiceDescription(envName));
checkServiceDialog.setVisible(true);
}
});
notificationDialog.setVisible(true);
} }
} }

5
designer-base/src/main/java/com/fr/env/CheckServiceDialog.java vendored

@ -167,7 +167,8 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
centerPanel.add(detailsPane, BorderLayout.CENTER); centerPanel.add(detailsPane, BorderLayout.CENTER);
JPanel buttonPanel = FRGUIPaneFactory.createBorderLayout_M_Pane(); JPanel buttonPanel = FRGUIPaneFactory.createBorderLayout_M_Pane();
buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
if (isOnline()) { boolean Sync = false;
if (Sync && isOnline()) {
ignoreButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Sync_Ignore")); ignoreButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Sync_Ignore"));
ignoreButton.addActionListener(this); ignoreButton.addActionListener(this);
syncButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Sync_To_Local")); syncButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Sync_To_Local"));
@ -183,8 +184,6 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
buttonPanel.add(progressBar, BorderLayout.CENTER); buttonPanel.add(progressBar, BorderLayout.CENTER);
buttonPanel.add(syncButton, BorderLayout.EAST); buttonPanel.add(syncButton, BorderLayout.EAST);
} else { } else {
UILabel adviceLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Sync_Suggestion"));
centerPanel.add(adviceLabel, BorderLayout.SOUTH);
UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Button_Confirm")); UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Button_Confirm"));
okButton.addActionListener(this); okButton.addActionListener(this);
buttonPanel.add(okButton, BorderLayout.EAST); buttonPanel.add(okButton, BorderLayout.EAST);

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

BIN
designer-base/src/main/resources/com/fr/design/images/lookandfeel/deleteIcon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

11
designer-base/src/main/resources/com/fr/design/login/guide.css

@ -4,9 +4,14 @@
font-size: 14px; font-size: 14px;
} }
.background-guide-close { .background-guide-close {
color: black !important; background: url(./img/icon_install_normal.png) no-repeat center center;
font-weight: bold; background-size: cover;
font-size: 16px; width: 20px;
height: 20px;
cursor: pointer;
}
.background-guide-close:hover {
background-color: #E8E8E9;
} }
.background-login-loading { .background-login-loading {
background: url(./img/login_loading.gif) no-repeat center center; background: url(./img/login_loading.gif) no-repeat center center;

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

File diff suppressed because one or more lines are too long

BIN
designer-base/src/main/resources/com/fr/design/login/img/icon_install_normal.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

44
designer-base/src/main/resources/com/fr/design/login/login.css

@ -4,9 +4,14 @@
font-size: 14px; font-size: 14px;
} }
.background-guide-close { .background-guide-close {
color: black !important; background: url(./img/icon_install_normal.png) no-repeat center center;
font-weight: bold; background-size: cover;
font-size: 16px; width: 20px;
height: 20px;
cursor: pointer;
}
.background-guide-close:hover {
background-color: #E8E8E9;
} }
.background-login-loading { .background-login-loading {
background: url(./img/login_loading.gif) no-repeat center center; background: url(./img/login_loading.gif) no-repeat center center;
@ -50,9 +55,14 @@
font-size: 14px; font-size: 14px;
} }
.background-guide-close { .background-guide-close {
color: black !important; background: url(./img/icon_install_normal.png) no-repeat center center;
font-weight: bold; background-size: cover;
font-size: 16px; width: 20px;
height: 20px;
cursor: pointer;
}
.background-guide-close:hover {
background-color: #E8E8E9;
} }
.background-login-loading { .background-login-loading {
background: url(./img/login_loading.gif) no-repeat center center; background: url(./img/login_loading.gif) no-repeat center center;
@ -136,9 +146,14 @@
font-size: 14px; font-size: 14px;
} }
.background-guide-close { .background-guide-close {
color: black !important; background: url(./img/icon_install_normal.png) no-repeat center center;
font-weight: bold; background-size: cover;
font-size: 16px; width: 20px;
height: 20px;
cursor: pointer;
}
.background-guide-close:hover {
background-color: #E8E8E9;
} }
.background-login-loading { .background-login-loading {
background: url(./img/login_loading.gif) no-repeat center center; background: url(./img/login_loading.gif) no-repeat center center;
@ -186,9 +201,14 @@
font-size: 14px; font-size: 14px;
} }
.background-guide-close { .background-guide-close {
color: black !important; background: url(./img/icon_install_normal.png) no-repeat center center;
font-weight: bold; background-size: cover;
font-size: 16px; width: 20px;
height: 20px;
cursor: pointer;
}
.background-guide-close:hover {
background-color: #E8E8E9;
} }
.background-login-loading { .background-login-loading {
background: url(./img/login_loading.gif) no-repeat center center; background: url(./img/login_loading.gif) no-repeat center center;

2
designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java

@ -18,7 +18,7 @@ public class VanChartRichTextDialog extends BasicDialog {
this.setTitle(Toolkit.i18nText("Fine-Design_Report_RichTextEditor")); this.setTitle(Toolkit.i18nText("Fine-Design_Report_RichTextEditor"));
this.setBasicDialogSize(DEFAULT); this.setBasicDialogSize(DEFAULT);
GUICoreUtils.centerWindow(this); GUICoreUtils.centerWindow(this);
this.setResizable(false); this.setResizable(true);
this.setModal(true); this.setModal(true);
} }

14
designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentCreator.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.share.generate.task; package com.fr.design.mainframe.share.generate.task;
import com.fr.base.TableData;
import com.fr.base.iofile.attr.ExtendSharableAttrMark; import com.fr.base.iofile.attr.ExtendSharableAttrMark;
import com.fr.base.iofile.attr.SharableAttrMark; import com.fr.base.iofile.attr.SharableAttrMark;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
@ -21,6 +22,7 @@ import com.fr.workspace.WorkContext;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.Map; import java.util.Map;
/** /**
@ -91,10 +93,16 @@ public class ComponentCreator extends AbstractComponentCreatorProcessor {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
// //内置数据集 //内置数据集
if (tpl != null) {
ShareEmbeddedConverter embeddedConverter = WorkContext.getCurrent().get(ShareEmbeddedConverter.class); ShareEmbeddedConverter embeddedConverter = WorkContext.getCurrent().get(ShareEmbeddedConverter.class);
embeddedConverter.convertToEmbeddedTableData(tpl, paraMap); Map<String, TableData> map = embeddedConverter.convertToEmbeddedTableData(tpl, paraMap);
Iterator<Map.Entry<String, TableData>> iterator = map.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<String, TableData> entry = iterator.next();
tpl.putTableData(entry.getKey(), entry.getValue());
}
}
return tpl; return tpl;
} }

5
designer-realize/src/main/java/com/fr/start/MainDesigner.java

@ -29,6 +29,7 @@ import com.fr.design.mainframe.JWorkBook;
import com.fr.design.mainframe.alphafine.component.AlphaFinePane; import com.fr.design.mainframe.alphafine.component.AlphaFinePane;
import com.fr.design.mainframe.bbs.UserInfoLabel; import com.fr.design.mainframe.bbs.UserInfoLabel;
import com.fr.design.mainframe.bbs.UserInfoPane; import com.fr.design.mainframe.bbs.UserInfoPane;
import com.fr.design.notification.ui.NotificationCenterPane;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
@ -413,6 +414,10 @@ public class MainDesigner extends BaseDesigner {
return AlphaFinePane.getAlphaFinePane(); return AlphaFinePane.getAlphaFinePane();
} }
public Component createNotificationCenterPane(){
return NotificationCenterPane.getNotificationCenterPane();
}
/** /**
* 收集用户信息吗 * 收集用户信息吗
*/ */

2
designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

@ -41,6 +41,7 @@ import com.fr.design.javascript.ParameterJavaScriptPane;
import com.fr.design.javascript.ProcessTransitionAdapter; import com.fr.design.javascript.ProcessTransitionAdapter;
import com.fr.design.login.DesignerLoginType; import com.fr.design.login.DesignerLoginType;
import com.fr.design.login.guide.DesignerGuideHelper; import com.fr.design.login.guide.DesignerGuideHelper;
import com.fr.design.login.message.DesignerMessageHelper;
import com.fr.design.login.socketio.LoginAuthServer; import com.fr.design.login.socketio.LoginAuthServer;
import com.fr.design.mainframe.BaseJForm; import com.fr.design.mainframe.BaseJForm;
import com.fr.design.mainframe.FormHierarchyTreePane; import com.fr.design.mainframe.FormHierarchyTreePane;
@ -141,6 +142,7 @@ public class DesignerActivator extends Activator implements Prepare {
public void run() { public void run() {
DesignerPushUpdateManager.getInstance().preparePushUpdate(); DesignerPushUpdateManager.getInstance().preparePushUpdate();
DesignerGuideHelper.prepareShowGuideDialog(); DesignerGuideHelper.prepareShowGuideDialog();
DesignerMessageHelper.getInstance().prepareShowMessage();
} }
}); });

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/notificationCenter.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 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