Browse Source

Merge pull request #1154 in DESIGN/design from feature/10.0 to refactor/19.4.3

* commit '29803cfc05d81ae3c77d780b7bb760ca2862b831':
  CHART-4027 代码质量 chartCount和swichState是一件事情,所以swichState不需要
  无jira任务 打包
  REPORT-22339 远程设计管理权限中,新建多个角色,进行删除时会提示,但是并未存在赋值
  REPORT-21295 远程集群报错
  无jira任务 删除注释
  REPORT-22308 切换环境问题
  无jira任务,sonar问题修复
  REPORT-21990 新版本插件管理,帆软通行证登陆-立即注册不会跳转链接
  REPORT-21987 新版本插件管理,本地安装,取消更新仍可正常更新
  CHART-10603 对老图表的plotpane父类增加了获取提示的默认实现,默认取图表选择中子类型的名称
  无JIRA任务 比如恶心的插件接口,稍微改下
  REPORT-19945 启动画面&修复frm工具栏不变化的问题
  CHART-10233 接口修改
research/11.0
zheng 5 years ago
parent
commit
990bb2c462
  1. 6
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 23
      designer-base/src/main/java/com/fr/design/beans/BasicStorePane.java
  3. 4
      designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java
  4. 4
      designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java
  5. 36
      designer-base/src/main/java/com/fr/design/fun/ExportAttrTabProvider.java
  6. 38
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractExportAttrTabProvider.java
  7. 10
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  8. 20
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  9. 2
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java
  10. 1
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/UpdateActionManager.java
  11. 24
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java
  12. 15
      designer-base/src/main/java/com/fr/design/remote/ui/AbstractManagerPane.java
  13. 4
      designer-base/src/main/java/com/fr/design/report/AbstractExportPane.java
  14. 6
      designer-base/src/main/java/com/fr/design/update/ui/dialog/EncodingDetect.java
  15. 4
      designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java
  16. 12
      designer-base/src/main/java/com/fr/design/upm/UpmBridge.java
  17. 2
      designer-base/src/main/java/com/fr/design/utils/DesignUtils.java
  18. 2
      designer-base/src/main/java/com/fr/start/BaseDesigner.java
  19. 5
      designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractChartTypeUI.java
  20. 79
      designer-chart/src/main/java/com/fr/design/chartx/impl/DefaultTypePane.java
  21. 9
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  22. 3
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  23. 73
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java
  24. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractDeprecatedChartTypePane.java
  25. 14
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AreaPlotPane.java
  26. 17
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/BarPlotPane.java
  27. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/BubblePlotPane.java
  28. 17
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ColumnPlotPane.java
  29. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/CustomPlotPane.java
  30. 9
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/DonutPlotPane.java
  31. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/FunnelPlotPane.java
  32. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/GanttPlotPane.java
  33. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/GisMapPlotPane.java
  34. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/LinePlotPane.java
  35. 10
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MeterPlotPane.java
  36. 9
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/PiePlotPane.java
  37. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/RadarPlotPane.java
  38. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/RangePlotPane.java
  39. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/StockPlotPane.java
  40. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/XYScatterPlotPane.java
  41. 20
      designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java
  42. 1
      designer-realize/src/main/java/com/fr/start/DesignerInitial.java
  43. 16
      designer-realize/src/main/java/com/fr/start/SplashContext.java
  44. 42
      designer-realize/src/main/java/com/fr/start/common/SplashWindow.java
  45. 25
      designer-realize/src/main/java/com/fr/start/module/DesignerInitActivator.java
  46. 1
      designer-realize/src/main/java/com/fr/start/module/DesignerShowActivator.java
  47. 2
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

6
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -1,6 +1,6 @@
package com.fr.design.actions.file; package com.fr.design.actions.file;
import com.fr.cluster.engine.base.FineClusterConfig; import com.fr.cluster.ClusterBridge;
import com.fr.config.Configuration; import com.fr.config.Configuration;
import com.fr.config.ServerPreferenceConfig; import com.fr.config.ServerPreferenceConfig;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
@ -307,7 +307,7 @@ public class PreferencePane extends BasicPane {
}); });
//集群下禁用 //集群下禁用
if (FineClusterConfig.getInstance().isCluster()) { if (ClusterBridge.isClusterMode()) {
gcEnableCheckBox.setEnabled(false); gcEnableCheckBox.setEnabled(false);
gcButton.setEnabled(false); gcButton.setEnabled(false);
} }
@ -1050,7 +1050,7 @@ public class PreferencePane extends BasicPane {
if (size > Math.pow(n, 2)) { if (size > Math.pow(n, 2)) {
return df.format(size / Math.pow(n, 2)) + "MB"; return df.format(size / Math.pow(n, 2)) + "MB";
} }
return new StringBuilder().append(df.format(size / n)).append("KB").toString(); return df.format(size / n) + "KB";
} }
/** /**

23
designer-base/src/main/java/com/fr/design/beans/BasicStorePane.java

@ -0,0 +1,23 @@
package com.fr.design.beans;
import com.fr.common.annotations.Open;
/**
* @author richie
* @version 10.0
* Created by richie on 2019/9/24
* 数据存取视图界面
*/
@Open
public abstract class BasicStorePane<T> extends BasicBeanPane<T> {
@Override
public T updateBean() {
return null;
}
public abstract void populateBean(T t);
@Override
public abstract void updateBean(T t);
}

4
designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java

@ -53,7 +53,7 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback {
null, null,
null null
); );
if (rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) {
return; return;
} }
List<PluginTask> pluginTasks = result.getPreTasks(); List<PluginTask> pluginTasks = result.getPreTasks();
@ -73,7 +73,7 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback {
null, null,
null null
); );
if (rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) {
return; return;
} }
PluginOperateUtils.updatePluginFromDisk(zipFile, jsCallback); PluginOperateUtils.updatePluginFromDisk(zipFile, jsCallback);

4
designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java

@ -51,7 +51,7 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback {
null, null,
null null
); );
if (rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) {
return; return;
} }
List<PluginTask> pluginTasks = result.getPreTasks(); List<PluginTask> pluginTasks = result.getPreTasks();
@ -71,7 +71,7 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback {
null, null,
null null
); );
if (rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) {
return; return;
} }
PluginOperateUtils.installPluginFromDisk(zipFile, jsCallback); PluginOperateUtils.installPluginFromDisk(zipFile, jsCallback);

36
designer-base/src/main/java/com/fr/design/fun/ExportAttrTabProvider.java

@ -1,14 +1,8 @@
package com.fr.design.fun; package com.fr.design.fun;
import com.fr.design.report.AbstractExportPane; import com.fr.design.beans.BasicStorePane;
import com.fr.stable.fun.mark.Mutable; import com.fr.stable.fun.mark.Mutable;
import javax.swing.*;
/**
* Created by vito on 16/5/5.
*/
/** /**
* 导出属性Tab页的接口 * 导出属性Tab页的接口
*/ */
@ -18,31 +12,9 @@ public interface ExportAttrTabProvider extends Mutable {
int CURRENT_LEVEL = 1; int CURRENT_LEVEL = 1;
/** /**
* 转换成SwingComponent * 转换成业务视图界面
*
* @return JComponent
*/
JComponent toSwingComponent();
/**
* 转换成AbstractExportPane
*
* @return AbstractExportPane
*/
AbstractExportPane toExportPane();
/**
* tab的标题
*
* @return
*/
String title();
/**
* tag标签
* *
* @return tag名称 * @return 业务视图界面
* @deprecated 将来不使用tag作为区分
*/ */
String tag(); BasicStorePane<?> toServiceComponent();
} }

38
designer-base/src/main/java/com/fr/design/fun/impl/AbstractExportAttrTabProvider.java

@ -1,19 +1,55 @@
package com.fr.design.fun.impl; package com.fr.design.fun.impl;
import com.fr.design.beans.BasicStorePane;
import com.fr.design.fun.ExportAttrTabProvider; import com.fr.design.fun.ExportAttrTabProvider;
import com.fr.design.report.AbstractExportPane;
import com.fr.stable.StringUtils;
import com.fr.stable.fun.impl.AbstractProvider; import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API; import com.fr.stable.fun.mark.API;
import javax.swing.*;
/** /**
* Created by vito on 16/5/5. * Created by vito on 16/5/5.
*/ */
@API(level = ExportAttrTabProvider.CURRENT_LEVEL) @API(level = ExportAttrTabProvider.CURRENT_LEVEL)
public abstract class AbstractExportAttrTabProvider extends AbstractProvider implements ExportAttrTabProvider { public abstract class AbstractExportAttrTabProvider extends AbstractProvider implements ExportAttrTabProvider {
@Override @Override
public int currentAPILevel() { public int currentAPILevel() {
return CURRENT_LEVEL; return CURRENT_LEVEL;
} }
/**
* @see ExportAttrTabProvider#toServiceComponent()
*/
@Deprecated
public AbstractExportPane toExportPane() {
return null;
}
/**
* @see ExportAttrTabProvider#toServiceComponent()
*/
@Deprecated
public JComponent toSwingComponent() {
return toServiceComponent();
}
@Deprecated
public String title() {
return StringUtils.EMPTY;
}
@Deprecated
public String tag() {
return StringUtils.EMPTY;
}
@Override
public BasicStorePane<?> toServiceComponent() {
return toExportPane();
}
@Override @Override
public String mark4Provider() { public String mark4Provider() {
return this.getClass().getName(); return this.getClass().getName();

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

@ -745,13 +745,13 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
resetCombineUpTooBar(ad.resetUpToolBar(plus)); resetCombineUpTooBar(ad.resetUpToolBar(plus));
// 颜色,字体那些按钮的工具栏 if (toolbarComponent != null) {
if (toolbarComponent == null) { toolbarPane.remove(toolbarComponent);
toolbarPane.add(toolbarComponent = ad.resetToolBar(null, plus), BorderLayout.CENTER);
} else {
ad.resetToolBar(toolbarComponent, plus);
} }
// 颜色,字体那些按钮的工具栏
toolbarPane.add(toolbarComponent = ad.resetToolBar(toolbarComponent, plus), BorderLayout.CENTER);
this.checkToolbarMenuEnable(); this.checkToolbarMenuEnable();
this.validate(); this.validate();
layeredPane.repaint(); layeredPane.repaint();

20
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -2,7 +2,7 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.cluster.engine.base.FineClusterConfig; import com.fr.cluster.ClusterBridge;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
@ -242,6 +242,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
/** /**
* 响应数据集改变 * 响应数据集改变
*/ */
@Override
public void fireDSChanged() { public void fireDSChanged() {
fireDSChanged(new HashMap<String, String>()); fireDSChanged(new HashMap<String, String>());
@ -252,6 +253,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
* *
* @param map 改变名字的数据集 * @param map 改变名字的数据集
*/ */
@Override
public void fireDSChanged(Map<String, String> map) { public void fireDSChanged(Map<String, String> map) {
DesignTableDataManager.fireDSChanged(map); DesignTableDataManager.fireDSChanged(map);
@ -307,7 +309,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
return selectedOperation; return selectedOperation;
} }
/* /**
* 新建文件夹 * 新建文件夹
*/ */
private class NewFolderAction extends UpdateAction { private class NewFolderAction extends UpdateAction {
@ -363,7 +365,9 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
* 版本管理可用状态的监控 * 版本管理可用状态的监控
*/ */
private void fireVcsActionChange() { private void fireVcsActionChange() {
if (!DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable() || VcsHelper.getInstance().isUnSelectedTemplate() || FineClusterConfig.getInstance().isCluster()) { if (!DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable()
|| VcsHelper.getInstance().isUnSelectedTemplate()
|| ClusterBridge.isClusterMode()) {
setEnabled(false); setEnabled(false);
return; return;
} }
@ -549,14 +553,17 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
nameField = new UITextField(oldName); nameField = new UITextField(oldName);
nameField.getDocument().addDocumentListener(new DocumentListener() { nameField.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void changedUpdate(DocumentEvent e) { public void changedUpdate(DocumentEvent e) {
validInput(); validInput();
} }
@Override
public void insertUpdate(DocumentEvent e) { public void insertUpdate(DocumentEvent e) {
validInput(); validInput();
} }
@Override
public void removeUpdate(DocumentEvent e) { public void removeUpdate(DocumentEvent e) {
validInput(); validInput();
} }
@ -597,6 +604,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm")); confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm"));
confirmButton.setPreferredSize(new Dimension(60, 25)); confirmButton.setPreferredSize(new Dimension(60, 25));
confirmButton.addActionListener(new ActionListener() { confirmButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
confirmClose(); confirmClose();
} }
@ -608,6 +616,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
cancelButton.addActionListener(new ActionListener() { cancelButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
dispose(); dispose();
} }
@ -764,14 +773,17 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
nameField = new UITextField(); nameField = new UITextField();
nameField.getDocument().addDocumentListener(new DocumentListener() { nameField.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void changedUpdate(DocumentEvent e) { public void changedUpdate(DocumentEvent e) {
validInput(); validInput();
} }
@Override
public void insertUpdate(DocumentEvent e) { public void insertUpdate(DocumentEvent e) {
validInput(); validInput();
} }
@Override
public void removeUpdate(DocumentEvent e) { public void removeUpdate(DocumentEvent e) {
validInput(); validInput();
} }
@ -812,6 +824,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm")); confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm"));
confirmButton.setPreferredSize(new Dimension(60, 25)); confirmButton.setPreferredSize(new Dimension(60, 25));
confirmButton.addActionListener(new ActionListener() { confirmButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
confirmClose(); confirmClose();
} }
@ -824,6 +837,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
cancelButton.addActionListener(new ActionListener() { cancelButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
dispose(); dispose();
} }

2
designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java

@ -42,7 +42,7 @@ import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_M
public class DesignerLogHandler { public class DesignerLogHandler {
private static final SimpleDateFormat LOG_SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private final SimpleDateFormat LOG_SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private static final int GAP_X = -150; private static final int GAP_X = -150;

1
designer-base/src/main/java/com/fr/design/mainframe/toolbar/UpdateActionManager.java

@ -129,6 +129,7 @@ public class UpdateActionManager {
EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, new Listener<Null>() { EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, new Listener<Null>() {
@Override @Override
public void on(Event event, Null param) { public void on(Event event, Null param) {
EventDispatcher.stopListen(this);
afterStartup = true; afterStartup = true;
for (Map.Entry<String, UpdateAction> cache : updateActionsIndexCache.entrySet()) { for (Map.Entry<String, UpdateAction> cache : updateActionsIndexCache.entrySet()) {
searchPool.execute(new IndexTask(cache.getKey(), cache.getValue())); searchPool.execute(new IndexTask(cache.getKey(), cache.getValue()));

24
designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.vcs.common; package com.fr.design.mainframe.vcs.common;
import com.fr.cluster.engine.base.FineClusterConfig; import com.fr.cluster.ClusterBridge;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.TemplateTreePane; import com.fr.design.file.TemplateTreePane;
@ -25,9 +26,9 @@ import com.fr.workspace.server.vcs.git.config.GcConfig;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
import java.awt.Color; import java.awt.Color;
import java.util.Date;
import static com.fr.stable.StableUtils.pathJoin; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/** /**
* Created by XiaXiang on 2019/4/17. * Created by XiaXiang on 2019/4/17.
@ -49,10 +50,10 @@ public class VcsHelper implements JTemplateActionListener {
public final static int OFFSET = 2; public final static int OFFSET = 2;
private static final int MINUTE = 60 * 1000; private static final int MINUTE = 60 * 1000;
private final static String VCS_PLUGIN_ID = "com.fr.plugin.vcs.v10"; private final static String VCS_PLUGIN_ID = "com.fr.plugin.vcs.v10";
private static final VcsHelper instance = new VcsHelper(); private static final VcsHelper INSTANCE = new VcsHelper();
public static VcsHelper getInstance() { public static VcsHelper getInstance() {
return instance; return INSTANCE;
} }
private int containsFolderCounts() { private int containsFolderCounts() {
@ -111,7 +112,7 @@ public class VcsHelper implements JTemplateActionListener {
if (configManager.isSaveCommit() && StringUtils.isNotBlank(entity.getCommitMsg())) { if (configManager.isSaveCommit() && StringUtils.isNotBlank(entity.getCommitMsg())) {
return false; return false;
} }
return new Date().getTime() - entity.getTime().getTime() < DesignerEnvManager.getEnvManager().getVcsConfigManager().getSaveInterval() * MINUTE; return System.currentTimeMillis() - entity.getTime().getTime() < DesignerEnvManager.getEnvManager().getVcsConfigManager().getSaveInterval() * MINUTE;
} }
public boolean needInit() { public boolean needInit() {
@ -125,7 +126,8 @@ public class VcsHelper implements JTemplateActionListener {
* @param jt * @param jt
*/ */
public void fireVcs(final JTemplate jt) { public void fireVcs(final JTemplate jt) {
new Thread(new Runnable() { ExecutorService fireVcs = Executors.newSingleThreadExecutor(new NamedThreadFactory("fireVcs"));
fireVcs.execute(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -152,8 +154,8 @@ public class VcsHelper implements JTemplateActionListener {
} }
} }
}).start(); });
fireVcs.shutdown();
} }
@ -169,7 +171,9 @@ public class VcsHelper implements JTemplateActionListener {
*/ */
@Override @Override
public void templateSaved(JTemplate<?, ?> jt) { public void templateSaved(JTemplate<?, ?> jt) {
if (needInit() && DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable() && !FineClusterConfig.getInstance().isCluster()) { if (needInit()
&& DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable()
&& !ClusterBridge.isClusterMode()) {
fireVcs(jt); fireVcs(jt);
} }
} }

15
designer-base/src/main/java/com/fr/design/remote/ui/AbstractManagerPane.java

@ -314,16 +314,15 @@ public abstract class AbstractManagerPane extends BasicPane {
private void addToMemberList() { private void addToMemberList() {
addingListModel.clear(); addingListModel.clear();
for (RemoteDesignMember member : addingMembers) { for (RemoteDesignMember addingMember : addingMembers) {
// 如果包含在右侧列表中,那么左侧列表默认选中 // 如果包含在右侧列表中,那么左侧列表默认选中
if (addedMembers.contains(member)) { for (RemoteDesignMember addedMember : addedMembers){
member.setAuthority(true); if (addingMember.equals(addedMember)){
member.setSelected(true); addingMember.setAuthority(addedMember.hasAuthority());
} else { addingMember.setSelected(true);
member.setAuthority(false); }
member.setSelected(false);
} }
addingListModel.addElement(member); addingListModel.addElement(addingMember);
} }
addingList.revalidate(); addingList.revalidate();
addingList.repaint(); addingList.repaint();

4
designer-base/src/main/java/com/fr/design/report/AbstractExportPane.java

@ -1,11 +1,11 @@
package com.fr.design.report; package com.fr.design.report;
import com.fr.design.dialog.BasicPane; import com.fr.design.beans.BasicStorePane;
/** /**
* Created by vito on 16/5/5. * Created by vito on 16/5/5.
*/ */
public abstract class AbstractExportPane extends BasicPane { public abstract class AbstractExportPane extends BasicStorePane<Object> {
public abstract void populate(Object t); public abstract void populate(Object t);

6
designer-base/src/main/java/com/fr/design/update/ui/dialog/EncodingDetect.java

@ -447,11 +447,7 @@ class BytesEncodingDetect extends Encoding {
bfchars++; bfchars++;
totalfreq += 500; totalfreq += 500;
row = rawtext[i] - 0x81; row = rawtext[i] - 0x81;
if (0x40 <= rawtext[i + 1] && rawtext[i + 1] <= 0x7E) { column = rawtext[i + 1] - 0x40;
column = rawtext[i + 1] - 0x40;
} else {
column = rawtext[i + 1] - 0x40;
}
// System.out.println("extended row " + row + " column " + column + " rawtext[i] " + rawtext[i]); // System.out.println("extended row " + row + " column " + column + " rawtext[i] " + rawtext[i]);
if (Big5PFreq[row][column] != 0) { if (Big5PFreq[row][column] != 0) {
bffreq += Big5PFreq[row][column]; bffreq += Big5PFreq[row][column];

4
designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java

@ -91,8 +91,8 @@ public class UpdateMainDialog extends UIDialog {
private static final String UPDATE_CACHE_STATE_FAIL = "fail"; private static final String UPDATE_CACHE_STATE_FAIL = "fail";
private static final String UPDATE_CACHE_STATE_SUCCESS = "success"; private static final String UPDATE_CACHE_STATE_SUCCESS = "success";
private static final SimpleDateFormat CHANGELOG_FORMAT = new SimpleDateFormat("M/d/y, h:m:s a", Locale.ENGLISH); private final SimpleDateFormat CHANGELOG_FORMAT = new SimpleDateFormat("M/d/y, h:m:s a", Locale.ENGLISH);
private static final SimpleDateFormat UPDATE_INFO_TABLE_FORMAT = new SimpleDateFormat("yyyy.MM.dd"); private final SimpleDateFormat UPDATE_INFO_TABLE_FORMAT = new SimpleDateFormat("yyyy.MM.dd");
private JSONObject downloadFileConfig; private JSONObject downloadFileConfig;
//最新版本标签 //最新版本标签

12
designer-base/src/main/java/com/fr/design/upm/UpmBridge.java

@ -443,6 +443,18 @@ public class UpmBridge {
} }
} }
/**
* 立即注册
*/
@JSBridge
public void registerHref() {
try {
Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.register")));
} catch (Exception e) {
FineLoggerFactory.getLogger().info(e.getMessage());
}
}
/** /**
* 使用系统浏览器打开网页 * 使用系统浏览器打开网页
* @param url 要打开的网页 * @param url 要打开的网页

2
designer-base/src/main/java/com/fr/design/utils/DesignUtils.java

@ -56,7 +56,7 @@ public class DesignUtils {
DesignUtils.port = port; DesignUtils.port = port;
} }
public static int getPort() { public synchronized static int getPort() {
return port; return port;
} }

2
designer-base/src/main/java/com/fr/start/BaseDesigner.java

@ -61,6 +61,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
EventDispatcher.listen(DesignerLaunchStatus.DESIGNER_INIT_COMPLETE, new Listener<Null>() { EventDispatcher.listen(DesignerLaunchStatus.DESIGNER_INIT_COMPLETE, new Listener<Null>() {
@Override @Override
public void on(Event event, Null param) { public void on(Event event, Null param) {
EventDispatcher.stopListen(this);
UIUtil.invokeLaterIfNeeded(new Runnable() { UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -75,6 +76,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, new Listener<Null>() { EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, new Listener<Null>() {
@Override @Override
public void on(Event event, Null param) { public void on(Event event, Null param) {
EventDispatcher.stopListen(this);
collectUserInformation(); collectUserInformation();
} }
}); });

5
designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractChartTypeUI.java

@ -5,7 +5,6 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.fun.ChartTypeUIProvider; import com.fr.design.chart.fun.ChartTypeUIProvider;
import com.fr.design.chartx.impl.AbstractDataPane; import com.fr.design.chartx.impl.AbstractDataPane;
import com.fr.design.chartx.impl.AbstractOtherPane; import com.fr.design.chartx.impl.AbstractOtherPane;
import com.fr.design.chartx.impl.DefaultTypePane;
import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.ChartEditPane; import com.fr.design.mainframe.chart.ChartEditPane;
@ -25,9 +24,7 @@ import com.fr.stable.fun.mark.API;
public abstract class AbstractChartTypeUI extends AbstractProvider implements ChartTypeUIProvider { public abstract class AbstractChartTypeUI extends AbstractProvider implements ChartTypeUIProvider {
@Override @Override
public AbstractChartTypePane getPlotTypePane() { public abstract AbstractChartTypePane getPlotTypePane();
return new DefaultTypePane();
}
@Override @Override
public abstract AbstractDataPane getChartDataPane(AttributeChangeListener listener); public abstract AbstractDataPane getChartDataPane(AttributeChangeListener listener);

79
designer-chart/src/main/java/com/fr/design/chartx/impl/DefaultTypePane.java

@ -1,79 +0,0 @@
package com.fr.design.chartx.impl;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chart.impl.AbstractChartWithData;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
/**
* Created by shine on 2019/09/04.
*/
public class DefaultTypePane<T extends AbstractChartWithData> extends AbstractChartTypePane<T> {
@Override
protected String[] getTypeIconPath() {
return ChartTypeInterfaceManager.getInstance().getDemoImagePath(getPlotID());
}
@Override
protected String[] getTypeTipName() {
return ChartTypeInterfaceManager.getInstance().getSubName(getPlotID());
}
@Override
public ChartProvider getDefaultChart() {
return ChartTypeManager.getInstance().getChartTypes(getPlotID())[0];
}
@Override
public String title4PopupWindow() {
return ChartTypeInterfaceManager.getInstance().getName(getPlotID());
}
protected int getSelectIndexInChart(T chart) {
return 0;
}
protected void setSelectIndexInChart(T chart, int index) {
}
@Override
public void populateBean(T ob) {
if (getTypeIconPath().length > 0) {
for (ChartImagePane imagePane : typeDemo) {
imagePane.isPressing = false;
}
typeDemo.get(getSelectIndexInChart(ob)).isPressing = true;
checkDemosBackground();
}
}
@Override
public void updateBean(T ob) {
if (getTypeIconPath().length > 0) {
for (int index = 0, len = typeDemo.size(); index < len; index++) {
if (typeDemo.get(index).isPressing) {
setSelectIndexInChart(ob, index);
return;
}
}
}
}
@Override
protected String[] getTypeLayoutPath() {
return new String[0];
}
@Override
protected String[] getTypeLayoutTipName() {
return new String[0];
}
@Override
protected String getPlotTypeID() {
return null;
}
}

9
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -3,7 +3,6 @@ package com.fr.design.mainframe.chart.gui;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.chart.base.AttrChangeConfig; import com.fr.chart.base.AttrChangeConfig;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.SwitchState;
import com.fr.chart.charttypes.ChartTypeManager; import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chartx.attr.ChartProvider; import com.fr.chartx.attr.ChartProvider;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
@ -187,12 +186,6 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
private void calculateMultiChartMode() { private void calculateMultiChartMode() {
//设置切换功能是否可用 //设置切换功能是否可用
editingCollection.getChangeConfigAttr().setEnable(changeEnable()); editingCollection.getChangeConfigAttr().setEnable(changeEnable());
//多图表切换模式
if (editingCollection.getChartCount() > 1) {
editingCollection.setState(SwitchState.CHANGE);
} else {
editingCollection.setState(SwitchState.DEFAULT);
}
} }
/** /**
@ -363,7 +356,7 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
private void checkConfigButtonVisible() { private void checkConfigButtonVisible() {
addButton.setVisible(ChartTypeManager.enabledChart(editingCollection.getSelectedChartProvider().getID())); addButton.setVisible(ChartTypeManager.enabledChart(editingCollection.getSelectedChartProvider().getID()));
//新建一个collection //新建一个collection
if (editingCollection.getState() == SwitchState.DEFAULT && editingCollection.getSelectedChartProvider() != null) { if (editingCollection.getChartCount() == 1 && editingCollection.getSelectedChartProvider() != null) {
//Chart 不支持图表切换 //Chart 不支持图表切换
configButton.setVisible(supportChange()); configButton.setVisible(supportChange());
} }

3
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -1,7 +1,6 @@
package com.fr.design.mainframe.chart.gui; package com.fr.design.mainframe.chart.gui;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.SwitchState;
import com.fr.chart.charttypes.ChartTypeManager; import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chartx.attr.ChartProvider; import com.fr.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.ChartTypeInterfaceManager;
@ -218,7 +217,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
//第一步就是重构cards //第一步就是重构cards
cards.clear(); cards.clear();
if (enabledChart) { if (enabledChart) {
if (collection.getState() == SwitchState.DEFAULT) { if (collection.getChartCount() == 1) {
addAllCards(); addAllCards();
} else { } else {
addOnePriorityCards(priority); addOnePriorityCards(priority);

73
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java

@ -17,11 +17,11 @@ import com.fr.stable.Constants;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JSeparator; import javax.swing.JSeparator;
import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.util.ArrayList;
import java.util.List;
public abstract class AbstractChartTypePane<T extends ChartProvider> extends FurtherBasicBeanPane<T> { public abstract class AbstractChartTypePane<T extends ChartProvider> extends FurtherBasicBeanPane<T> {
@ -31,7 +31,7 @@ public abstract class AbstractChartTypePane<T extends ChartProvider> extends Fur
protected static final int STYLE_SHADE = 0; protected static final int STYLE_SHADE = 0;
protected static final int STYLE_TRANSPARENT = 1; protected static final int STYLE_TRANSPARENT = 1;
protected static final int STYLE_PLANE3D = 2; protected static final int STYLE_PLANE3D = 2;
protected static final int STYLE_HIGHLIGHT = 3; protected static final int STYLE_HIGHLIGHT = 3;
protected static final int BAIDU = 0; protected static final int BAIDU = 0;
protected static final int GOOGLE = 1; protected static final int GOOGLE = 1;
@ -43,15 +43,24 @@ public abstract class AbstractChartTypePane<T extends ChartProvider> extends Fur
protected JPanel stylePane; //样式布局的面板 protected JPanel stylePane; //样式布局的面板
private JPanel typePane; private JPanel typePane;
protected abstract String[] getTypeIconPath(); protected abstract String[] getTypeIconPath();
protected abstract String[] getTypeTipName(); protected abstract String[] getTypeTipName();
protected abstract String[] getTypeLayoutPath();
protected abstract String[] getTypeLayoutTipName(); protected String[] getTypeLayoutPath() {
return new String[0];
}
protected String[] getTypeLayoutTipName() {
return new String[0];
}
protected int lastStyleIndex = -1; protected int lastStyleIndex = -1;
protected boolean typeChanged = false;//图表类型是否发生变化 protected boolean typeChanged = false;//图表类型是否发生变化
protected String[] getNormalLayoutTipName() { protected String[] getNormalLayoutTipName() {
return new String[] { return new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_TopDownShade"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_TopDownShade"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Transparent"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Transparent"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Plane3D"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Plane3D"),
@ -75,37 +84,37 @@ public abstract class AbstractChartTypePane<T extends ChartProvider> extends Fur
checkDemosBackground(); checkDemosBackground();
typePane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(4); typePane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(4);
for(int i = 0; i < typeDemo.size(); i++) { for (int i = 0; i < typeDemo.size(); i++) {
ChartImagePane tmp = typeDemo.get(i); ChartImagePane tmp = typeDemo.get(i);
typePane.add(tmp); typePane.add(tmp);
tmp.setDemoGroup(typeDemo.toArray(new ChartSelectDemoPane[typeDemo.size()])); tmp.setDemoGroup(typeDemo.toArray(new ChartSelectDemoPane[typeDemo.size()]));
} }
JPanel layoutPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(4); JPanel layoutPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(4);
if(styleList != null && !styleList.isEmpty()) { if (styleList != null && !styleList.isEmpty()) {
for(int i = 0; i < styleList.size(); i ++) { for (int i = 0; i < styleList.size(); i++) {
ChartImagePane tmp = styleList.get(i); ChartImagePane tmp = styleList.get(i);
layoutPane.add(tmp); layoutPane.add(tmp);
tmp.setDemoGroup(styleList.toArray(new ChartSelectDemoPane[styleList.size()])); tmp.setDemoGroup(styleList.toArray(new ChartSelectDemoPane[styleList.size()]));
} }
} }
double[] columnSize = { p, vs, f }; double[] columnSize = {p, vs, f};
double[] rowSize = { p,p,p,p,p,p,p}; double[] rowSize = {p, p, p, p, p, p, p};
if(styleList != null && !styleList.isEmpty()) { if (styleList != null && !styleList.isEmpty()) {
Component[][] styleComp = new Component[][]{ Component[][] styleComp = new Component[][]{
new Component[]{new JSeparator()}, new Component[]{new JSeparator()},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout"))}, new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout"))},
new Component[]{layoutPane}, new Component[]{layoutPane},
}; };
stylePane = TableLayoutHelper.createTableLayoutPane(styleComp,rowSize,columnSize); stylePane = TableLayoutHelper.createTableLayoutPane(styleComp, rowSize, columnSize);
stylePane.setVisible(false); stylePane.setVisible(false);
} }
JPanel panel = TableLayoutHelper.createTableLayoutPane(getPaneComponents(typePane),rowSize,columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(getPaneComponents(typePane), rowSize, columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
} }
protected List<ChartImagePane> createTypeDemoList() { protected List<ChartImagePane> createTypeDemoList() {
@ -120,7 +129,7 @@ public abstract class AbstractChartTypePane<T extends ChartProvider> extends Fur
List<ChartImagePane> list = new ArrayList<ChartImagePane>(); List<ChartImagePane> list = new ArrayList<ChartImagePane>();
int iconLen = iconPaths.length; int iconLen = iconPaths.length;
int tipLen = tipNames.length; int tipLen = tipNames.length;
for(int i = 0, len = Math.min(iconLen, tipLen); i < len; i++) { for (int i = 0, len = Math.min(iconLen, tipLen); i < len; i++) {
boolean isDrawRightLine = (i != len - 1 || (i + 1) % ONE_LINE_NUM != 0); boolean isDrawRightLine = (i != len - 1 || (i + 1) % ONE_LINE_NUM != 0);
ChartImagePane imagePane = new ChartImagePane(iconPaths[i], tipNames[i], isDrawRightLine); ChartImagePane imagePane = new ChartImagePane(iconPaths[i], tipNames[i], isDrawRightLine);
imagePane.isPressing = (i == 0); imagePane.isPressing = (i == 0);
@ -129,7 +138,7 @@ public abstract class AbstractChartTypePane<T extends ChartProvider> extends Fur
return list; return list;
} }
protected Component[][] getPaneComponents(JPanel typePane){ protected Component[][] getPaneComponents(JPanel typePane) {
return new Component[][]{ return new Component[][]{
new Component[]{typePane}, new Component[]{typePane},
new Component[]{stylePane} new Component[]{stylePane}
@ -137,14 +146,14 @@ public abstract class AbstractChartTypePane<T extends ChartProvider> extends Fur
} }
//子类覆盖 //子类覆盖
protected <T extends Plot> T getSelectedClonedPlot(){ protected <T extends Plot> T getSelectedClonedPlot() {
return null; return null;
} }
protected void checkTypeChange(Plot oldPlot){ protected void checkTypeChange(Plot oldPlot) {
if(styleList != null && !styleList.isEmpty()){ if (styleList != null && !styleList.isEmpty()) {
for(int i = 0; i < typeDemo.size(); i++){ for (int i = 0; i < typeDemo.size(); i++) {
if(typeDemo.get(i).isPressing && i != oldPlot.getDetailType()){ if (typeDemo.get(i).isPressing && i != oldPlot.getDetailType()) {
typeChanged = true; typeChanged = true;
break; break;
} }
@ -154,8 +163,8 @@ public abstract class AbstractChartTypePane<T extends ChartProvider> extends Fur
} }
protected void checkDemosBackground() { protected void checkDemosBackground() {
if(this.styleList != null && !styleList.isEmpty()){ if (this.styleList != null && !styleList.isEmpty()) {
for(int i = 0; i < styleList.size(); i++) { for (int i = 0; i < styleList.size(); i++) {
styleList.get(i).checkBorder(); styleList.get(i).checkBorder();
styleList.get(i).repaint(); styleList.get(i).repaint();
} }
@ -177,7 +186,7 @@ public abstract class AbstractChartTypePane<T extends ChartProvider> extends Fur
} }
//图表区属性清空 //图表区属性清空
protected void resetChart(Chart chart){ protected void resetChart(Chart chart) {
chart.setTitle(new Title(chart.getTitle().getTextObject())); chart.setTitle(new Title(chart.getTitle().getTextObject()));
chart.setBorderStyle(Constants.LINE_NONE); chart.setBorderStyle(Constants.LINE_NONE);
chart.setBorderColor(new Color(150, 150, 150)); chart.setBorderColor(new Color(150, 150, 150));
@ -192,20 +201,22 @@ public abstract class AbstractChartTypePane<T extends ChartProvider> extends Fur
/** /**
* 此接口已删除不用实现了 * 此接口已删除不用实现了
* * <p>
* 获取各图表类型界面ID, 本质是plotID * 获取各图表类型界面ID, 本质是plotID
* 使用getPlotID * 使用getPlotID
*
* @return 图表类型界面ID * @return 图表类型界面ID
*/ */
@Deprecated @Deprecated
protected abstract String getPlotTypeID(); protected String getPlotTypeID() {
return null;
}
public String getPlotID() { public String getPlotID() {
return plotID; return plotID;
} }
/** /**
*
* @param ob 对象 * @param ob 对象
* @return * @return
*/ */
@ -216,13 +227,13 @@ public abstract class AbstractChartTypePane<T extends ChartProvider> extends Fur
return false; return false;
} }
protected boolean needsResetChart(Chart chart){ protected boolean needsResetChart(Chart chart) {
return chart != null return chart != null
&&chart.getPlot() != null && chart.getPlot() != null
&& chart.getPlot().getPlotStyle() != ChartConstants.STYLE_NONE; && chart.getPlot().getPlotStyle() != ChartConstants.STYLE_NONE;
} }
protected JPanel getTypePane(){ protected JPanel getTypePane() {
return typePane; return typePane;
} }

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractDeprecatedChartTypePane.java

@ -16,6 +16,7 @@ import com.fr.chart.chartattr.Legend;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartattr.Title; import com.fr.chart.chartattr.Title;
import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.js.NameJavaScriptGroup; import com.fr.js.NameJavaScriptGroup;
@ -38,6 +39,12 @@ public abstract class AbstractDeprecatedChartTypePane extends AbstractChartTypeP
} }
} }
@Override
protected String[] getTypeTipName() {
return ChartTypeInterfaceManager.getInstance().getSubName(getPlotID());
}
/** /**
* 更新界面属性 * 更新界面属性
*/ */

14
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AreaPlotPane.java

@ -32,20 +32,6 @@ public class AreaPlotPane extends AbstractDeprecatedChartTypePane {
}; };
} }
@Override
protected String[] getTypeTipName() {
String area = Toolkit.i18nText("Fine-Design_Chart_Type_Area");
String stack = Toolkit.i18nText("Fine-Design_Chart_Stacked");
String percent = Toolkit.i18nText("Fine-Design_Chart_Use_Percent");
String td = Toolkit.i18nText("Fine-Design_Chart_3D");
return new String[]{
stack + area,
percent + stack + area,
td + stack + area,
td + percent + stack + area
};
}
@Override @Override
protected String getPlotTypeID() { protected String getPlotTypeID() {
return ChartConstants.AREA_CHART; return ChartConstants.AREA_CHART;

17
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/BarPlotPane.java

@ -30,23 +30,6 @@ public class BarPlotPane extends AbstractBarPane{
}; };
} }
@Override
protected String[] getTypeTipName() {
String bar = Toolkit.i18nText("Fine-Design_Chart_Type_Bar");
String stack = Toolkit.i18nText("Fine-Design_Chart_Stacked");
String percent = Toolkit.i18nText("Fine-Design_Chart_Use_Percent");
String td = Toolkit.i18nText("Fine-Design_Chart_3D");
return new String[]{
bar,
stack + bar,
percent + stack + bar,
td + bar,
td + bar + "(" + Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal") + ")",
td + stack + bar,
td + percent + stack + bar
};
}
@Override @Override
protected String[] getTypeLayoutPath() { protected String[] getTypeLayoutPath() {
return new String[]{"/com/fr/design/images/chart/ColumnPlot/layout/0.png", return new String[]{"/com/fr/design/images/chart/ColumnPlot/layout/0.png",

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/BubblePlotPane.java

@ -23,13 +23,6 @@ public class BubblePlotPane extends AbstractDeprecatedChartTypePane {
return new String[]{"/com/fr/design/images/chart/BubblePlot/type/0.png",}; return new String[]{"/com/fr/design/images/chart/BubblePlot/type/0.png",};
} }
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Bubble_Chart_OLD")
};
}
@Override @Override
protected String[] getTypeLayoutPath() { protected String[] getTypeLayoutPath() {
return new String[0]; return new String[0];

17
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ColumnPlotPane.java

@ -29,23 +29,6 @@ public class ColumnPlotPane extends AbstractBarPane{
}; };
} }
@Override
protected String[] getTypeTipName() {
String column = Toolkit.i18nText("Fine-Design_Chart_Type_Column");
String stack = Toolkit.i18nText("Fine-Design_Chart_Stacked");
String percent = Toolkit.i18nText("Fine-Design_Chart_Use_Percent");
String td = Toolkit.i18nText("Fine-Design_Chart_3D");
return new String[]{
column,
stack + column,
percent + stack + column,
td + column,
td + column + "(" + Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal") + ")",
td + stack + column,
td + percent + stack + column
};
}
@Override @Override
protected String[] getTypeLayoutPath() { protected String[] getTypeLayoutPath() {
return new String[]{"/com/fr/design/images/chart/BarPlot/layout/0.png", return new String[]{"/com/fr/design/images/chart/BarPlot/layout/0.png",

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/CustomPlotPane.java

@ -24,13 +24,6 @@ public class CustomPlotPane extends AbstractDeprecatedChartTypePane {
}; };
} }
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Type_Combine")
};
}
@Override @Override
protected String[] getTypeLayoutPath() { protected String[] getTypeLayoutPath() {
return new String[0]; return new String[0];

9
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/DonutPlotPane.java

@ -33,15 +33,6 @@ public class DonutPlotPane extends AbstractDeprecatedChartTypePane {
}; };
} }
@Override
protected String[] getTypeTipName() {
String donut = Toolkit.i18nText("Fine-Design_Chart_Type_Donut");
return new String[]{
donut,
Toolkit.i18nText("Fine-Design_Chart_3D") + donut
};
}
@Override @Override
protected String[] getTypeLayoutPath() { protected String[] getTypeLayoutPath() {
return new String[]{"/com/fr/design/images/chart/DonutPlot/layout/0.png", return new String[]{"/com/fr/design/images/chart/DonutPlot/layout/0.png",

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/FunnelPlotPane.java

@ -28,13 +28,6 @@ public class FunnelPlotPane extends AbstractDeprecatedChartTypePane {
}; };
} }
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Type_Funnel")
};
}
@Override @Override
protected String[] getTypeLayoutPath() { protected String[] getTypeLayoutPath() {
return new String[0]; return new String[0];

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/GanttPlotPane.java

@ -22,13 +22,6 @@ public class GanttPlotPane extends AbstractDeprecatedChartTypePane {
}; };
} }
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Type_Gantt")
};
}
@Override @Override
protected String getPlotTypeID() { protected String getPlotTypeID() {
return ChartConstants.GANTT_CHART; return ChartConstants.GANTT_CHART;

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/GisMapPlotPane.java

@ -27,7 +27,7 @@ public class GisMapPlotPane extends AbstractDeprecatedChartTypePane {
private static final int GISMAP = 0; private static final int GISMAP = 0;
private UITextField keyInput; private UITextField keyInput;
public GisMapPlotPane(){ public GisMapPlotPane(){
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
@ -65,6 +65,11 @@ public class GisMapPlotPane extends AbstractDeprecatedChartTypePane {
} }
@Override
public void reLayout(String chartID){
}
@Override @Override
protected String[] getTypeIconPath() { protected String[] getTypeIconPath() {
return new String[]{"/com/fr/design/images/chart/GisMapPlot/type/0.png", return new String[]{"/com/fr/design/images/chart/GisMapPlot/type/0.png",

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/LinePlotPane.java

@ -19,13 +19,6 @@ public class LinePlotPane extends AbstractDeprecatedChartTypePane {
}; };
} }
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Type_Line")
};
}
@Override @Override
protected String[] getTypeLayoutPath() { protected String[] getTypeLayoutPath() {
return new String[0]; return new String[0];

10
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MeterPlotPane.java

@ -30,16 +30,6 @@ public class MeterPlotPane extends AbstractDeprecatedChartTypePane {
}; };
} }
@Override
protected String[] getTypeTipName() {
String meter = Toolkit.i18nText("Fine-Design_Chart_Type_Meter");
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Mode_Custom") + meter,
meter + "1",
meter + "2"
};
}
@Override @Override
protected String[] getTypeLayoutPath() { protected String[] getTypeLayoutPath() {
return new String[0]; return new String[0];

9
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/PiePlotPane.java

@ -34,15 +34,6 @@ public class PiePlotPane extends AbstractDeprecatedChartTypePane {
}; };
} }
@Override
protected String[] getTypeTipName() {
String pie = Toolkit.i18nText("Fine-Design_Chart_Type_Pie");
return new String[]{
pie,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_3D") + pie
};
}
@Override @Override
protected String[] getTypeLayoutPath() { protected String[] getTypeLayoutPath() {
return new String[]{"/com/fr/design/images/chart/PiePlot/layout/0.png", return new String[]{"/com/fr/design/images/chart/PiePlot/layout/0.png",

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/RadarPlotPane.java

@ -22,13 +22,6 @@ public class RadarPlotPane extends AbstractDeprecatedChartTypePane {
}; };
} }
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Type_Radar")
};
}
@Override @Override
protected String getPlotTypeID() { protected String getPlotTypeID() {
return ChartConstants.RADAR_CHART; return ChartConstants.RADAR_CHART;

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/RangePlotPane.java

@ -23,13 +23,6 @@ public class RangePlotPane extends AbstractDeprecatedChartTypePane {
}; };
} }
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Type_Range")
};
}
@Override @Override
protected String getPlotTypeID() { protected String getPlotTypeID() {
return ChartConstants.RANGE_CHART; return ChartConstants.RANGE_CHART;

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/StockPlotPane.java

@ -22,13 +22,6 @@ public class StockPlotPane extends AbstractDeprecatedChartTypePane {
}; };
} }
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Type_Stock")
};
}
@Override @Override
protected String getPlotTypeID() { protected String getPlotTypeID() {
return ChartConstants.STOCK_CHART; return ChartConstants.STOCK_CHART;

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/XYScatterPlotPane.java

@ -25,13 +25,6 @@ public class XYScatterPlotPane extends AbstractDeprecatedChartTypePane {
}; };
} }
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Type_XYScatter")
};
}
@Override @Override
protected String[] getTypeLayoutPath() { protected String[] getTypeLayoutPath() {
return new String[0]; return new String[0];

20
designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java

@ -1,14 +1,13 @@
package com.fr.design.report; package com.fr.design.report;
import javax.swing.*;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicStorePane;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.ExportAttrTabProvider; import com.fr.design.fun.ExportAttrTabProvider;
import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.io.attr.ReportExportAttr; import com.fr.io.attr.ReportExportAttr;
import javax.swing.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -18,7 +17,7 @@ public class ReportExportAttrPane extends BasicPane {
private ExcelExportPane excelExportPane; private ExcelExportPane excelExportPane;
private PDFExportPane pdfExportPane; private PDFExportPane pdfExportPane;
private WordExportPane wordExportPane; private WordExportPane wordExportPane;
private List<AbstractExportPane> paneList; private List<BasicStorePane<?>> paneList;
public ReportExportAttrPane() { public ReportExportAttrPane() {
UITabbedPane uiTabbedPane = new UITabbedPane(); UITabbedPane uiTabbedPane = new UITabbedPane();
@ -33,8 +32,9 @@ public class ReportExportAttrPane extends BasicPane {
Set<ExportAttrTabProvider> providers = ExtraDesignClassManager.getInstance().getArray(ExportAttrTabProvider.XML_TAG); Set<ExportAttrTabProvider> providers = ExtraDesignClassManager.getInstance().getArray(ExportAttrTabProvider.XML_TAG);
paneList = new ArrayList<>(); paneList = new ArrayList<>();
for (ExportAttrTabProvider provider : providers) { for (ExportAttrTabProvider provider : providers) {
uiTabbedPane.addTab(provider.title(), provider.toSwingComponent()); BasicStorePane<?> storePane = provider.toServiceComponent();
paneList.add(provider.toExportPane()); uiTabbedPane.addTab(storePane.getTitle(), storePane);
paneList.add(storePane);
} }
this.add(uiTabbedPane); this.add(uiTabbedPane);
} }
@ -61,8 +61,8 @@ public class ReportExportAttrPane extends BasicPane {
this.wordExportPane.populate(reportExportAttr.getWordExportAttr()); this.wordExportPane.populate(reportExportAttr.getWordExportAttr());
} }
for (AbstractExportPane exportpane : paneList) { for (BasicStorePane exportpane : paneList) {
exportpane.populate(reportExportAttr); exportpane.populateBean(reportExportAttr);
} }
} }
@ -81,8 +81,8 @@ public class ReportExportAttrPane extends BasicPane {
reportExportAttr.setWordExportAttr(this.wordExportPane.update()); reportExportAttr.setWordExportAttr(this.wordExportPane.update());
} }
for (AbstractExportPane exportPane : paneList) { for (BasicStorePane exportPane : paneList) {
exportPane.update(reportExportAttr); exportPane.updateBean(reportExportAttr);
} }
return reportExportAttr; return reportExportAttr;
} }

1
designer-realize/src/main/java/com/fr/start/DesignerInitial.java

@ -37,6 +37,7 @@ public class DesignerInitial {
EventDispatcher.listen(DesignerLaunchStatus.OPEN_LAST_FILE_COMPLETE, new Listener<Null>() { EventDispatcher.listen(DesignerLaunchStatus.OPEN_LAST_FILE_COMPLETE, new Listener<Null>() {
@Override @Override
public void on(Event event, Null param) { public void on(Event event, Null param) {
EventDispatcher.stopListen(this);
UIUtil.invokeLaterIfNeeded(new Runnable() { UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override @Override
public void run() { public void run() {

16
designer-realize/src/main/java/com/fr/start/SplashContext.java

@ -77,13 +77,15 @@ public class SplashContext {
* 隐藏启动动画 * 隐藏启动动画
*/ */
public void hide() { public void hide() {
// 窗口关闭后取消定时获取模块信息的timer if (splashStrategy != null) {
scheduler.shutdown(); // 窗口关闭后取消定时获取模块信息的timer
//取消监听 scheduler.shutdown();
EventDispatcher.stopListen(listener); //取消监听
splashStrategy.hide(); EventDispatcher.stopListen(listener);
// 一次性 splashStrategy.hide();
splashStrategy = null; // 一次性
splashStrategy = null;
}
} }
private void initListener() { private void initListener() {

42
designer-realize/src/main/java/com/fr/start/common/SplashWindow.java

@ -1,11 +1,19 @@
package com.fr.start.common; package com.fr.start.common;
import com.fr.base.BaseUtils;
import com.fr.design.fun.OemProcessor;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.image4j.codec.ico.ICODecoder;
import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.OperatingSystem;
import com.fr.start.OemHandler;
import com.sun.awt.AWTUtilities; import com.sun.awt.AWTUtilities;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.image.*;
import java.io.IOException;
import java.util.List;
/** /**
* 启动画面窗口 * 启动画面窗口
@ -22,6 +30,8 @@ public class SplashWindow extends JFrame {
// alex:必须设置这个属性为true,才可以用透明背景 // alex:必须设置这个属性为true,才可以用透明背景
System.setProperty("sun.java2d.noddraw", "true"); System.setProperty("sun.java2d.noddraw", "true");
initTitleIcon();
//slash pane //slash pane
this.splash = new SplashPane(); this.splash = new SplashPane();
@ -41,6 +51,32 @@ public class SplashWindow extends JFrame {
GUICoreUtils.centerWindow(this); GUICoreUtils.centerWindow(this);
} }
/**
* 设置任务栏图标主要用于Windows
*/
@SuppressWarnings("unchecked")
private void initTitleIcon() {
try {
OemProcessor oemProcessor = OemHandler.findOem();
List<BufferedImage> image = null;
if (oemProcessor != null) {
try {
image = oemProcessor.createTitleIcon();
} catch (Throwable e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
if (image == null) {
image = ICODecoder.read(SplashWindow.class
.getResourceAsStream("/com/fr/base/images/oem/logo.ico"));
}
this.setIconImages(image);
} catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
this.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png"));
}
}
/** /**
* 注销窗口 * 注销窗口
*/ */
@ -61,10 +97,4 @@ public class SplashWindow extends JFrame {
void updateThanksLog(String text) { void updateThanksLog(String text) {
splash.updateThanksLog(text); splash.updateThanksLog(text);
} }
public static void main(String[] args) {
SplashWindow splashWindow = new SplashWindow();
splashWindow.setVisible(true);
}
} }

25
designer-realize/src/main/java/com/fr/start/module/DesignerInitActivator.java

@ -0,0 +1,25 @@
package com.fr.start.module;
import com.fr.module.Activator;
import com.fr.start.DesignerInitial;
/**
* 设计器界面初始化
*
* @author vito
* @version 10.0
* Created by vito on 2019/9/25
*/
public class DesignerInitActivator extends Activator {
@Override
public void start() {
DesignerInitial.init(findSingleton(StartupArgs.class).get());
}
@Override
public void stop() {
// void
}
}

1
designer-realize/src/main/java/com/fr/start/module/DesignerShowActivator.java

@ -13,7 +13,6 @@ public class DesignerShowActivator extends Activator {
@Override @Override
public void start() { public void start() {
DesignerInitial.init(findSingleton(StartupArgs.class).get());
EventDispatcher.asyncFire(ModuleEvent.MajorModuleStarting, Toolkit.i18nText("Fine-Design_Module_Name_Designer")); EventDispatcher.asyncFire(ModuleEvent.MajorModuleStarting, Toolkit.i18nText("Fine-Design_Module_Name_Designer"));
DesignerInitial.prepare(); DesignerInitial.prepare();
} }

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

@ -70,7 +70,7 @@ public class DesignerStartup extends Activator {
@Metrics @Metrics
public void start() { public void start() {
startSub(PreStartActivator.class); startSub(PreStartActivator.class);
startSub(DesignerWorkspaceActivator.class); startSub("parallel");
//designer模块启动好后,查看demo //designer模块启动好后,查看demo
browserDemoIfNeeded(); browserDemoIfNeeded();
startupEmbedServerIfNeeded(); startupEmbedServerIfNeeded();

Loading…
Cancel
Save