From aa29abdcfe59a1b68e3d3a6e28d683155a973294 Mon Sep 17 00:00:00 2001 From: "youhong.ai" Date: Tue, 11 Jul 2023 12:20:25 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FileSelectionApp.java | 171 ----------------------- checked.png | Bin 14821 -> 0 bytes src/test/java/BuilderPackageEcology.java | 22 +-- unchecked.png | Bin 14454 -> 0 bytes 4 files changed, 2 insertions(+), 191 deletions(-) delete mode 100644 FileSelectionApp.java delete mode 100644 checked.png delete mode 100644 unchecked.png diff --git a/FileSelectionApp.java b/FileSelectionApp.java deleted file mode 100644 index 38d3f4d..0000000 --- a/FileSelectionApp.java +++ /dev/null @@ -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 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 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); - } - }); - } -} diff --git a/checked.png b/checked.png deleted file mode 100644 index 39ff02bad74a123af54869d2c559b060908bcca8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14821 zcmeHuc|4Tg`?tBxWKfKy@Ue|0M7DhF+mz5^iBt+h6tcu5TVt6iF_mbiY?VrjLS$d2 zOcWxKJu^sCmYG5J?K!vV`#i7L^ZWPtKL7N`{Tl9b=A7%g&UIbqeJyigpPlsvzJK_* zxVSd#-nG+_iwmN_4|*MVGqsz)9DE=`9Ibb7y=a#D!NrB;+P!nTQv`neOW>K_cLnSA z`KeEu4Ib{cIjGlQ_TZIPvQ(se?==VPM5`P7eGSnKS#GC$A)L$MOzE5~0z#rOSR9Fq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treeViewParam -> { @@ -131,6 +119,7 @@ public class BuilderPackageEcology extends Application { functionNameTextField.setText(""); showSuccessAlert("升级包制作成功!"); System.out.println("压缩包位置: " + outputFile.getPath()); + System.out.println(outputFile.getParentFile()); } catch (IOException e) { throw new RuntimeException(e); @@ -163,11 +152,6 @@ public class BuilderPackageEcology extends Application { private TreeItem createTreeItem(FileInfo fileInfo) { TreeItem treeItem = new TreeItem<>(fileInfo); - if (fileInfo.getFileType().equals(FileTreeBuilder.DIRECTORY_TYPE)) { - treeItem.setGraphic(folderIcon); - } else { - treeItem.setGraphic(fileIcon); - } List children = fileInfo.getChildren(); if (children != null) { for (FileInfo child : children) { @@ -225,7 +209,6 @@ public class BuilderPackageEcology extends Application { } else { filePaths.remove(filePath); } - System.out.println(fileInfo.getFilePath()); }); } @@ -237,7 +220,7 @@ public class BuilderPackageEcology extends Application { setGraphic(null); } else { checkBox.setSelected(item.isSelected()); - checkBox.setText(item.getFileName()); + checkBox.setText(item.getFileName().replace("_", "__")); setGraphic(checkBox); // setGraphic(folderIcon); } @@ -258,7 +241,6 @@ public class BuilderPackageEcology extends Application { for (Map.Entry entry : placeholderMap.entrySet()) { String placeholder = "${" + entry.getKey() + "}"; String value = entry.getValue(); - // 检查占位符是否存在于字符串中 if (outputString.indexOf(placeholder) != -1) { // 使用 String 类的 replace 方法进行占位符的替换 diff --git a/unchecked.png b/unchecked.png deleted file mode 100644 index 38a28bed77b5338dfec91dff8150c6517896b78e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14454 zcmeHOXH=6}w@zZB5C(}5z!AitbQHuE5Ril-Wu%NK2q?`FbVLG(lOQdL3K0to3{n&W z;s;m|9aKP&pu_?wMH~UafI$R?5+Wr*Lh_wA=-ltR{Bzg3Kkm9KKUl2y-KRWzzx(Wc z&e=~+d$>6&qF10{FqopVll@K@48ef@(E58f}lm@q}4uV~P}iV4JMC2226D!NBiu_rJ2 z+7mnozP6+Ow}(16cxpD;Hs;4KO#@Z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iIKV+@qQ4? z(*bUSv|N7-Www5kt{HyQMd+Ow7s2_Z12Xl&f(W6RPZs z$k}N#K!7!NXF_Io2EcauN&1eqPRM>04KIAh@IzYS@wPb!c^`|c|X(C|H1uqfM^?<`vkss zY9@v2Fu}P1UVDFuDI_1>oQ9<-|bIVoTAaCXS)g20|7*Ygb1uw_HnmRF0vYaDd zc1LW1rczfhUsq#JZ6KB5+}uK&!yCDm)`mg+u|k9!I<;{fC68ViIHb60cCf=ZA?sPv zo$bKisD#2g0W12?b5s3?Rs?x3{}=97+NW72e^9=ECfuce_9KS|hPFW^TzE7lc{tAu zKrRJLqU7Pdm3DpA2H}#~ihvsb-+O37x=6XTrW56(M Date: Tue, 11 Jul 2023 14:53:11 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../util/CompressPictureUtil.java | 2 +- src/main/java/ln/LNParse.java | 88 ------------------- src/test/java/BuilderPackageEcology.java | 8 +- .../ai/utiltest/ImageComperssorTest.java | 33 +++++++ .../youhong/ai/utiltest/ImageCompressor.java | 2 + 5 files changed, 42 insertions(+), 91 deletions(-) delete mode 100644 src/main/java/ln/LNParse.java create mode 100644 src/test/java/youhong/ai/utiltest/ImageComperssorTest.java diff --git a/src/main/java/com/customization/youhong/taibao/compresspicture/util/CompressPictureUtil.java b/src/main/java/com/customization/youhong/taibao/compresspicture/util/CompressPictureUtil.java index abee6a0..dfdc4a5 100644 --- a/src/main/java/com/customization/youhong/taibao/compresspicture/util/CompressPictureUtil.java +++ b/src/main/java/com/customization/youhong/taibao/compresspicture/util/CompressPictureUtil.java @@ -51,7 +51,7 @@ public class CompressPictureUtil { return compressPNG(image, quality); } else if ("jpeg".equalsIgnoreCase(formatName)) { return compressJPEG(image, quality); - } else if ("bmp".equalsIgnoreCase(fileName)) { + } else if ("bmp".equalsIgnoreCase(formatName)) { return compressBMP(image, quality); } else { return null; diff --git a/src/main/java/ln/LNParse.java b/src/main/java/ln/LNParse.java deleted file mode 100644 index dcf9993..0000000 --- a/src/main/java/ln/LNParse.java +++ /dev/null @@ -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; - } -} diff --git a/src/test/java/BuilderPackageEcology.java b/src/test/java/BuilderPackageEcology.java index 53a71b5..fc9c4e8 100644 --- a/src/test/java/BuilderPackageEcology.java +++ b/src/test/java/BuilderPackageEcology.java @@ -7,6 +7,9 @@ import javafx.application.Application; import javafx.geometry.Insets; import javafx.geometry.Pos; 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.layout.BorderPane; import javafx.scene.layout.HBox; @@ -14,9 +17,11 @@ import javafx.scene.layout.VBox; import javafx.stage.FileChooser; import javafx.stage.Stage; +import java.awt.*; import java.io.File; import java.io.IOException; import java.text.SimpleDateFormat; +import java.util.List; import java.util.*; public class BuilderPackageEcology extends Application { @@ -119,8 +124,7 @@ public class BuilderPackageEcology extends Application { functionNameTextField.setText(""); showSuccessAlert("升级包制作成功!"); System.out.println("压缩包位置: " + outputFile.getPath()); - System.out.println(outputFile.getParentFile()); - + Desktop.getDesktop().open(outputFile.getParentFile()); } catch (IOException e) { throw new RuntimeException(e); } diff --git a/src/test/java/youhong/ai/utiltest/ImageComperssorTest.java b/src/test/java/youhong/ai/utiltest/ImageComperssorTest.java new file mode 100644 index 0000000..3b4f869 --- /dev/null +++ b/src/test/java/youhong/ai/utiltest/ImageComperssorTest.java @@ -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; + +/** + *

图片压缩测试

+ * + *

create: 2023/7/11 14:40

+ * + * @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();// 保存数据 + } +} diff --git a/src/test/java/youhong/ai/utiltest/ImageCompressor.java b/src/test/java/youhong/ai/utiltest/ImageCompressor.java index a3accb0..9f3ff3e 100644 --- a/src/test/java/youhong/ai/utiltest/ImageCompressor.java +++ b/src/test/java/youhong/ai/utiltest/ImageCompressor.java @@ -172,6 +172,8 @@ public class ImageCompressor { // } // } } + + } From 81f02278deedd9e456bff16697e512bfe734d0fb Mon Sep 17 00:00:00 2001 From: "youhong.ai" Date: Tue, 11 Jul 2023 17:19:30 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/java/BuilderPackageEcology.java | 49 ++++- src/test/resources/cf-colors.css | 13 ++ src/test/resources/icons/class.png | Bin 0 -> 487 bytes src/test/resources/icons/code.png | Bin 0 -> 400 bytes src/test/resources/icons/file.png | Bin 14116 -> 286 bytes src/test/resources/icons/folder.png | Bin 13998 -> 289 bytes src/test/resources/icons/jar.png | Bin 0 -> 413 bytes src/test/resources/style.css | 263 ++++++++++++++++++++++- 8 files changed, 312 insertions(+), 13 deletions(-) create mode 100644 src/test/resources/cf-colors.css create mode 100644 src/test/resources/icons/class.png create mode 100644 src/test/resources/icons/code.png create mode 100644 src/test/resources/icons/jar.png diff --git a/src/test/java/BuilderPackageEcology.java b/src/test/java/BuilderPackageEcology.java index fc9c4e8..5dab3d7 100644 --- a/src/test/java/BuilderPackageEcology.java +++ b/src/test/java/BuilderPackageEcology.java @@ -6,11 +6,14 @@ import builderpackage.FileTreeBuilder; import javafx.application.Application; import javafx.geometry.Insets; import javafx.geometry.Pos; +import javafx.scene.Cursor; +import javafx.scene.Node; 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.image.ImageView; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; @@ -36,6 +39,7 @@ public class BuilderPackageEcology extends Application { private TextField packageNumberTextField; private TextField functionNameTextField; + @Override public void start(Stage primaryStage) { primaryStage.setTitle("EBU7部开发一部自动打包工具"); @@ -80,6 +84,10 @@ public class BuilderPackageEcology extends Application { Date date = new Date(); param.put("date", simpleDateFormat.format(date)); Button button = new Button("生成升级包"); + button.setId("create-btn"); + button.setCursor(Cursor.HAND); + button.getStyleClass().add("but"); + button.getStyleClass().add("primary"); button.setOnAction(event -> { // 输出包编号和功能名称的值 String packageNumber = packageNumberTextField.getText(); @@ -136,10 +144,11 @@ public class BuilderPackageEcology extends Application { checkBoxBox.setAlignment(Pos.CENTER_RIGHT); CheckBox checkBox = new CheckBox("是否是信创环境"); + checkBox.setCursor(Cursor.HAND); + checkBox.getStyleClass().add("check-box"); checkBox.selectedProperty().addListener((observable, oldValue, newValue) -> { this.isEcology = newValue; }); - checkBoxBox.getChildren().add(checkBox); @@ -148,7 +157,7 @@ public class BuilderPackageEcology extends Application { Scene scene = new Scene(root, 600, 400); - scene.getStylesheets().add("style.css"); // 加载自定义的 CSS 文件 + scene.getStylesheets().add(getClass().getResource("style.css").toExternalForm()); // 加载自定义的 CSS 文件 scene.getRoot().setStyle("-fx-font-family: 'serif'"); primaryStage.setScene(scene); primaryStage.show(); @@ -202,10 +211,11 @@ public class BuilderPackageEcology extends Application { public CheckBoxTreeCell() { checkBox = new CheckBox(); + checkBox.getStyleClass().add("check-box"); checkBox.selectedProperty().addListener((observable, oldValue, newValue) -> { - FileInfo fileInfo = getItem(); - fileInfo.setSelected(newValue); - String filePath = fileInfo.getFilePath(); + FileInfo item = getItem(); + item.setSelected(newValue); + String filePath = item.getFilePath(); if (newValue) { if (!filePaths.contains(filePath)) { filePaths.add(filePath); @@ -225,6 +235,35 @@ public class BuilderPackageEcology extends Application { } else { checkBox.setSelected(item.isSelected()); 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(folderIcon); } diff --git a/src/test/resources/cf-colors.css b/src/test/resources/cf-colors.css new file mode 100644 index 0000000..09e7599 --- /dev/null +++ b/src/test/resources/cf-colors.css @@ -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; +} \ No newline at end of file diff --git a/src/test/resources/icons/class.png b/src/test/resources/icons/class.png new file mode 100644 index 0000000000000000000000000000000000000000..97352ea11161386703708c28b900e051bb3c384c GIT binary patch literal 487 zcmVPx$p-DtRR7gv`mQ79qK@f#s8RY_V0obr+>xLf_cd+mTCZ1!662`qJF!2nyGZBW3 zcVGh-mK|MxLU<+PSv?*jj$lbsY>RXH!688sggP4TuJto_bpaISN1zT#%yyE{Hb(Fr#Sj zKGTFaNJV32iQHpV$;uLKJZSN8Y05k2+oTVs3GONMq!!6zCA1H;b13mx%002ovPDHLkV1mS_*j@kt literal 0 HcmV?d00001 diff --git a/src/test/resources/icons/code.png b/src/test/resources/icons/code.png new file mode 100644 index 0000000000000000000000000000000000000000..275b427598f87b573eac5c3df9f71cfa85a124fd GIT binary patch literal 400 zcmV;B0dM|^P)Px$N=ZaPR7gu>WEcRz2(oj=iDFkdKJDqWwExxDr-IUairud2F&%JA?d5}aN%G23 z)!yfyAEB7{P@l(}OWW&Dv`pCe^%7bdDjcmXw8GglIw6gWd$NOy0 zzdY=O`?Pz1jswWDQpYI=$gvcppO9W;JHT;DiKWEqrK+X92Xh*V?WZ&l3L&am+IJ{> zf05l(N2*$iFTSt^EiUy$`xK;*iRu6TV*9D!xJL)rf)=EQnfZS`y6=gy6lUSSe~gaU zQYO9x1ab@`<9~Z(iwRmv$U=~h2_+zOiwCEru)GV3Pi(2LiBNoEOX&pT6kkRs6tuYXQe-JPzC8c9JXwm6!kj uGae+@P-67``^Rtq6jE3Va$*diL=6Cp>rN;m{mAzK0000Px#*hxe|R7gwhmQfCZFbsyz?wrYPkHef^3~&HP1So)khyhvM zV3j5%2U!ImYdFYi00$8RoKl0w#kMT~QPX~Yy_@dg#eh)f{1||G9hB<*oV3MS{c6?s zin3^Pz~YhN38N~YG2jr-KFGIYDuF1#SWE#gY2xN8ivnzKk$~{8fHm#A7Im|oO*14= k%J`$2WFNl@aqz&!CyM0P8J6d-KL7v#07*qoM6N<$f+Wv+;Q#;t literal 14116 zcmeHOYgm)lvQ9z*2x!7hs9F*$6y##W8&G3HRK%b{PyuZb5Okxh1;w@o2_XpzK~ySA z!5dI3#Y)RX+e#4#7VrjwVm)9H2(SSW(F71e2+5fhpgZU6{yG27exCf`;ra5dcix#< zv(}nPW~H!wy=NQEGs0jnvsoM0Z^dA6BJ^jd51$OPjLYC3_V8BkwV1+&1^pNd1;bj; z+|CIZY}<7q`1qM$o>-XQ%t|gSiQK*1_~O6?gOQ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=3 za0dw`OjOGL>{oEJ8z4Iq+GCt|k?3b1Mkbq@&S;o~m4^jS-)`BZnZ*M#UiBtb{|^2p zqRX0>O|z@A3o4bi#XU^Z)YgQ8M~o@P^<&GW`iX}&xZ`7*V{xKV;}yiY*SGb6$Ffl$ zC?C_+n5gi^M)`c1_9N>|-(*R%qJM zy^^of&Tn=3k~|q;cpvgB=Y1x2>~_lQ)uALO(nN~`O^oK}jC-{gw};L2R2~1y_k6WY z4m?O=7b<@@?M=3RC9xp2Fy>D&kI`Vtl9{O6CfM^J)Sv+p<*mnm0wq}ov`S^(xc4%P)Px$S4l)cR7gv`R0(pzFbrJ5!xA1-3a==<5J6Jga^Te*L{@oQRNzE0a^&3X z;JMhUSar3ES`z%L=X!fm|4bMNlkcS~<|Woe1-a5Rf9>K@l5? z$n`)r$!U37KRk7F=o3@J{pLn9u(+wx00aw_HL#j;eZjRG$=kOXZw!Rx00000NkvXX Hu0mjf-XX7M literal 0 HcmV?d00001 diff --git a/src/test/resources/style.css b/src/test/resources/style.css index d154fc6..1d86afe 100644 --- a/src/test/resources/style.css +++ b/src/test/resources/style.css @@ -1,22 +1,24 @@ +@import "cf-colors.css"; + + .tree-view { -fx-padding: 10px; + -fx-alignment: center; } .tree-cell { - -fx-padding: 5px; + -fx-padding: 6px; + -fx-font-size: 14px; } -.tree-cell .tree-disclosure-node { - -fx-graphic: url("icons/folder.png"); +.tree-cell.expanded { + -fx-alignment: center; } -.tree-cell .tree-disclosure-node.expanded { - -fx-graphic: url("icons/folder.png"); +.tree-cell:selected { + -fx-background-color: -primary-color; } -.tree-cell .tree-leaf { - -fx-graphic: url("icons/file.png"); -} .button-box { -fx-spacing: 10px; @@ -26,3 +28,248 @@ .checkbox-label { -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%); +} \ No newline at end of file From 13069894aa82b9d4295538d5468cf52f0161a144 Mon Sep 17 00:00:00 2001 From: wangxuanran <3055088966@qq.com> Date: Tue, 11 Jul 2023 17:48:55 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=89=93=E5=8C=85=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=97=A5=E6=9C=9F=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cssc/cms/service/impl/WorkFlowToCmsServiceImpl.java | 4 ---- src/test/java/BuilderPackageEcology.java | 2 +- src/test/java/builderpackage/FileTreeBuilder.java | 8 ++++++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/weaver/xuanran/wang/cssc/cms/service/impl/WorkFlowToCmsServiceImpl.java b/src/main/java/weaver/xuanran/wang/cssc/cms/service/impl/WorkFlowToCmsServiceImpl.java index fd5903e..0c9f67a 100644 --- a/src/main/java/weaver/xuanran/wang/cssc/cms/service/impl/WorkFlowToCmsServiceImpl.java +++ b/src/main/java/weaver/xuanran/wang/cssc/cms/service/impl/WorkFlowToCmsServiceImpl.java @@ -1,18 +1,14 @@ package weaver.xuanran.wang.cssc.cms.service.impl; import aiyh.utils.Util; -import aiyh.utils.excention.CustomerException; import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.log4j.Logger; -import sun.security.krb5.internal.PAData; import weaver.conn.RecordSet; import weaver.conn.RecordSetTrans; import weaver.cssc.workflow.voucher.util.InterfaceLoggerDao; -import weaver.cssc.workflow.voucher.util.VoucherConstants; import weaver.general.TimeUtil; import weaver.soa.workflow.request.RequestInfo; import weaver.xiao.commons.config.entity.RequestMappingConfig; diff --git a/src/test/java/BuilderPackageEcology.java b/src/test/java/BuilderPackageEcology.java index 5dab3d7..a11d4d3 100644 --- a/src/test/java/BuilderPackageEcology.java +++ b/src/test/java/BuilderPackageEcology.java @@ -80,7 +80,7 @@ public class BuilderPackageEcology extends Application { buttonBox.setPadding(new Insets(10)); buttonBox.setAlignment(Pos.CENTER_RIGHT); Map param = new HashMap<>(8); - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(FileTreeBuilder.cusDateFormat); Date date = new Date(); param.put("date", simpleDateFormat.format(date)); Button button = new Button("生成升级包"); diff --git a/src/test/java/builderpackage/FileTreeBuilder.java b/src/test/java/builderpackage/FileTreeBuilder.java index 1471c40..1c964e4 100644 --- a/src/test/java/builderpackage/FileTreeBuilder.java +++ b/src/test/java/builderpackage/FileTreeBuilder.java @@ -2,6 +2,8 @@ package builderpackage; import aiyh.utils.excention.CustomerException; 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.nio.charset.StandardCharsets; @@ -19,6 +21,8 @@ public class FileTreeBuilder { public static String zipDefaultName; public static String defaultDir; + + public static String cusDateFormat; public static FileInfo buildFileTree() { String directoryPath = "target"; @@ -50,6 +54,10 @@ public class FileTreeBuilder { classPath = classRootPath; zipDefaultName = properties.getProperty("zipDefaultName"); defaultDir = properties.getProperty("defaultDir"); + cusDateFormat = properties.getProperty("cusDateFormat"); + if(StrUtil.isBlank(cusDateFormat)){ + cusDateFormat = "yyyyMMdd"; + } List blacklistPrefixes = Arrays.asList( directoryPath + "generated-sources", directoryPath + "generated-test-sources", From a1336d1c29e385e7b5155d7e4d67d4c782efb943 Mon Sep 17 00:00:00 2001 From: "youhong.ai" Date: Tue, 11 Jul 2023 17:54:13 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 7 +------ src/test/java/BuilderPackageEcology.java | 2 +- src/test/resources/style.css | 5 +++-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 5221995..8509d5e 100644 --- a/pom.xml +++ b/pom.xml @@ -130,12 +130,7 @@ easypoi-annotation 4.0.0 - - - org.controlsfx - controlsfx - 8.40.14 - + diff --git a/src/test/java/BuilderPackageEcology.java b/src/test/java/BuilderPackageEcology.java index a11d4d3..f8b912f 100644 --- a/src/test/java/BuilderPackageEcology.java +++ b/src/test/java/BuilderPackageEcology.java @@ -156,7 +156,7 @@ public class BuilderPackageEcology extends Application { root.setBottom(buttonBox); - Scene scene = new Scene(root, 600, 400); + Scene scene = new Scene(root, 600, 600); scene.getStylesheets().add(getClass().getResource("style.css").toExternalForm()); // 加载自定义的 CSS 文件 scene.getRoot().setStyle("-fx-font-family: 'serif'"); primaryStage.setScene(scene); diff --git a/src/test/resources/style.css b/src/test/resources/style.css index 1d86afe..4388a4b 100644 --- a/src/test/resources/style.css +++ b/src/test/resources/style.css @@ -2,12 +2,13 @@ .tree-view { - -fx-padding: 10px; + -fx-padding: 15px; + -fx-start-margin: 5px; -fx-alignment: center; } .tree-cell { - -fx-padding: 6px; + -fx-padding: 0; -fx-font-size: 14px; }