Browse Source

Merge branch 'feature/10.0' of ssh://cloud.finedevelop.com:7999/~zheng/C-design into feature/10.0

research/11.0
shine 5 years ago
parent
commit
d45572b40f
  1. 6
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 20
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  3. 2
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java
  4. 1
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/UpdateActionManager.java
  5. 24
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java
  6. 15
      designer-base/src/main/java/com/fr/design/remote/ui/AbstractManagerPane.java
  7. 6
      designer-base/src/main/java/com/fr/design/update/ui/dialog/EncodingDetect.java
  8. 4
      designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java
  9. 12
      designer-base/src/main/java/com/fr/design/upm/UpmBridge.java
  10. 2
      designer-base/src/main/java/com/fr/design/utils/DesignUtils.java
  11. 2
      designer-base/src/main/java/com/fr/start/BaseDesigner.java
  12. 1
      designer-realize/src/main/java/com/fr/start/DesignerInitial.java
  13. 16
      designer-realize/src/main/java/com/fr/start/SplashContext.java
  14. 25
      designer-realize/src/main/java/com/fr/start/module/DesignerInitActivator.java
  15. 1
      designer-realize/src/main/java/com/fr/start/module/DesignerShowActivator.java
  16. 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;
import com.fr.cluster.engine.base.FineClusterConfig;
import com.fr.cluster.ClusterBridge;
import com.fr.config.Configuration;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.DesignerEnvManager;
@ -307,7 +307,7 @@ public class PreferencePane extends BasicPane {
});
//集群下禁用
if (FineClusterConfig.getInstance().isCluster()) {
if (ClusterBridge.isClusterMode()) {
gcEnableCheckBox.setEnabled(false);
gcButton.setEnabled(false);
}
@ -1050,7 +1050,7 @@ public class PreferencePane extends BasicPane {
if (size > Math.pow(n, 2)) {
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";
}
/**

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

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>() {
@Override
public void on(Event event, Null param) {
EventDispatcher.stopListen(this);
afterStartup = true;
for (Map.Entry<String, UpdateAction> cache : updateActionsIndexCache.entrySet()) {
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;
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.file.HistoryTemplateListCache;
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.border.EmptyBorder;
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.
@ -49,10 +50,10 @@ public class VcsHelper implements JTemplateActionListener {
public final static int OFFSET = 2;
private static final int MINUTE = 60 * 1000;
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() {
return instance;
return INSTANCE;
}
private int containsFolderCounts() {
@ -111,7 +112,7 @@ public class VcsHelper implements JTemplateActionListener {
if (configManager.isSaveCommit() && StringUtils.isNotBlank(entity.getCommitMsg())) {
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() {
@ -125,7 +126,8 @@ public class VcsHelper implements JTemplateActionListener {
* @param jt
*/
public void fireVcs(final JTemplate jt) {
new Thread(new Runnable() {
ExecutorService fireVcs = Executors.newSingleThreadExecutor(new NamedThreadFactory("fireVcs"));
fireVcs.execute(new Runnable() {
@Override
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
public void templateSaved(JTemplate<?, ?> jt) {
if (needInit() && DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable() && !FineClusterConfig.getInstance().isCluster()) {
if (needInit()
&& DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable()
&& !ClusterBridge.isClusterMode()) {
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() {
addingListModel.clear();
for (RemoteDesignMember member : addingMembers) {
for (RemoteDesignMember addingMember : addingMembers) {
// 如果包含在右侧列表中,那么左侧列表默认选中
if (addedMembers.contains(member)) {
member.setAuthority(true);
member.setSelected(true);
} else {
member.setAuthority(false);
member.setSelected(false);
for (RemoteDesignMember addedMember : addedMembers){
if (addingMember.equals(addedMember)){
addingMember.setAuthority(addedMember.hasAuthority());
addingMember.setSelected(true);
}
}
addingListModel.addElement(member);
addingListModel.addElement(addingMember);
}
addingList.revalidate();
addingList.repaint();

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

@ -447,11 +447,7 @@ class BytesEncodingDetect extends Encoding {
bfchars++;
totalfreq += 500;
row = rawtext[i] - 0x81;
if (0x40 <= rawtext[i + 1] && rawtext[i + 1] <= 0x7E) {
column = rawtext[i + 1] - 0x40;
} else {
column = rawtext[i + 1] - 0x40;
}
column = rawtext[i + 1] - 0x40;
// System.out.println("extended row " + row + " column " + column + " rawtext[i] " + rawtext[i]);
if (Big5PFreq[row][column] != 0) {
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_SUCCESS = "success";
private static 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 CHANGELOG_FORMAT = new SimpleDateFormat("M/d/y, h:m:s a", Locale.ENGLISH);
private final SimpleDateFormat UPDATE_INFO_TABLE_FORMAT = new SimpleDateFormat("yyyy.MM.dd");
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 要打开的网页

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

@ -56,7 +56,7 @@ public class DesignUtils {
DesignUtils.port = port;
}
public static int getPort() {
public synchronized static int getPort() {
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>() {
@Override
public void on(Event event, Null param) {
EventDispatcher.stopListen(this);
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
@ -75,6 +76,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, new Listener<Null>() {
@Override
public void on(Event event, Null param) {
EventDispatcher.stopListen(this);
collectUserInformation();
}
});

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>() {
@Override
public void on(Event event, Null param) {
EventDispatcher.stopListen(this);
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {

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

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

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
public void start() {
DesignerInitial.init(findSingleton(StartupArgs.class).get());
EventDispatcher.asyncFire(ModuleEvent.MajorModuleStarting, Toolkit.i18nText("Fine-Design_Module_Name_Designer"));
DesignerInitial.prepare();
}

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

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

Loading…
Cancel
Save