* commit '60e7ffb8caeffaada30053fd179d73aebc69d0fa': (247 commits) CHART-15187 箱型图面板截断 CHART-16188 柱形图条件属性中增加文本方向button CHART-16171 对富文本内容进行decode REPORT-39914 创建远程工作目录问题 REPORT-39629 组件块显示标题时问号按钮点不到 REPORT-41135 【冒烟】第一次预览数据模板数据集,加载弹窗不消失 【问题原因】这个加载弹窗是个AutoProgressBar进度条,之前的逻辑中,进度条在SwingWorker线程中start并且close,而与进度条显示更新相关的逻辑在EDT中,所以有时候会出现SwingWorker中AutoProgressBar先close掉了,但是AutoProgressBar中还在继续对进度条进行赋值操作,又因为没有设置ProgressMonitor的millsToDecideToPopup,导致赋值操作会进入某个判断分支并使弹窗再度弹出,弹出后就不会自动关闭了 【改动方案】将close操作放入EDT线程中执行(顺便修复一些导包问题与过时方法) CHART-16173 柱形图富文本标签时文本方向调整成横向 REPORT-37609 - 日文版屏蔽更新还原功能 更新:将StoreProcedureDataWrapper中无用的dialog及相关逻辑移除,将原本以dialog为父窗口的两个AutoProgressBar的父窗口也修改为new JFrame(),避免出现二级弹窗被遮盖的问题 更新:将两个SwingWorker合并,将注释掉的代码和多余的逻辑删除 REPORT-40822 存储过程数据集》编辑界面点击预览,预览框出现在编辑界面背面 【问题原因】设计器中,在弹窗的弹窗场景里,如果是使用DesignerContext.getDesignerFrame()获取父弹窗的话有点问题,会造成第二级的弹窗位于第一级弹窗背后。另外这里的预览会有闪屏现象,原因是在StoreProcedureDataWrapper中会在一个SwingWorker中将dialog(测试的时候发现这个dialog一直没有预览数据)置为可见,但是在另一个SwingWorker中又会将其置为不可见,然后在后续逻辑中重新构建一个包含预览数据的弹窗弹出,这样会造成弹窗又开又关又开,闪屏 【改动思路】传入new JFrame()作为父弹窗,就可以保证预览的弹窗在最上层了;关于闪屏,这边改为第一个空白的dialog置为可见那行代码注释掉,然后自己测试,修改前后预览失败的表现基本一致(修改后无闪屏);另外还修改了一些导包问题 REPORT-38778 去掉社区和模板商城的小红点,修正使用工厂类引起的bug,修改预装组件的逻辑 CHART-15747 修改其他交互属性,导致条件属性中的系列名勾选被去掉 CHART-16117 选择富文本编辑器时,不应设置dirty 填充面板时更新初始参数 CHART-15948 富文本编辑器默认内容 REPORT-37609 - 日文版屏蔽更新还原功能 MOBILE-29637 & MOBILE-29634【设计器】tab手势设计变更,取消滑动设置与圆点指示器设置的关联关系 & 【RN】release jar,默认样式tab标题字号变小了 REPORT-37609 - 日文版屏蔽更新还原功能 REPORT-37609 - 日文版屏蔽更新还原功能 ...final/10.0
@ -0,0 +1,106 @@ |
|||||||
|
package com.fr.design.gui.ipasswordfield; |
||||||
|
|
||||||
|
import com.fr.stable.StringUtils; |
||||||
|
import org.jetbrains.annotations.NotNull; |
||||||
|
|
||||||
|
import javax.swing.text.Document; |
||||||
|
import java.awt.event.KeyAdapter; |
||||||
|
import java.awt.event.KeyEvent; |
||||||
|
import java.awt.event.MouseAdapter; |
||||||
|
import java.awt.event.MouseEvent; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Yvan |
||||||
|
* @version 10.0 |
||||||
|
* Created by Yvan on 2020-08-11 |
||||||
|
* 有固定长度的"*"回显的密码框,避免泄露密码长度 |
||||||
|
*/ |
||||||
|
public class UIPasswordFieldWithFixedLength extends UIPassWordField { |
||||||
|
/** |
||||||
|
* 展示密码,为固定8位长度的特殊字符"*"组成 |
||||||
|
*/ |
||||||
|
private static final String DISPLAY_PASSWORD = "********"; |
||||||
|
|
||||||
|
/** |
||||||
|
* 实际密码 |
||||||
|
*/ |
||||||
|
private String realPassword; |
||||||
|
|
||||||
|
/** |
||||||
|
* 用于判断是否清空密码 |
||||||
|
*/ |
||||||
|
private boolean clearPassword; |
||||||
|
|
||||||
|
public UIPasswordFieldWithFixedLength() { |
||||||
|
this(null, null, 0); |
||||||
|
} |
||||||
|
|
||||||
|
public UIPasswordFieldWithFixedLength(String text) { |
||||||
|
this(null, text, 0); |
||||||
|
} |
||||||
|
|
||||||
|
public UIPasswordFieldWithFixedLength(int columns) { |
||||||
|
this(null, null, columns); |
||||||
|
} |
||||||
|
|
||||||
|
public UIPasswordFieldWithFixedLength(String text, int columns) { |
||||||
|
this(null, text, columns); |
||||||
|
} |
||||||
|
|
||||||
|
public UIPasswordFieldWithFixedLength(Document doc, String txt, int columns) { |
||||||
|
super(doc, txt, columns); |
||||||
|
initRealPassword(txt); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 为realPassword赋初值并添加一个鼠标单击事件 |
||||||
|
*/ |
||||||
|
public void initRealPassword(String text) { |
||||||
|
this.realPassword = text == null ? StringUtils.EMPTY : text; |
||||||
|
this.clearPassword = true; |
||||||
|
addShowFixedLengthPasswordListener(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 当鼠标点击密码框,第一次做出键入动作时,清空显示密码与实际密码,用户需要重新输入密码 |
||||||
|
*/ |
||||||
|
private void addShowFixedLengthPasswordListener() { |
||||||
|
this.addMouseListener(new MouseAdapter() { |
||||||
|
@Override |
||||||
|
public void mouseClicked(MouseEvent e) { |
||||||
|
UIPasswordFieldWithFixedLength.this.clearPassword = true; |
||||||
|
} |
||||||
|
}); |
||||||
|
this.addKeyListener(new KeyAdapter() { |
||||||
|
@Override |
||||||
|
public void keyPressed(KeyEvent e) { |
||||||
|
if (clearPassword) { |
||||||
|
UIPasswordFieldWithFixedLength.this.setText(StringUtils.EMPTY); |
||||||
|
UIPasswordFieldWithFixedLength.this.clearPassword = false; |
||||||
|
UIPasswordFieldWithFixedLength.this.updateUI(); |
||||||
|
} |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void setText(@NotNull String t) { |
||||||
|
this.realPassword = t; |
||||||
|
// 看到代码中有些场景是将密码置为空字符串的,所以在这里加个判断
|
||||||
|
if (StringUtils.isEmpty(t)) { |
||||||
|
super.setText(t); |
||||||
|
} else { |
||||||
|
super.setText(DISPLAY_PASSWORD); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public char[] getPassword() { |
||||||
|
//如果用户刚清空密码框,并输入了新密码,则返回输入内容,否则返回realPassword
|
||||||
|
String text = new String(super.getPassword()); |
||||||
|
if (!StringUtils.isEmpty(text) && StringUtils.isEmpty(realPassword)) { |
||||||
|
return text.toCharArray(); |
||||||
|
} |
||||||
|
return realPassword.toCharArray(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,38 @@ |
|||||||
|
package com.fr.design.jdk; |
||||||
|
|
||||||
|
import com.fr.stable.StableUtils; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设计器运行jdk版本 |
||||||
|
* |
||||||
|
* @author hades |
||||||
|
* @version 10.0 |
||||||
|
* Created by hades on 2020/9/27 |
||||||
|
*/ |
||||||
|
public enum JdkVersion { |
||||||
|
|
||||||
|
/** |
||||||
|
* 小于或等于jdk 8 |
||||||
|
*/ |
||||||
|
LE_8 { |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean support() { |
||||||
|
return StableUtils.getMajorJavaVersion() <= 8; |
||||||
|
} |
||||||
|
}, |
||||||
|
|
||||||
|
/** |
||||||
|
* 大于或等于jdk 9 |
||||||
|
*/ |
||||||
|
GE_9 { |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean support() { |
||||||
|
return StableUtils.getMajorJavaVersion() >= 9; |
||||||
|
} |
||||||
|
}; |
||||||
|
|
||||||
|
|
||||||
|
abstract public boolean support(); |
||||||
|
} |
@ -0,0 +1,20 @@ |
|||||||
|
package com.fr.design.mainframe; |
||||||
|
|
||||||
|
import javax.swing.JWindow; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: Yuan.Wang |
||||||
|
* @Date: 2020/10/9 |
||||||
|
* 只关心Window的显示和隐藏操作时可以实现该接口 |
||||||
|
*/ |
||||||
|
public interface PromptWindow { |
||||||
|
/** |
||||||
|
* 显示弹窗 |
||||||
|
*/ |
||||||
|
void showWindow(); |
||||||
|
|
||||||
|
/** |
||||||
|
* 隐藏弹窗 |
||||||
|
*/ |
||||||
|
void hideWindow(); |
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
package com.fr.design.notification; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: Yuan.Wang |
||||||
|
* @Date: 2020/9/27 |
||||||
|
*/ |
||||||
|
public abstract class AbstractSnapChat implements SnapChat { |
||||||
|
@Override |
||||||
|
public boolean hasRead() { |
||||||
|
|
||||||
|
String calcKey = calcKey(); |
||||||
|
Boolean val = SnapChatConfig.getInstance().hasRead(calcKey); |
||||||
|
return val == null ? defaultStatus() : val; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void markRead() { |
||||||
|
|
||||||
|
String calcKey = calcKey(); |
||||||
|
SnapChatConfig.getInstance().markRead(calcKey); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,32 @@ |
|||||||
|
package com.fr.design.notification; |
||||||
|
|
||||||
|
import com.fr.plugin.context.PluginContext; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: Yuan.Wang |
||||||
|
* @Date: 2020/10/10 |
||||||
|
*/ |
||||||
|
public class SnapChatFactory { |
||||||
|
public static SnapChat createSnapChat(boolean defaultStatus, SnapChatKey snapChatKey) { |
||||||
|
return createSnapChat(defaultStatus, snapChatKey, null); |
||||||
|
} |
||||||
|
|
||||||
|
public static SnapChat createSnapChat(boolean defaultStatus, SnapChatKey snapChatKey, PluginContext context) { |
||||||
|
return new AbstractSnapChat() { |
||||||
|
@Override |
||||||
|
public boolean defaultStatus() { |
||||||
|
return defaultStatus; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public SnapChatKey key() { |
||||||
|
return snapChatKey; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String calcKey() { |
||||||
|
return context == null ? key().calc() : key().calc(context); |
||||||
|
} |
||||||
|
}; |
||||||
|
} |
||||||
|
} |
@ -1,9 +1,18 @@ |
|||||||
package com.fr.design.notification; |
package com.fr.design.notification; |
||||||
|
|
||||||
|
import com.fr.plugin.context.PluginContext; |
||||||
|
|
||||||
/** |
/** |
||||||
* created by Harrison on 2020/03/16 |
* created by Harrison on 2020/03/16 |
||||||
**/ |
**/ |
||||||
public interface SnapChatKey { |
public interface SnapChatKey { |
||||||
|
|
||||||
String calc(); |
String calc(); |
||||||
|
|
||||||
|
/** |
||||||
|
* 插件刚被安装时不能通过PluginContexts.getContext()方法获取插件上下文,因此加一个接口 |
||||||
|
*/ |
||||||
|
default String calc(PluginContext context) { |
||||||
|
throw new UnsupportedOperationException(); |
||||||
|
} |
||||||
} |
} |
||||||
|
@ -1,129 +0,0 @@ |
|||||||
package com.fr.design.update.factory; |
|
||||||
|
|
||||||
import com.fr.log.FineLoggerFactory; |
|
||||||
import com.fr.stable.ArrayUtils; |
|
||||||
import com.fr.stable.StableUtils; |
|
||||||
|
|
||||||
import java.io.BufferedInputStream; |
|
||||||
import java.io.BufferedOutputStream; |
|
||||||
import java.io.DataInputStream; |
|
||||||
import java.io.DataOutputStream; |
|
||||||
import java.io.File; |
|
||||||
import java.io.FileFilter; |
|
||||||
import java.io.FileInputStream; |
|
||||||
import java.io.FileOutputStream; |
|
||||||
import java.io.IOException; |
|
||||||
import java.util.Arrays; |
|
||||||
|
|
||||||
/** |
|
||||||
* Created by XINZAI on 2018/8/21. |
|
||||||
*/ |
|
||||||
public class DirectoryOperationFactory { |
|
||||||
/** |
|
||||||
* 新建一个目录 |
|
||||||
* |
|
||||||
* @param dirPath 目录路径 |
|
||||||
*/ |
|
||||||
public static void createNewDirectory(String dirPath) { |
|
||||||
try { |
|
||||||
File newDirPath = new File(dirPath); |
|
||||||
if (!newDirPath.exists()) { |
|
||||||
StableUtils.mkdirs(newDirPath); |
|
||||||
} |
|
||||||
} catch (Exception e) { |
|
||||||
FineLoggerFactory.getLogger().error(e.getMessage()); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 删除目录 |
|
||||||
* |
|
||||||
* @param dirPath 目录路径 |
|
||||||
*/ |
|
||||||
public static void deleteDirectory(String dirPath) { |
|
||||||
try { |
|
||||||
File dir = new File(dirPath); |
|
||||||
if (dir.isDirectory()) { |
|
||||||
File[] file = dir.listFiles(); |
|
||||||
for (File fileTemp : file) { |
|
||||||
deleteDirectory(fileTemp.toString()); |
|
||||||
fileTemp.delete(); |
|
||||||
} |
|
||||||
} else { |
|
||||||
dir.delete(); |
|
||||||
} |
|
||||||
dir.delete(); |
|
||||||
} catch (Exception e) { |
|
||||||
FineLoggerFactory.getLogger().error(e.getMessage()); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 复制目录 |
|
||||||
* |
|
||||||
* @param oldDirPath 被复制目录 |
|
||||||
* @param newDirPath 新目录 |
|
||||||
*/ |
|
||||||
public static void copyDirectory(String oldDirPath, String newDirPath) { |
|
||||||
File oldDir = new File(oldDirPath); |
|
||||||
if (oldDir.isDirectory()) { |
|
||||||
StableUtils.mkdirs(new File(newDirPath)); |
|
||||||
File[] files = oldDir.listFiles(); |
|
||||||
for (File fileTemp : files) { |
|
||||||
copyDirectory(fileTemp.toString(), newDirPath + "/" + fileTemp.getName()); |
|
||||||
} |
|
||||||
} else { |
|
||||||
try { |
|
||||||
copy(oldDirPath, newDirPath); |
|
||||||
} catch (IOException e) { |
|
||||||
FineLoggerFactory.getLogger().error(e.getMessage()); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
private static void copy(String path1, String path2) throws IOException { |
|
||||||
try (DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(path1))); |
|
||||||
DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(path2)))) { |
|
||||||
byte[] date = new byte[in.available()]; |
|
||||||
in.read(date); |
|
||||||
out.write(date); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 移动目录 |
|
||||||
* |
|
||||||
* @param oldDirPath 被移动目录 |
|
||||||
* @param newDirPath 新目录 |
|
||||||
*/ |
|
||||||
public static void moveDirectory(String oldDirPath, String newDirPath) { |
|
||||||
copyDirectory(oldDirPath, newDirPath); |
|
||||||
deleteDirectory(oldDirPath); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 列出过滤后的文件 |
|
||||||
* |
|
||||||
* @param installHome 安装目录 |
|
||||||
* @param backupdir 备份目录 |
|
||||||
* @return String数组 |
|
||||||
*/ |
|
||||||
public static String[] listFilteredFiles(String installHome, String backupdir) { |
|
||||||
File backupDir = new File(StableUtils.pathJoin(installHome, backupdir)); |
|
||||||
StableUtils.mkdirs(backupDir); |
|
||||||
File[] fileNames = backupDir.listFiles(new FileFilter() { |
|
||||||
@Override |
|
||||||
public boolean accept(File pathname) { |
|
||||||
return pathname.isDirectory(); |
|
||||||
} |
|
||||||
}); |
|
||||||
String[] jarFileName = new String[fileNames.length]; |
|
||||||
int j = 0; |
|
||||||
for (File fileName : fileNames) { |
|
||||||
if ((fileName.isDirectory()) && (ArrayUtils.getLength(fileName.listFiles()) > 0)) {//判断备份文件夹中是否为空,为空不显示
|
|
||||||
jarFileName[j++] = fileName.getName(); |
|
||||||
} |
|
||||||
} |
|
||||||
return Arrays.copyOf(jarFileName, j); |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,50 @@ |
|||||||
|
package com.fr.design.update.factory; |
||||||
|
|
||||||
|
import com.fr.decision.update.data.UpdateConstants; |
||||||
|
import com.fr.log.FineLoggerFactory; |
||||||
|
import com.fr.stable.StableUtils; |
||||||
|
|
||||||
|
import java.io.File;; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Bryant |
||||||
|
* @version 10.0 |
||||||
|
* Created by Bryant on 2020-09-29 |
||||||
|
*/ |
||||||
|
public class UpdateFileFactory { |
||||||
|
|
||||||
|
private UpdateFileFactory() { |
||||||
|
} |
||||||
|
|
||||||
|
public static File[] getBackupVersions() { |
||||||
|
File[] versions = null; |
||||||
|
try { |
||||||
|
File backupDir = new File(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR)); |
||||||
|
StableUtils.mkdirs(backupDir); |
||||||
|
versions = backupDir.listFiles(); |
||||||
|
} catch (Exception e) { |
||||||
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
||||||
|
} |
||||||
|
return versions; |
||||||
|
} |
||||||
|
|
||||||
|
public static boolean isBackupVersionsValid(String version) { |
||||||
|
boolean designerValid = false; |
||||||
|
boolean envValid = false; |
||||||
|
try { |
||||||
|
File designerLib = new File(StableUtils.pathJoin(version, UpdateConstants.DESIGNERBACKUPPATH)); |
||||||
|
File[] jars = designerLib.listFiles(); |
||||||
|
if (jars != null && jars.length > 0) { |
||||||
|
designerValid = true; |
||||||
|
} |
||||||
|
File envLib = new File(StableUtils.pathJoin(version, UpdateConstants.BACKUPPATH)); |
||||||
|
jars = envLib.listFiles(); |
||||||
|
if (jars != null && jars.length > 0) { |
||||||
|
envValid = true; |
||||||
|
} |
||||||
|
} catch (Exception e) { |
||||||
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
||||||
|
} |
||||||
|
return designerValid && envValid; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,36 @@ |
|||||||
|
package com.fr.design.update.utils; |
||||||
|
|
||||||
|
import com.fr.design.update.factory.UpdateFileFactory; |
||||||
|
import com.fr.stable.StableUtils; |
||||||
|
|
||||||
|
import java.io.File; |
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Bryant |
||||||
|
* @version 10.0 |
||||||
|
* Created by Bryant on 2020-09-25 |
||||||
|
*/ |
||||||
|
public class UpdateFileUtils { |
||||||
|
/** |
||||||
|
* 列出过滤后的文件 |
||||||
|
* |
||||||
|
* @return String数组 |
||||||
|
*/ |
||||||
|
public static String[] listBackupVersions() { |
||||||
|
File[] versionBackup = UpdateFileFactory.getBackupVersions(); |
||||||
|
List<String> versions = new ArrayList<>(); |
||||||
|
if (versionBackup != null) { |
||||||
|
for (File file : versionBackup) { |
||||||
|
if (UpdateFileFactory.isBackupVersionsValid(file.getAbsolutePath())) { |
||||||
|
versions.add(file.getName()); |
||||||
|
} else { |
||||||
|
StableUtils.deleteFile(file); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
String[] result = new String[versions.size()]; |
||||||
|
return versions.toArray(result); |
||||||
|
} |
||||||
|
} |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 2.7 KiB |
@ -0,0 +1,26 @@ |
|||||||
|
package com.fr.design.data.datapane; |
||||||
|
|
||||||
|
import org.junit.Test; |
||||||
|
|
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
import static org.junit.Assert.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Yyming |
||||||
|
* @version 10.0 |
||||||
|
* Created by Yyming on 2020/9/29 |
||||||
|
*/ |
||||||
|
public class TableDataPaneListPaneTest { |
||||||
|
|
||||||
|
@Test |
||||||
|
public void rename() { |
||||||
|
TableDataPaneListPane listPane = new TableDataPaneListPane(); |
||||||
|
listPane.rename("111", "222"); |
||||||
|
listPane.rename("222", "333"); |
||||||
|
Map<String, String> dsNameChangedMap = listPane.getDsNameChangedMap(); |
||||||
|
assertEquals(1, dsNameChangedMap.size()); |
||||||
|
listPane.rename("333","111"); |
||||||
|
assertEquals(0, dsNameChangedMap.size()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,28 @@ |
|||||||
|
package com.fr.design.update.factory; |
||||||
|
|
||||||
|
import com.fr.decision.update.data.UpdateConstants; |
||||||
|
import com.fr.stable.StableUtils; |
||||||
|
import org.junit.Assert; |
||||||
|
import org.junit.Test; |
||||||
|
|
||||||
|
import java.io.File; |
||||||
|
|
||||||
|
public class UpdateFileFactoryTest { |
||||||
|
|
||||||
|
@Test |
||||||
|
public void testGetBackupVersions() { |
||||||
|
Assert.assertEquals(0, UpdateFileFactory.getBackupVersions().length); |
||||||
|
File backupDir = new File(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR)); |
||||||
|
StableUtils.deleteFile(backupDir); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
public void testIsBackupVersionsValid() { |
||||||
|
File des = new File(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR, "test", UpdateConstants.BACKUPPATH, "test")); |
||||||
|
File env = new File(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR, "test", UpdateConstants.DESIGNERBACKUPPATH, "test")); |
||||||
|
StableUtils.mkdirs(des); |
||||||
|
StableUtils.mkdirs(env); |
||||||
|
Assert.assertTrue(UpdateFileFactory.isBackupVersionsValid(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR, "test"))); |
||||||
|
StableUtils.deleteFile(new File(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR))); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
package com.fr.design.update.utils; |
||||||
|
|
||||||
|
import com.fr.decision.update.data.UpdateConstants; |
||||||
|
import com.fr.stable.StableUtils; |
||||||
|
import org.junit.Assert; |
||||||
|
import org.junit.Test; |
||||||
|
|
||||||
|
import java.io.File; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Bryant |
||||||
|
* @version 10.0 |
||||||
|
* Created by Bryant on 2020-09-25 |
||||||
|
*/ |
||||||
|
public class UpdateFileUtilsTest { |
||||||
|
|
||||||
|
@Test |
||||||
|
public void testListFilteredFiles() { |
||||||
|
File des = new File(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR, "test", UpdateConstants.BACKUPPATH, "test")); |
||||||
|
File env = new File(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR, "test", UpdateConstants.DESIGNERBACKUPPATH, "test")); |
||||||
|
StableUtils.mkdirs(des); |
||||||
|
StableUtils.mkdirs(env); |
||||||
|
String[] result = UpdateFileUtils.listBackupVersions(); |
||||||
|
Assert.assertEquals(1, result.length); |
||||||
|
StableUtils.deleteFile(new File(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNER_BACKUP_DIR))); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,17 @@ |
|||||||
|
package com.fr.van.chart.column; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.design.condition.ConditionAttributesPane; |
||||||
|
import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; |
||||||
|
import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; |
||||||
|
|
||||||
|
public class VanChartColumnLabelConditionPane extends VanChartLabelConditionPane { |
||||||
|
|
||||||
|
public VanChartColumnLabelConditionPane(ConditionAttributesPane conditionAttributesPane, Plot plot) { |
||||||
|
super(conditionAttributesPane, plot); |
||||||
|
} |
||||||
|
|
||||||
|
protected VanChartPlotLabelPane createLabelPane() { |
||||||
|
return new VanChartColumnPlotLabelNoCheckPane(getPlot(),null); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,47 @@ |
|||||||
|
package com.fr.van.chart.column; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
||||||
|
import com.fr.plugin.chart.base.AttrLabelDetail; |
||||||
|
import com.fr.plugin.chart.base.AttrTooltipContent; |
||||||
|
import com.fr.plugin.chart.column.VanChartColumnPlot; |
||||||
|
import com.fr.van.chart.designer.style.VanChartStylePane; |
||||||
|
import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; |
||||||
|
|
||||||
|
public class VanChartColumnPlotLabelDetailPane extends VanChartPlotLabelDetailPane { |
||||||
|
|
||||||
|
public VanChartColumnPlotLabelDetailPane(Plot plot, VanChartStylePane parent) { |
||||||
|
super(plot, parent); |
||||||
|
} |
||||||
|
|
||||||
|
protected boolean hasLabelOrientationPane() { |
||||||
|
return !((VanChartColumnPlot) this.getPlot()).isBar(); |
||||||
|
} |
||||||
|
|
||||||
|
private void checkOrientationEnable(AttrLabelDetail detail) { |
||||||
|
AttrTooltipContent content = detail.getContent(); |
||||||
|
UIButtonGroup<Integer> orientation = getOrientation(); |
||||||
|
|
||||||
|
if (orientation != null && content != null) { |
||||||
|
if (content.isRichText()) { |
||||||
|
|
||||||
|
orientation.setSelectedIndex(HORIZONTAL_INDEX); |
||||||
|
detail.setHorizontal(true); |
||||||
|
|
||||||
|
orientation.setEnabled(false); |
||||||
|
} else { |
||||||
|
orientation.setEnabled(true); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public void populate(AttrLabelDetail detail) { |
||||||
|
super.populate(detail); |
||||||
|
checkOrientationEnable(detail); |
||||||
|
} |
||||||
|
|
||||||
|
public void update(AttrLabelDetail detail) { |
||||||
|
super.update(detail); |
||||||
|
checkOrientationEnable(detail); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
package com.fr.van.chart.column; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.plugin.chart.base.AttrLabel; |
||||||
|
import com.fr.van.chart.designer.style.VanChartStylePane; |
||||||
|
|
||||||
|
import java.awt.BorderLayout; |
||||||
|
|
||||||
|
public class VanChartColumnPlotLabelNoCheckPane extends VanChartColumnPlotLabelPane { |
||||||
|
|
||||||
|
public VanChartColumnPlotLabelNoCheckPane(Plot plot, VanChartStylePane parent) { |
||||||
|
super(plot, parent); |
||||||
|
} |
||||||
|
|
||||||
|
protected void addComponents() { |
||||||
|
this.setLayout(new BorderLayout()); |
||||||
|
this.add(getLabelPane(), BorderLayout.CENTER); |
||||||
|
} |
||||||
|
|
||||||
|
public void populate(AttrLabel attr) { |
||||||
|
super.populate(attr); |
||||||
|
getLabelShowCheckBox().setSelected(true); |
||||||
|
getLabelPane().setVisible(true); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,20 @@ |
|||||||
|
package com.fr.van.chart.column; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.van.chart.designer.style.VanChartStylePane; |
||||||
|
import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; |
||||||
|
|
||||||
|
import java.awt.BorderLayout; |
||||||
|
|
||||||
|
public class VanChartColumnPlotLabelPane extends VanChartPlotLabelPane { |
||||||
|
|
||||||
|
public VanChartColumnPlotLabelPane(Plot plot, VanChartStylePane parent) { |
||||||
|
super(plot, parent); |
||||||
|
} |
||||||
|
|
||||||
|
protected void createLabelPane() { |
||||||
|
VanChartColumnPlotLabelDetailPane labelDetailPane = new VanChartColumnPlotLabelDetailPane(getPlot(), getParentPane()); |
||||||
|
setLabelDetailPane(labelDetailPane); |
||||||
|
getLabelPane().add(labelDetailPane, BorderLayout.CENTER); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
package com.fr.van.chart.designer.component; |
||||||
|
|
||||||
|
import com.fr.design.gui.ilable.UILabel; |
||||||
|
import com.fr.design.i18n.Toolkit; |
||||||
|
import com.fr.design.layout.TableLayout; |
||||||
|
import com.fr.design.layout.TableLayoutHelper; |
||||||
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
||||||
|
|
||||||
|
import javax.swing.JPanel; |
||||||
|
import java.awt.Component; |
||||||
|
|
||||||
|
public class VanChartHtmlLabelPaneWithBackGroundLabel extends VanChartHtmlLabelPane { |
||||||
|
|
||||||
|
protected JPanel createWidthAndHeightPane() { |
||||||
|
double p = TableLayout.PREFERRED; |
||||||
|
double f = TableLayout.FILL; |
||||||
|
double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; |
||||||
|
|
||||||
|
JPanel panel = super.createWidthAndHeightPane(); |
||||||
|
|
||||||
|
Component[][] components = new Component[][]{ |
||||||
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Background")), panel}, |
||||||
|
}; |
||||||
|
|
||||||
|
return TableLayoutHelper.createTableLayoutPane(components, new double[]{p}, new double[]{d, f}); |
||||||
|
} |
||||||
|
} |