Browse Source

Merge remote-tracking branch 'origin/feature/10.0' into feature/10.0

research/11.0
pengda 5 years ago
parent
commit
e274f292c5
  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. 24
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java
  4. 15
      designer-base/src/main/java/com/fr/design/remote/ui/AbstractManagerPane.java
  5. 9
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  6. 3
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.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();
}

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();

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.chart.base.AttrChangeConfig;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.SwitchState;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.beans.BasicBeanPane;
@ -187,12 +186,6 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
private void calculateMultiChartMode() {
//设置切换功能是否可用
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() {
addButton.setVisible(ChartTypeManager.enabledChart(editingCollection.getSelectedChartProvider().getID()));
//新建一个collection
if (editingCollection.getState() == SwitchState.DEFAULT && editingCollection.getSelectedChartProvider() != null) {
if (editingCollection.getChartCount() == 1 && editingCollection.getSelectedChartProvider() != null) {
//Chart 不支持图表切换
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;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.SwitchState;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager;
@ -218,7 +217,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
//第一步就是重构cards
cards.clear();
if (enabledChart) {
if (collection.getState() == SwitchState.DEFAULT) {
if (collection.getChartCount() == 1) {
addAllCards();
} else {
addOnePriorityCards(priority);

Loading…
Cancel
Save