处理冲突
dev
ic_excellent 2023-07-12 10:51:41 +08:00
commit 870d31fa40
18 changed files with 365 additions and 304 deletions

View File

@ -1,171 +0,0 @@
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreePath;
public class FileSelectionApp extends JFrame {
private JTree fileTree;
private JCheckBox[] checkBoxes;
private JLabel statusLabel;
public FileSelectionApp() {
setTitle("文件选择");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(600, 400);
setLocationRelativeTo(null);
// 创建选择按钮
JButton selectButton = new JButton("打包选中的文件或文件夹");
selectButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
selectItems();
}
});
// 创建文件树
fileTree = new JTree(getFileTreeModel());
fileTree.setRootVisible(false);
fileTree.setShowsRootHandles(true);
fileTree.addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
updateStatusLabel();
}
});
JScrollPane treeScrollPane = new JScrollPane(fileTree);
// 创建结果标签
statusLabel = new JLabel();
updateStatusLabel();
// 创建面板并添加组件
JPanel panel = new JPanel(new BorderLayout());
panel.add(selectButton, BorderLayout.NORTH);
panel.add(treeScrollPane, BorderLayout.CENTER);
panel.add(statusLabel, BorderLayout.SOUTH);
// 将面板添加到窗口
add(panel);
}
private DefaultMutableTreeNode getFileTreeModel() {
File targetDir = new File("target/classes/");
DefaultMutableTreeNode root = new DefaultMutableTreeNode(targetDir.getName());
buildFileTree(root, targetDir);
return root;
}
private void buildFileTree(DefaultMutableTreeNode parent, File directory) {
File[] files = directory.listFiles();
if (files != null) {
for (File file : files) {
DefaultMutableTreeNode node = new DefaultMutableTreeNode(file.getName());
parent.add(node);
if (file.isDirectory()) {
buildFileTree(node, file);
}
}
}
}
private void selectItems() {
List<File> selectedFiles = new ArrayList<>();
DefaultMutableTreeNode rootNode = (DefaultMutableTreeNode) fileTree.getModel().getRoot();
Enumeration<?> enumeration = rootNode.breadthFirstEnumeration();
while (enumeration.hasMoreElements()) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) enumeration.nextElement();
if (node.isLeaf() && checkBoxes[node.getLevel()].isSelected()) {
TreePath path = new TreePath(node.getPath());
selectedFiles.add(new File(path.toString().substring(1).replace(", ", "/")));
}
}
if (!selectedFiles.isEmpty()) {
createZipFile(selectedFiles);
} else {
statusLabel.setText("请勾选要打包的文件或文件夹");
}
}
private void createZipFile(List<File> files) {
JFileChooser fileChooser = new JFileChooser();
int result = fileChooser.showSaveDialog(this);
if (result == JFileChooser.APPROVE_OPTION) {
File zipFile = fileChooser.getSelectedFile();
try (ZipOutputStream zipOutputStream = new ZipOutputStream(new FileOutputStream(zipFile))) {
for (File file : files) {
addFileToZip(file, file.getName(), zipOutputStream);
}
statusLabel.setText("已将文件打包为:" + zipFile.getAbsolutePath());
} catch (IOException e) {
statusLabel.setText("打包文件时出现错误:" + e.getMessage());
}
}
}
private void addFileToZip(File file, String entryName, ZipOutputStream zipOutputStream) throws IOException {
if (file.isDirectory()) {
File[] files = file.listFiles();
if (files != null) {
for (File child : files) {
addFileToZip(child, entryName + "/" + child.getName(), zipOutputStream);
}
}
} else {
byte[] buffer = new byte[1024];
FileInputStream fis = new FileInputStream(file);
zipOutputStream.putNextEntry(new ZipEntry(entryName));
int length;
while ((length = fis.read(buffer)) > 0) {
zipOutputStream.write(buffer, 0, length);
}
zipOutputStream.closeEntry();
fis.close();
}
}
private void updateStatusLabel() {
TreePath[] paths = fileTree.getSelectionPaths();
if (paths != null) {
int selectedCount = paths.length;
statusLabel.setText("已选中 " + selectedCount + " 个文件/文件夹");
} else {
statusLabel.setText("");
}
}
public static void main(String[] args) {
// 设置外观和风格
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new FileSelectionApp().setVisible(true);
}
});
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -130,12 +130,7 @@
<artifactId>easypoi-annotation</artifactId> <artifactId>easypoi-annotation</artifactId>
<version>4.0.0</version> <version>4.0.0</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.controlsfx/controlsfx -->
<dependency>
<groupId>org.controlsfx</groupId>
<artifactId>controlsfx</artifactId>
<version>8.40.14</version>
</dependency>
</dependencies> </dependencies>

View File

@ -51,7 +51,7 @@ public class CompressPictureUtil {
return compressPNG(image, quality); return compressPNG(image, quality);
} else if ("jpeg".equalsIgnoreCase(formatName)) { } else if ("jpeg".equalsIgnoreCase(formatName)) {
return compressJPEG(image, quality); return compressJPEG(image, quality);
} else if ("bmp".equalsIgnoreCase(fileName)) { } else if ("bmp".equalsIgnoreCase(formatName)) {
return compressBMP(image, quality); return compressBMP(image, quality);
} else { } else {
return null; return null;

View File

@ -1,88 +0,0 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package ln;
import org.apache.commons.codec.binary.Base64;
import org.json.JSONObject;
import java.security.InvalidKeyException;
public class LNParse {
public LNParse() {
}
public LNBean getLNBean(String licensefilepath, String key) throws Exception {
byte[] licenseFile = Zip.getZipSomeByte(licensefilepath, "license");
byte[] publicKey = Zip.getZipSomeByte(licensefilepath, "publicKey");
byte[] licenseEncryptKey = Zip.getZipSomeByte(licensefilepath, "licenseEncryptKey");
byte[] licenseFile2 = Zip.getZipSomeByte(licensefilepath, "license2");
String realPublicKey = "";
if ("emessage2".equals(key)) {
realPublicKey = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAIJWRm0eoQNEgZB9aUlM1PoT0N7cKCBCfkecycpeKeg57e73Fcj4ik9uYrGB01t38ut45iHJi8TLoeORYuUAhWUCAwEAAQ==";
} else if (!"ecology7".equals(key) && !"ecology8".equals(key)) {
if ("ecology9".equals(key)) {
realPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyC90YpaWPbLaQwqt3TYlRqYC+gDTivXiVU2ZnL+tVop7tm1Ss8gnXnkd1I0jr2ffQK6m4HIGdz4lyxOfJVuT9hwtDpnflxK5fBIpc6N5iB3bZkes3XMJTyXY+afvh7vKf9yW0p1ZgQkMp7Ty4nRNQ1H/JV7RIUohEM24udiZNZySLpIYeAxTl8gR/EKL/YCIxBQfFEyQtijB0+X6Sfd/CWgNGVPuPr8V5nUZm8vXIszWBSPamD/yfvwNI9PAOII7OBNMXOC9BFAjTdCKkxdRS4ovu2V9STxAu0P8hhTnH0/zpxi4VOn32povh4f5J7x5eV+vSaN5G1G1zVPs5lc62QIDAQAB";
}
} else {
realPublicKey = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALUgEZ7eGZmJJM/3Ajj5Zdd2MG1ZONVybJV+v+jQT+csNWBBqxosLVlWvwaod1ix8Gg9GsyRJgoTs1Mg25raZcsCAwEAAQ==";
}
String publicKeyStr = new String(Base64.encodeBase64(publicKey));
if (!realPublicKey.equals(publicKeyStr)) {
throw new Exception("license error!");
} else {
JSONObject jsonLicense;
try {
byte[] licenseKey = RSACoder.decryptByPublicKey(licenseEncryptKey, publicKey);
jsonLicense = new JSONObject(new String(DESCoder.decrypt(licenseFile, licenseKey), "GBK"));
} catch (InvalidKeyException var15) {
var15.printStackTrace();
byte[] licenseInfo2 = DESCoder.decrypt(licenseFile2, key.getBytes());
jsonLicense = new JSONObject(new String(licenseInfo2));
}
LNBean lnb = new LNBean();
lnb.setCompanyname(jsonLicense.getString("companyname"));
lnb.setLicensecode(jsonLicense.getString("licensecode"));
lnb.setHrmnum(jsonLicense.getString("hrmnum"));
// lnb.setExpiredate(jsonLicense.getString("expiredate"));
lnb.setExpiredate("2222-12-31");
lnb.setConcurrentFlag(jsonLicense.getString("concurrentFlag"));
lnb.setLicense(jsonLicense.getString("license"));
try {
lnb.setCid(jsonLicense.getString("cid"));
} catch (Exception var14) {
System.out.println(var14);
}
try {
lnb.setScType(jsonLicense.getString("scType"));
} catch (Exception var13) {
System.out.println(var13);
}
try {
lnb.setScCount(jsonLicense.getString("scCount"));
} catch (Exception var12) {
System.out.println(var12);
}
return lnb;
}
}
public boolean checkLicesne(LNBean lnb) {
boolean returnValue = false;
String src = lnb.getCompanyname() + lnb.getLicensecode() + "ALL" + lnb.getHrmnum() + lnb.getExpiredate() + lnb.getConcurrentFlag();
MD5 md5 = new MD5();
if (lnb.getLicense().equals(md5.getMD5ofStr(src))) {
returnValue = true;
}
return returnValue;
}
}

View File

@ -1,18 +1,14 @@
package weaver.xuanran.wang.cssc.cms.service.impl; package weaver.xuanran.wang.cssc.cms.service.impl;
import aiyh.utils.Util; import aiyh.utils.Util;
import aiyh.utils.excention.CustomerException;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import sun.security.krb5.internal.PAData;
import weaver.conn.RecordSet; import weaver.conn.RecordSet;
import weaver.conn.RecordSetTrans; import weaver.conn.RecordSetTrans;
import weaver.cssc.workflow.voucher.util.InterfaceLoggerDao; import weaver.cssc.workflow.voucher.util.InterfaceLoggerDao;
import weaver.cssc.workflow.voucher.util.VoucherConstants;
import weaver.general.TimeUtil; import weaver.general.TimeUtil;
import weaver.soa.workflow.request.RequestInfo; import weaver.soa.workflow.request.RequestInfo;
import weaver.xiao.commons.config.entity.RequestMappingConfig; import weaver.xiao.commons.config.entity.RequestMappingConfig;

View File

@ -6,10 +6,13 @@ import builderpackage.FileTreeBuilder;
import javafx.application.Application; import javafx.application.Application;
import javafx.geometry.Insets; import javafx.geometry.Insets;
import javafx.geometry.Pos; import javafx.geometry.Pos;
import javafx.scene.Cursor;
import javafx.scene.Node; import javafx.scene.Node;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView; import javafx.scene.image.ImageView;
import javafx.scene.layout.BorderPane; import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox; import javafx.scene.layout.HBox;
@ -17,9 +20,11 @@ import javafx.scene.layout.VBox;
import javafx.stage.FileChooser; import javafx.stage.FileChooser;
import javafx.stage.Stage; import javafx.stage.Stage;
import java.awt.*;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.List;
import java.util.*; import java.util.*;
public class BuilderPackageEcology extends Application { public class BuilderPackageEcology extends Application {
@ -34,20 +39,12 @@ public class BuilderPackageEcology extends Application {
private TextField packageNumberTextField; private TextField packageNumberTextField;
private TextField functionNameTextField; private TextField functionNameTextField;
private final Node folderIcon = new ImageView(
new Image(Objects.requireNonNull(getClass().getResourceAsStream("icons/folder.png")))
);// 定义一个图片类型节点对象
private final Node fileIcon = new ImageView(
new Image(Objects.requireNonNull(getClass().getResourceAsStream("icons/file.png")))
);// 定义一个图片类型节点对象
@Override @Override
public void start(Stage primaryStage) { public void start(Stage primaryStage) {
primaryStage.setTitle("EBU7部开发一部自动打包工具"); primaryStage.setTitle("EBU7部开发一部自动打包工具");
FileInfo fileInfo = FileTreeBuilder.buildFileTree(); FileInfo fileInfo = FileTreeBuilder.buildFileTree();
rootItem = createTreeItem(fileInfo); rootItem = createTreeItem(fileInfo);
treeView = new TreeView<>(rootItem); treeView = new TreeView<>(rootItem);
treeView.setShowRoot(false); treeView.setShowRoot(false);
treeView.setCellFactory(treeViewParam -> { treeView.setCellFactory(treeViewParam -> {
@ -83,10 +80,14 @@ public class BuilderPackageEcology extends Application {
buttonBox.setPadding(new Insets(10)); buttonBox.setPadding(new Insets(10));
buttonBox.setAlignment(Pos.CENTER_RIGHT); buttonBox.setAlignment(Pos.CENTER_RIGHT);
Map<String, String> param = new HashMap<>(8); Map<String, String> param = new HashMap<>(8);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(FileTreeBuilder.cusDateFormat);
Date date = new Date(); Date date = new Date();
param.put("date", simpleDateFormat.format(date)); param.put("date", simpleDateFormat.format(date));
Button button = new Button("生成升级包"); Button button = new Button("生成升级包");
button.setId("create-btn");
button.setCursor(Cursor.HAND);
button.getStyleClass().add("but");
button.getStyleClass().add("primary");
button.setOnAction(event -> { button.setOnAction(event -> {
// 输出包编号和功能名称的值 // 输出包编号和功能名称的值
String packageNumber = packageNumberTextField.getText(); String packageNumber = packageNumberTextField.getText();
@ -131,7 +132,7 @@ public class BuilderPackageEcology extends Application {
functionNameTextField.setText(""); functionNameTextField.setText("");
showSuccessAlert("升级包制作成功!"); showSuccessAlert("升级包制作成功!");
System.out.println("压缩包位置: " + outputFile.getPath()); System.out.println("压缩包位置: " + outputFile.getPath());
Desktop.getDesktop().open(outputFile.getParentFile());
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
@ -143,10 +144,11 @@ public class BuilderPackageEcology extends Application {
checkBoxBox.setAlignment(Pos.CENTER_RIGHT); checkBoxBox.setAlignment(Pos.CENTER_RIGHT);
CheckBox checkBox = new CheckBox("是否是信创环境"); CheckBox checkBox = new CheckBox("是否是信创环境");
checkBox.setCursor(Cursor.HAND);
checkBox.getStyleClass().add("check-box");
checkBox.selectedProperty().addListener((observable, oldValue, newValue) -> { checkBox.selectedProperty().addListener((observable, oldValue, newValue) -> {
this.isEcology = newValue; this.isEcology = newValue;
}); });
checkBoxBox.getChildren().add(checkBox); checkBoxBox.getChildren().add(checkBox);
@ -154,8 +156,8 @@ public class BuilderPackageEcology extends Application {
root.setBottom(buttonBox); root.setBottom(buttonBox);
Scene scene = new Scene(root, 600, 400); Scene scene = new Scene(root, 600, 600);
scene.getStylesheets().add("style.css"); // 加载自定义的 CSS 文件 scene.getStylesheets().add(getClass().getResource("style.css").toExternalForm()); // 加载自定义的 CSS 文件
scene.getRoot().setStyle("-fx-font-family: 'serif'"); scene.getRoot().setStyle("-fx-font-family: 'serif'");
primaryStage.setScene(scene); primaryStage.setScene(scene);
primaryStage.show(); primaryStage.show();
@ -163,11 +165,6 @@ public class BuilderPackageEcology extends Application {
private TreeItem<FileInfo> createTreeItem(FileInfo fileInfo) { private TreeItem<FileInfo> createTreeItem(FileInfo fileInfo) {
TreeItem<FileInfo> treeItem = new TreeItem<>(fileInfo); TreeItem<FileInfo> treeItem = new TreeItem<>(fileInfo);
if (fileInfo.getFileType().equals(FileTreeBuilder.DIRECTORY_TYPE)) {
treeItem.setGraphic(folderIcon);
} else {
treeItem.setGraphic(fileIcon);
}
List<FileInfo> children = fileInfo.getChildren(); List<FileInfo> children = fileInfo.getChildren();
if (children != null) { if (children != null) {
for (FileInfo child : children) { for (FileInfo child : children) {
@ -214,10 +211,11 @@ public class BuilderPackageEcology extends Application {
public CheckBoxTreeCell() { public CheckBoxTreeCell() {
checkBox = new CheckBox(); checkBox = new CheckBox();
checkBox.getStyleClass().add("check-box");
checkBox.selectedProperty().addListener((observable, oldValue, newValue) -> { checkBox.selectedProperty().addListener((observable, oldValue, newValue) -> {
FileInfo fileInfo = getItem(); FileInfo item = getItem();
fileInfo.setSelected(newValue); item.setSelected(newValue);
String filePath = fileInfo.getFilePath(); String filePath = item.getFilePath();
if (newValue) { if (newValue) {
if (!filePaths.contains(filePath)) { if (!filePaths.contains(filePath)) {
filePaths.add(filePath); filePaths.add(filePath);
@ -225,7 +223,6 @@ public class BuilderPackageEcology extends Application {
} else { } else {
filePaths.remove(filePath); filePaths.remove(filePath);
} }
System.out.println(fileInfo.getFilePath());
}); });
} }
@ -237,7 +234,36 @@ public class BuilderPackageEcology extends Application {
setGraphic(null); setGraphic(null);
} else { } else {
checkBox.setSelected(item.isSelected()); checkBox.setSelected(item.isSelected());
checkBox.setText(item.getFileName()); checkBox.setText(item.getFileName().replace("_", "__"));
if (item.isDirectory()) {
Node rootIcon = new ImageView(
new javafx.scene.image.Image(Objects.requireNonNull(getClass().getResourceAsStream("icons/folder.png")))
);// 定义一个图片类型节点对象
checkBox.setGraphic(rootIcon);
} else if (item.getFileName().endsWith(".jar")) {
Node fileIcon = new ImageView(
new javafx.scene.image.Image(Objects.requireNonNull(getClass().getResourceAsStream("icons/jar.png")))
);
checkBox.setGraphic(fileIcon);
} else if (item.getFileName().endsWith(".class")) {
Node fileIcon = new ImageView(
new javafx.scene.image.Image(Objects.requireNonNull(getClass().getResourceAsStream("icons/class.png")))
);
checkBox.setGraphic(fileIcon);
} else if (item.getFileName().endsWith(".properties")) {
Node fileIcon = new ImageView(
new javafx.scene.image.Image(Objects.requireNonNull(getClass().getResourceAsStream("icons/code.png")))
);
checkBox.setGraphic(fileIcon);
} else {
Node fileIcon = new ImageView(
new javafx.scene.image.Image(Objects.requireNonNull(getClass().getResourceAsStream("icons/file.png")))
);
checkBox.setGraphic(fileIcon);
}
checkBox.setCursor(Cursor.HAND);
checkBox.setId("tree-checkbox");
setGraphic(checkBox); setGraphic(checkBox);
// setGraphic(folderIcon); // setGraphic(folderIcon);
} }
@ -258,7 +284,6 @@ public class BuilderPackageEcology extends Application {
for (Map.Entry<String, String> entry : placeholderMap.entrySet()) { for (Map.Entry<String, String> entry : placeholderMap.entrySet()) {
String placeholder = "${" + entry.getKey() + "}"; String placeholder = "${" + entry.getKey() + "}";
String value = entry.getValue(); String value = entry.getValue();
// 检查占位符是否存在于字符串中 // 检查占位符是否存在于字符串中
if (outputString.indexOf(placeholder) != -1) { if (outputString.indexOf(placeholder) != -1) {
// 使用 String 类的 replace 方法进行占位符的替换 // 使用 String 类的 replace 方法进行占位符的替换

View File

@ -2,6 +2,8 @@ package builderpackage;
import aiyh.utils.excention.CustomerException; import aiyh.utils.excention.CustomerException;
import aiyh.utils.tool.cn.hutool.core.util.StrUtil; import aiyh.utils.tool.cn.hutool.core.util.StrUtil;
import org.apache.commons.lang3.StringUtils;
import weaver.common.util.string.StringUtil;
import java.io.*; import java.io.*;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
@ -20,6 +22,8 @@ public class FileTreeBuilder {
public static String defaultDir; public static String defaultDir;
public static String cusDateFormat;
public static FileInfo buildFileTree() { public static FileInfo buildFileTree() {
String directoryPath = "target"; String directoryPath = "target";
String classRootPath = ""; String classRootPath = "";
@ -50,6 +54,10 @@ public class FileTreeBuilder {
classPath = classRootPath; classPath = classRootPath;
zipDefaultName = properties.getProperty("zipDefaultName"); zipDefaultName = properties.getProperty("zipDefaultName");
defaultDir = properties.getProperty("defaultDir"); defaultDir = properties.getProperty("defaultDir");
cusDateFormat = properties.getProperty("cusDateFormat");
if(StrUtil.isBlank(cusDateFormat)){
cusDateFormat = "yyyyMMdd";
}
List<String> blacklistPrefixes = Arrays.asList( List<String> blacklistPrefixes = Arrays.asList(
directoryPath + "generated-sources", directoryPath + "generated-sources",
directoryPath + "generated-test-sources", directoryPath + "generated-test-sources",

View File

@ -0,0 +1,33 @@
package youhong.ai.utiltest;
import basetest.BaseTest;
import com.customization.youhong.taibao.compresspicture.util.CompressPictureUtil;
import org.junit.Test;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
/**
* <h1></h1>
*
* <p>create: 2023/7/11 14:40</p>
*
* @author youHong.ai
*/
public class ImageComperssorTest extends BaseTest {
@Test
public void testee() throws IOException {
InputStream inputStream = CompressPictureUtil.compressImage(new FileInputStream("/Users/aoey.oct.22/Downloads/消息提醒异常.bmp"), "消息异常提醒.bmp", 0.5F);
FileOutputStream fos = new FileOutputStream("/Users/aoey.oct.22/Downloads/消息提醒异常-1.bmp");
byte[] b = new byte[1024];
while ((inputStream.read(b)) != -1) {
fos.write(b);// 写入数据
}
inputStream.close();
fos.close();// 保存数据
}
}

View File

@ -172,6 +172,8 @@ public class ImageCompressor {
// } // }
// } // }
} }
} }

View File

@ -0,0 +1,13 @@
/*颜色*/
* {
-primary-color: #6690FF;
-success-color: #33C651;
-info-color: #52A8F9;
-warn-color: #FFA10A;
-danger-color: #FF4C3F;
-text-color: #303133;
-border-color: #CDD0D6;
-base-color: #F2F3F5;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

View File

@ -1,22 +1,25 @@
@import "cf-colors.css";
.tree-view { .tree-view {
-fx-padding: 10px; -fx-padding: 15px;
-fx-start-margin: 5px;
-fx-alignment: center;
} }
.tree-cell { .tree-cell {
-fx-padding: 5px; -fx-padding: 0;
-fx-font-size: 14px;
} }
.tree-cell .tree-disclosure-node { .tree-cell.expanded {
-fx-graphic: url("icons/folder.png"); -fx-alignment: center;
} }
.tree-cell .tree-disclosure-node.expanded { .tree-cell:selected {
-fx-graphic: url("icons/folder.png"); -fx-background-color: -primary-color;
} }
.tree-cell .tree-leaf {
-fx-graphic: url("icons/file.png");
}
.button-box { .button-box {
-fx-spacing: 10px; -fx-spacing: 10px;
@ -26,3 +29,248 @@
.checkbox-label { .checkbox-label {
-fx-padding: 0 0 0 5px; -fx-padding: 0 0 0 5px;
} }
.check-box {
-fx-cursor: hand;
}
.check-box {
-fx-pref-height: 32px;
}
.check-box .box {
-fx-pref-height: 16px;
-fx-pref-width: 16px;
-fx-border-radius: 3px;
-fx-border-color: -border-color;
-fx-background-color: transparent;
-fx-background-radius: 3px;
}
.check-box .box .mark {
-fx-background-color: rgb(255, 255, 255);
-fx-background-insets: 3px 2px;
-fx-shape: "M369.792 704.32L930.304 128 1024 223.616 369.984 896l-20.288-20.864-0.128 0.128L0 516.8 96.128 423.68l273.664 280.64z";
}
.check-box .container {
-fx-text-fill: -text-color;
-fx-font-size: 14px;
}
.check-box:focused {
-fx-border-color: -primary-color;
}
.check-box:selected {
-fx-text-fill: -primary-color;
}
.check-box:selected .box {
-fx-border-color: -primary-color;
-fx-background-color: -primary-color;
}
.but {
-fx-background-insets: 0;
-fx-border-radius: 3px;
/*-fx-border-color: transparent;*/
-fx-background-radius: 3px;
-fx-pref-height: 32px;
/*-fx-min-height: 32px;*/
-fx-padding: 0px 15px 0px 15px;
-fx-font-size: 14px;
-fx-font-weight: 500;
-fx-text-fill: rgb(255, 255, 255);
-fx-cursor: hand;
}
.but > .ikonli-font-icon {
-fx-icon-size: 17px;
-fx-icon-color: rgb(255, 255, 255);
}
.but.primary {
-fx-background-color: -primary-color;
}
.but.success {
-fx-background-color: -success-color;
}
.but.info {
-fx-background-color: -info-color;
}
.but.warn {
-fx-background-color: -warn-color;
}
.but.danger {
-fx-background-color: -danger-color;
}
/*hover:*/ /*focused:*/
.but.primary:hover, .but.primary:focused {
-fx-background-color: derive(-primary-color, 30%);
}
.but.success:hover, .but.success:focused {
-fx-background-color: derive(-success-color, 30%);
}
.but.info:hover, .but.info:focused {
-fx-background-color: derive(-info-color, 30%);
}
.but.warn:hover, .but.warn:focused {
-fx-background-color: derive(-warn-color, 30%);
}
.but.danger:hover, .but.danger:focused {
-fx-background-color: derive(-danger-color, 30%);
}
/*pressed:*/
.but.primary:pressed {
-fx-background-color: derive(-primary-color, -10%);
}
.but.success:pressed {
-fx-background-color: derive(-success-color, -10%);
}
.but.info:pressed {
-fx-background-color: derive(-info-color, -10%);
}
.but.warn:pressed {
-fx-background-color: derive(-warn-color, -10%);
}
.but.danger:pressed {
-fx-background-color: derive(-danger-color, -10%);
}
/*圆角按钮*/
.but.round {
-fx-border-radius: 16px;
-fx-background-radius: 16px;
}
/*朴素按钮*/
.but.plain, .but.plain:focused {
-fx-background-color: transparent;
}
.but.primary.plain {
-fx-border-color: -primary-color;
-fx-text-fill: -primary-color;
}
.but.success.plain {
-fx-border-color: -success-color;
-fx-text-fill: -success-color;
}
.but.info.plain {
-fx-border-color: -info-color;
-fx-text-fill: -info-color;
}
.but.warn.plain {
-fx-border-color: -warn-color;
-fx-text-fill: -warn-color;
}
.but.danger.plain {
-fx-border-color: -danger-color;
-fx-text-fill: -danger-color;
}
.but.primary.plain > .ikonli-font-icon {
-fx-icon-color: -primary-color;
}
.but.success.plain > .ikonli-font-icon {
-fx-icon-color: -success-color;
}
.but.info.plain > .ikonli-font-icon {
-fx-icon-color: -info-color;
}
.but.warn.plain > .ikonli-font-icon {
-fx-icon-color: -warn-color;
}
.but.danger.plain > .ikonli-font-icon {
-fx-icon-color: -danger-color;
}
.but.primary.plain:hover > .ikonli-font-icon {
-fx-icon-color: rgb(255, 255, 255);
}
.but.success.plain:hover > .ikonli-font-icon {
-fx-icon-color: rgb(255, 255, 255);
}
.but.info.plain:hover > .ikonli-font-icon {
-fx-icon-color: rgb(255, 255, 255);
}
.but.warn.plain:hover > .ikonli-font-icon {
-fx-icon-color: rgb(255, 255, 255);
}
.but.danger.plain:hover > .ikonli-font-icon {
-fx-icon-color: rgb(255, 255, 255);
}
.but.primary.plain:hover {
-fx-background-color: -primary-color;
-fx-text-fill: rgb(255, 255, 255);
}
.but.success.plain:hover {
-fx-background-color: -success-color;
-fx-text-fill: rgb(255, 255, 255);
}
.but.info.plain:hover {
-fx-background-color: -info-color;
-fx-text-fill: rgb(255, 255, 255);
}
.but.warn.plain:hover {
-fx-background-color: -warn-color;
-fx-text-fill: rgb(255, 255, 255);
}
.but.danger.plain:hover {
-fx-background-color: -danger-color;
-fx-text-fill: rgb(255, 255, 255);
}
.but.primary.plain:pressed {
-fx-background-color: derive(-primary-color, -10%);
}
.but.success.plain:pressed {
-fx-background-color: derive(-success-color, -10%);
}
.but.info.plain:pressed {
-fx-background-color: derive(-info-color, -10%);
}
.but.warn.plain:pressed {
-fx-background-color: derive(-warn-color, -10%);
}
.but.danger.plain:pressed {
-fx-background-color: derive(-danger-color, -10%);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB