diff --git a/console/pom.xml b/console/pom.xml
index 47a9d63e..dfbd01c6 100644
--- a/console/pom.xml
+++ b/console/pom.xml
@@ -18,7 +18,7 @@
UTF-8
UTF-8
1.8
- 2.4
+ 2.4.2
2.4
2.4
2.4
diff --git a/plugins/audio-plugin/pom.xml b/plugins/audio-plugin/pom.xml
index 4b8bfde4..6ac2f111 100644
--- a/plugins/audio-plugin/pom.xml
+++ b/plugins/audio-plugin/pom.xml
@@ -5,18 +5,18 @@
plugins
com.github.hui.media
- 2.4
+ 2.5
4.0.0
audio-plugin
- 2.4
+ 2.5
com.github.hui.media
base-plugin
- 2.4
+ 2.5
diff --git a/plugins/audio-plugin/src/main/java/com/github/hui/quick/plugin/audio/AudioOptions.java b/plugins/audio-plugin/src/main/java/com/github/hui/quick/plugin/audio/AudioOptions.java
index 3c077597..a3365ecf 100644
--- a/plugins/audio-plugin/src/main/java/com/github/hui/quick/plugin/audio/AudioOptions.java
+++ b/plugins/audio-plugin/src/main/java/com/github/hui/quick/plugin/audio/AudioOptions.java
@@ -6,7 +6,8 @@
/**
* Created by yihui on 2017/7/13.
*/
-public class AudioOptions {
+public class
+AudioOptions {
private String cmd = "ffmpeg -i ";
diff --git a/plugins/audio-plugin/src/main/java/com/github/hui/quick/plugin/audio/AudioWrapper.java b/plugins/audio-plugin/src/main/java/com/github/hui/quick/plugin/audio/AudioWrapper.java
index acf5deac..b23c926e 100644
--- a/plugins/audio-plugin/src/main/java/com/github/hui/quick/plugin/audio/AudioWrapper.java
+++ b/plugins/audio-plugin/src/main/java/com/github/hui/quick/plugin/audio/AudioWrapper.java
@@ -3,10 +3,9 @@
import com.github.hui.quick.plugin.base.FileReadUtil;
import com.github.hui.quick.plugin.base.FileWriteUtil;
import com.github.hui.quick.plugin.base.ProcessUtil;
-import lombok.extern.slf4j.Slf4j;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-import java.io.File;
-import java.io.FileInputStream;
import java.io.InputStream;
import java.net.URI;
import java.util.HashMap;
@@ -17,9 +16,10 @@
*
* Created by yihui on 2017/7/13.
*/
-@Slf4j
public class AudioWrapper {
+ private static final Logger log = LoggerFactory.getLogger(AudioWrapper.class);
+
public static Builder of(String str) {
return new Builder().setSource(str);
}
diff --git a/plugins/base-plugin/pom.xml b/plugins/base-plugin/pom.xml
index 05f8f233..52e235b4 100644
--- a/plugins/base-plugin/pom.xml
+++ b/plugins/base-plugin/pom.xml
@@ -5,12 +5,12 @@
plugins
com.github.hui.media
- 2.4
+ 2.5
4.0.0
base-plugin
- 2.4
+ 2.5
@@ -18,17 +18,12 @@
org.apache.commons
commons-lang3
-
- org.projectlombok
- lombok
-
org.slf4j
slf4j-api
-
org.apache.httpcomponents
httpclient
diff --git a/plugins/base-plugin/src/main/java/com/github/hui/quick/plugin/base/FileWriteUtil.java b/plugins/base-plugin/src/main/java/com/github/hui/quick/plugin/base/FileWriteUtil.java
index 4009aaaf..99daa549 100644
--- a/plugins/base-plugin/src/main/java/com/github/hui/quick/plugin/base/FileWriteUtil.java
+++ b/plugins/base-plugin/src/main/java/com/github/hui/quick/plugin/base/FileWriteUtil.java
@@ -1,22 +1,21 @@
package com.github.hui.quick.plugin.base;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.*;
import java.net.URI;
import java.util.Date;
+import java.util.Objects;
import java.util.Random;
/**
* Created by yihui on 2017/7/13.
*/
-@Slf4j
public class FileWriteUtil {
+ private static final Logger log = LoggerFactory.getLogger(FileWriteUtil.class);
public static String TEMP_PATH = "/tmp/quickmedia/";
@@ -279,9 +278,6 @@ private static void extraFileName(String fileName, FileInfo fileInfo) {
}
}
- @Data
- @NoArgsConstructor
- @AllArgsConstructor
public static class FileInfo {
/**
* 文件所在的目录
@@ -300,10 +296,67 @@ public static class FileInfo {
*/
private String fileType;
+ public FileInfo() {
+ }
+
+ public FileInfo(String path, String filename, String fileType) {
+ this.path = path;
+ this.filename = filename;
+ this.fileType = fileType;
+ }
public String getAbsFile() {
return path + "/" + filename + "." + fileType;
}
+
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ public String getFilename() {
+ return filename;
+ }
+
+ public void setFilename(String filename) {
+ this.filename = filename;
+ }
+
+ public String getFileType() {
+ return fileType;
+ }
+
+ public void setFileType(String fileType) {
+ this.fileType = fileType;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FileInfo fileInfo = (FileInfo) o;
+ return Objects.equals(path, fileInfo.path) && Objects.equals(filename, fileInfo.filename) &&
+ Objects.equals(fileType, fileInfo.fileType);
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(path, filename, fileType);
+ }
+
+ @Override
+ public String toString() {
+ return "FileInfo{" + "path='" + path + '\'' + ", filename='" + filename + '\'' + ", fileType='" + fileType +
+ '\'' + '}';
+ }
}
diff --git a/plugins/base-plugin/src/main/java/com/github/hui/quick/plugin/base/HttpUtil.java b/plugins/base-plugin/src/main/java/com/github/hui/quick/plugin/base/HttpUtil.java
index 50f5cfb7..b6111325 100644
--- a/plugins/base-plugin/src/main/java/com/github/hui/quick/plugin/base/HttpUtil.java
+++ b/plugins/base-plugin/src/main/java/com/github/hui/quick/plugin/base/HttpUtil.java
@@ -1,11 +1,12 @@
package com.github.hui.quick.plugin.base;
-import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.client.fluent.Request;
import org.apache.http.client.utils.URIUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -15,9 +16,8 @@
/**
* Created by yihui on 2017/7/13.
*/
-@Slf4j
public class HttpUtil {
-
+ private static Logger log = LoggerFactory.getLogger(HttpUtil.class);
public static InputStream downFile(String src) throws IOException {
return downFile(URI.create(src));
diff --git a/plugins/base-plugin/src/main/java/com/github/hui/quick/plugin/base/ProcessUtil.java b/plugins/base-plugin/src/main/java/com/github/hui/quick/plugin/base/ProcessUtil.java
index 4a1db9fc..876ce58d 100644
--- a/plugins/base-plugin/src/main/java/com/github/hui/quick/plugin/base/ProcessUtil.java
+++ b/plugins/base-plugin/src/main/java/com/github/hui/quick/plugin/base/ProcessUtil.java
@@ -1,6 +1,7 @@
package com.github.hui.quick.plugin.base;
-import lombok.extern.slf4j.Slf4j;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.BufferedReader;
import java.io.IOException;
@@ -12,8 +13,8 @@
/**
* Created by yihui on 2017/7/13.
*/
-@Slf4j
public class ProcessUtil {
+ private static Logger log = LoggerFactory.getLogger(ProcessUtil.class);
/**
* Buffer size of process input-stream (used for reading the
diff --git a/plugins/date-plugin/pom.xml b/plugins/date-plugin/pom.xml
index 35229ea6..db599ab7 100644
--- a/plugins/date-plugin/pom.xml
+++ b/plugins/date-plugin/pom.xml
@@ -5,12 +5,12 @@
plugins
com.github.hui.media
- 2.4
+ 2.5
4.0.0
date-plugin
- 2.4
+ 2.5
@@ -18,11 +18,6 @@
org.apache.commons
commons-lang3
-
- org.projectlombok
- lombok
-
-
org.slf4j
slf4j-api
diff --git a/plugins/date-plugin/src/main/java/com/github/hui/quick/plugin/date/ChineseDateTool.java b/plugins/date-plugin/src/main/java/com/github/hui/quick/plugin/date/ChineseDateTool.java
index 40c9eaf3..7ad3f733 100644
--- a/plugins/date-plugin/src/main/java/com/github/hui/quick/plugin/date/ChineseDateTool.java
+++ b/plugins/date-plugin/src/main/java/com/github/hui/quick/plugin/date/ChineseDateTool.java
@@ -1,8 +1,6 @@
package com.github.hui.quick.plugin.date;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
+import java.util.Objects;
/**
* 源码参考: http://blog.csdn.net/mexican_jacky/article/details/51537571
@@ -10,48 +8,51 @@
* Created by yihui on 2017/9/17.
*/
public class ChineseDateTool {
- /*
+ /*
* |----4位闰月|-------------13位1为30天,0为29天|
*/
- private static int[] lunar_month_days = { 1887, 0x1694, 0x16aa, 0x4ad5, 0xab6, 0xc4b7, 0x4ae, 0xa56, 0xb52a, 0x1d2a,
- 0xd54, 0x75aa, 0x156a, 0x1096d, 0x95c, 0x14ae, 0xaa4d, 0x1a4c, 0x1b2a, 0x8d55, 0xad4, 0x135a, 0x495d, 0x95c,
- 0xd49b, 0x149a, 0x1a4a, 0xbaa5, 0x16a8, 0x1ad4, 0x52da, 0x12b6, 0xe937, 0x92e, 0x1496, 0xb64b, 0xd4a, 0xda8,
- 0x95b5, 0x56c, 0x12ae, 0x492f, 0x92e, 0xcc96, 0x1a94, 0x1d4a, 0xada9, 0xb5a, 0x56c, 0x726e, 0x125c, 0xf92d,
- 0x192a, 0x1a94, 0xdb4a, 0x16aa, 0xad4, 0x955b, 0x4ba, 0x125a, 0x592b, 0x152a, 0xf695, 0xd94, 0x16aa, 0xaab5,
- 0x9b4, 0x14b6, 0x6a57, 0xa56, 0x1152a, 0x1d2a, 0xd54, 0xd5aa, 0x156a, 0x96c, 0x94ae, 0x14ae, 0xa4c, 0x7d26,
- 0x1b2a, 0xeb55, 0xad4, 0x12da, 0xa95d, 0x95a, 0x149a, 0x9a4d, 0x1a4a, 0x11aa5, 0x16a8, 0x16d4, 0xd2da,
- 0x12b6, 0x936, 0x9497, 0x1496, 0x1564b, 0xd4a, 0xda8, 0xd5b4, 0x156c, 0x12ae, 0xa92f, 0x92e, 0xc96, 0x6d4a,
- 0x1d4a, 0x10d65, 0xb58, 0x156c, 0xb26d, 0x125c, 0x192c, 0x9a95, 0x1a94, 0x1b4a, 0x4b55, 0xad4, 0xf55b,
- 0x4ba, 0x125a, 0xb92b, 0x152a, 0x1694, 0x96aa, 0x15aa, 0x12ab5, 0x974, 0x14b6, 0xca57, 0xa56, 0x1526,
- 0x8e95, 0xd54, 0x15aa, 0x49b5, 0x96c, 0xd4ae, 0x149c, 0x1a4c, 0xbd26, 0x1aa6, 0xb54, 0x6d6a, 0x12da,
- 0x1695d, 0x95a, 0x149a, 0xda4b, 0x1a4a, 0x1aa4, 0xbb54, 0x16b4, 0xada, 0x495b, 0x936, 0xf497, 0x1496,
- 0x154a, 0xb6a5, 0xda4, 0x15b4, 0x6ab6, 0x126e, 0x1092f, 0x92e, 0xc96, 0xcd4a, 0x1d4a, 0xd64, 0x956c, 0x155c,
- 0x125c, 0x792e, 0x192c, 0xfa95, 0x1a94, 0x1b4a, 0xab55, 0xad4, 0x14da, 0x8a5d, 0xa5a, 0x1152b, 0x152a,
- 0x1694, 0xd6aa, 0x15aa, 0xab4, 0x94ba, 0x14b6, 0xa56, 0x7527, 0xd26, 0xee53, 0xd54, 0x15aa, 0xa9b5, 0x96c,
- 0x14ae, 0x8a4e, 0x1a4c, 0x11d26, 0x1aa4, 0x1b54, 0xcd6a, 0xada, 0x95c, 0x949d, 0x149a, 0x1a2a, 0x5b25,
- 0x1aa4, 0xfb52, 0x16b4, 0xaba, 0xa95b, 0x936, 0x1496, 0x9a4b, 0x154a, 0x136a5, 0xda4, 0x15ac };
-
- private static int[] solar_1_1 = { 1887, 0xec04c, 0xec23f, 0xec435, 0xec649, 0xec83e, 0xeca51, 0xecc46, 0xece3a,
- 0xed04d, 0xed242, 0xed436, 0xed64a, 0xed83f, 0xeda53, 0xedc48, 0xede3d, 0xee050, 0xee244, 0xee439, 0xee64d,
- 0xee842, 0xeea36, 0xeec4a, 0xeee3e, 0xef052, 0xef246, 0xef43a, 0xef64e, 0xef843, 0xefa37, 0xefc4b, 0xefe41,
- 0xf0054, 0xf0248, 0xf043c, 0xf0650, 0xf0845, 0xf0a38, 0xf0c4d, 0xf0e42, 0xf1037, 0xf124a, 0xf143e, 0xf1651,
- 0xf1846, 0xf1a3a, 0xf1c4e, 0xf1e44, 0xf2038, 0xf224b, 0xf243f, 0xf2653, 0xf2848, 0xf2a3b, 0xf2c4f, 0xf2e45,
- 0xf3039, 0xf324d, 0xf3442, 0xf3636, 0xf384a, 0xf3a3d, 0xf3c51, 0xf3e46, 0xf403b, 0xf424e, 0xf4443, 0xf4638,
- 0xf484c, 0xf4a3f, 0xf4c52, 0xf4e48, 0xf503c, 0xf524f, 0xf5445, 0xf5639, 0xf584d, 0xf5a42, 0xf5c35, 0xf5e49,
- 0xf603e, 0xf6251, 0xf6446, 0xf663b, 0xf684f, 0xf6a43, 0xf6c37, 0xf6e4b, 0xf703f, 0xf7252, 0xf7447, 0xf763c,
- 0xf7850, 0xf7a45, 0xf7c39, 0xf7e4d, 0xf8042, 0xf8254, 0xf8449, 0xf863d, 0xf8851, 0xf8a46, 0xf8c3b, 0xf8e4f,
- 0xf9044, 0xf9237, 0xf944a, 0xf963f, 0xf9853, 0xf9a47, 0xf9c3c, 0xf9e50, 0xfa045, 0xfa238, 0xfa44c, 0xfa641,
- 0xfa836, 0xfaa49, 0xfac3d, 0xfae52, 0xfb047, 0xfb23a, 0xfb44e, 0xfb643, 0xfb837, 0xfba4a, 0xfbc3f, 0xfbe53,
- 0xfc048, 0xfc23c, 0xfc450, 0xfc645, 0xfc839, 0xfca4c, 0xfcc41, 0xfce36, 0xfd04a, 0xfd23d, 0xfd451, 0xfd646,
- 0xfd83a, 0xfda4d, 0xfdc43, 0xfde37, 0xfe04b, 0xfe23f, 0xfe453, 0xfe648, 0xfe83c, 0xfea4f, 0xfec44, 0xfee38,
- 0xff04c, 0xff241, 0xff436, 0xff64a, 0xff83e, 0xffa51, 0xffc46, 0xffe3a, 0x10004e, 0x100242, 0x100437,
- 0x10064b, 0x100841, 0x100a53, 0x100c48, 0x100e3c, 0x10104f, 0x101244, 0x101438, 0x10164c, 0x101842,
- 0x101a35, 0x101c49, 0x101e3d, 0x102051, 0x102245, 0x10243a, 0x10264e, 0x102843, 0x102a37, 0x102c4b,
- 0x102e3f, 0x103053, 0x103247, 0x10343b, 0x10364f, 0x103845, 0x103a38, 0x103c4c, 0x103e42, 0x104036,
- 0x104249, 0x10443d, 0x104651, 0x104846, 0x104a3a, 0x104c4e, 0x104e43, 0x105038, 0x10524a, 0x10543e,
- 0x105652, 0x105847, 0x105a3b, 0x105c4f, 0x105e45, 0x106039, 0x10624c, 0x106441, 0x106635, 0x106849,
- 0x106a3d, 0x106c51, 0x106e47, 0x10703c, 0x10724f, 0x107444, 0x107638, 0x10784c, 0x107a3f, 0x107c53,
- 0x107e48 };
+ private static int[] lunar_month_days =
+ {1887, 0x1694, 0x16aa, 0x4ad5, 0xab6, 0xc4b7, 0x4ae, 0xa56, 0xb52a, 0x1d2a, 0xd54, 0x75aa, 0x156a, 0x1096d,
+ 0x95c, 0x14ae, 0xaa4d, 0x1a4c, 0x1b2a, 0x8d55, 0xad4, 0x135a, 0x495d, 0x95c, 0xd49b, 0x149a, 0x1a4a,
+ 0xbaa5, 0x16a8, 0x1ad4, 0x52da, 0x12b6, 0xe937, 0x92e, 0x1496, 0xb64b, 0xd4a, 0xda8, 0x95b5, 0x56c,
+ 0x12ae, 0x492f, 0x92e, 0xcc96, 0x1a94, 0x1d4a, 0xada9, 0xb5a, 0x56c, 0x726e, 0x125c, 0xf92d, 0x192a,
+ 0x1a94, 0xdb4a, 0x16aa, 0xad4, 0x955b, 0x4ba, 0x125a, 0x592b, 0x152a, 0xf695, 0xd94, 0x16aa, 0xaab5,
+ 0x9b4, 0x14b6, 0x6a57, 0xa56, 0x1152a, 0x1d2a, 0xd54, 0xd5aa, 0x156a, 0x96c, 0x94ae, 0x14ae, 0xa4c,
+ 0x7d26, 0x1b2a, 0xeb55, 0xad4, 0x12da, 0xa95d, 0x95a, 0x149a, 0x9a4d, 0x1a4a, 0x11aa5, 0x16a8,
+ 0x16d4, 0xd2da, 0x12b6, 0x936, 0x9497, 0x1496, 0x1564b, 0xd4a, 0xda8, 0xd5b4, 0x156c, 0x12ae,
+ 0xa92f, 0x92e, 0xc96, 0x6d4a, 0x1d4a, 0x10d65, 0xb58, 0x156c, 0xb26d, 0x125c, 0x192c, 0x9a95,
+ 0x1a94, 0x1b4a, 0x4b55, 0xad4, 0xf55b, 0x4ba, 0x125a, 0xb92b, 0x152a, 0x1694, 0x96aa, 0x15aa,
+ 0x12ab5, 0x974, 0x14b6, 0xca57, 0xa56, 0x1526, 0x8e95, 0xd54, 0x15aa, 0x49b5, 0x96c, 0xd4ae, 0x149c,
+ 0x1a4c, 0xbd26, 0x1aa6, 0xb54, 0x6d6a, 0x12da, 0x1695d, 0x95a, 0x149a, 0xda4b, 0x1a4a, 0x1aa4,
+ 0xbb54, 0x16b4, 0xada, 0x495b, 0x936, 0xf497, 0x1496, 0x154a, 0xb6a5, 0xda4, 0x15b4, 0x6ab6, 0x126e,
+ 0x1092f, 0x92e, 0xc96, 0xcd4a, 0x1d4a, 0xd64, 0x956c, 0x155c, 0x125c, 0x792e, 0x192c, 0xfa95,
+ 0x1a94, 0x1b4a, 0xab55, 0xad4, 0x14da, 0x8a5d, 0xa5a, 0x1152b, 0x152a, 0x1694, 0xd6aa, 0x15aa,
+ 0xab4, 0x94ba, 0x14b6, 0xa56, 0x7527, 0xd26, 0xee53, 0xd54, 0x15aa, 0xa9b5, 0x96c, 0x14ae, 0x8a4e,
+ 0x1a4c, 0x11d26, 0x1aa4, 0x1b54, 0xcd6a, 0xada, 0x95c, 0x949d, 0x149a, 0x1a2a, 0x5b25, 0x1aa4,
+ 0xfb52, 0x16b4, 0xaba, 0xa95b, 0x936, 0x1496, 0x9a4b, 0x154a, 0x136a5, 0xda4, 0x15ac};
+
+ private static int[] solar_1_1 =
+ {1887, 0xec04c, 0xec23f, 0xec435, 0xec649, 0xec83e, 0xeca51, 0xecc46, 0xece3a, 0xed04d, 0xed242, 0xed436,
+ 0xed64a, 0xed83f, 0xeda53, 0xedc48, 0xede3d, 0xee050, 0xee244, 0xee439, 0xee64d, 0xee842, 0xeea36,
+ 0xeec4a, 0xeee3e, 0xef052, 0xef246, 0xef43a, 0xef64e, 0xef843, 0xefa37, 0xefc4b, 0xefe41, 0xf0054,
+ 0xf0248, 0xf043c, 0xf0650, 0xf0845, 0xf0a38, 0xf0c4d, 0xf0e42, 0xf1037, 0xf124a, 0xf143e, 0xf1651,
+ 0xf1846, 0xf1a3a, 0xf1c4e, 0xf1e44, 0xf2038, 0xf224b, 0xf243f, 0xf2653, 0xf2848, 0xf2a3b, 0xf2c4f,
+ 0xf2e45, 0xf3039, 0xf324d, 0xf3442, 0xf3636, 0xf384a, 0xf3a3d, 0xf3c51, 0xf3e46, 0xf403b, 0xf424e,
+ 0xf4443, 0xf4638, 0xf484c, 0xf4a3f, 0xf4c52, 0xf4e48, 0xf503c, 0xf524f, 0xf5445, 0xf5639, 0xf584d,
+ 0xf5a42, 0xf5c35, 0xf5e49, 0xf603e, 0xf6251, 0xf6446, 0xf663b, 0xf684f, 0xf6a43, 0xf6c37, 0xf6e4b,
+ 0xf703f, 0xf7252, 0xf7447, 0xf763c, 0xf7850, 0xf7a45, 0xf7c39, 0xf7e4d, 0xf8042, 0xf8254, 0xf8449,
+ 0xf863d, 0xf8851, 0xf8a46, 0xf8c3b, 0xf8e4f, 0xf9044, 0xf9237, 0xf944a, 0xf963f, 0xf9853, 0xf9a47,
+ 0xf9c3c, 0xf9e50, 0xfa045, 0xfa238, 0xfa44c, 0xfa641, 0xfa836, 0xfaa49, 0xfac3d, 0xfae52, 0xfb047,
+ 0xfb23a, 0xfb44e, 0xfb643, 0xfb837, 0xfba4a, 0xfbc3f, 0xfbe53, 0xfc048, 0xfc23c, 0xfc450, 0xfc645,
+ 0xfc839, 0xfca4c, 0xfcc41, 0xfce36, 0xfd04a, 0xfd23d, 0xfd451, 0xfd646, 0xfd83a, 0xfda4d, 0xfdc43,
+ 0xfde37, 0xfe04b, 0xfe23f, 0xfe453, 0xfe648, 0xfe83c, 0xfea4f, 0xfec44, 0xfee38, 0xff04c, 0xff241,
+ 0xff436, 0xff64a, 0xff83e, 0xffa51, 0xffc46, 0xffe3a, 0x10004e, 0x100242, 0x100437, 0x10064b,
+ 0x100841, 0x100a53, 0x100c48, 0x100e3c, 0x10104f, 0x101244, 0x101438, 0x10164c, 0x101842, 0x101a35,
+ 0x101c49, 0x101e3d, 0x102051, 0x102245, 0x10243a, 0x10264e, 0x102843, 0x102a37, 0x102c4b, 0x102e3f,
+ 0x103053, 0x103247, 0x10343b, 0x10364f, 0x103845, 0x103a38, 0x103c4c, 0x103e42, 0x104036, 0x104249,
+ 0x10443d, 0x104651, 0x104846, 0x104a3a, 0x104c4e, 0x104e43, 0x105038, 0x10524a, 0x10543e, 0x105652,
+ 0x105847, 0x105a3b, 0x105c4f, 0x105e45, 0x106039, 0x10624c, 0x106441, 0x106635, 0x106849, 0x106a3d,
+ 0x106c51, 0x106e47, 0x10703c, 0x10724f, 0x107444, 0x107638, 0x10784c, 0x107a3f, 0x107c53, 0x107e48};
private static int getBitInt(int data, int length, int shift) {
return (data & (((1 << length) - 1) << shift)) >> shift;
@@ -162,9 +163,6 @@ public static Lunar solarToLunar(Solar solar) {
}
// 农历
- @Data
- @NoArgsConstructor
- @AllArgsConstructor
public static class Lunar {
/**
* 是否为闰月
@@ -186,17 +184,137 @@ public static class Lunar {
* 日
*/
private int lunarDay;
+
+ public Lunar() {
+ }
+
+ public Lunar(boolean isleap, int lunarYear, int lunarMonth, int lunarDay) {
+ this.isleap = isleap;
+ this.lunarYear = lunarYear;
+ this.lunarMonth = lunarMonth;
+ this.lunarDay = lunarDay;
+ }
+
+ public boolean isIsleap() {
+ return isleap;
+ }
+
+ public void setIsleap(boolean isleap) {
+ this.isleap = isleap;
+ }
+
+ public int getLunarYear() {
+ return lunarYear;
+ }
+
+ public void setLunarYear(int lunarYear) {
+ this.lunarYear = lunarYear;
+ }
+
+ public int getLunarMonth() {
+ return lunarMonth;
+ }
+
+ public void setLunarMonth(int lunarMonth) {
+ this.lunarMonth = lunarMonth;
+ }
+
+ public int getLunarDay() {
+ return lunarDay;
+ }
+
+ public void setLunarDay(int lunarDay) {
+ this.lunarDay = lunarDay;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Lunar lunar = (Lunar) o;
+ return isleap == lunar.isleap && lunarYear == lunar.lunarYear && lunarMonth == lunar.lunarMonth &&
+ lunarDay == lunar.lunarDay;
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(isleap, lunarYear, lunarMonth, lunarDay);
+ }
+
+ @Override
+ public String toString() {
+ return "Lunar{" + "isleap=" + isleap + ", lunarYear=" + lunarYear + ", lunarMonth=" + lunarMonth +
+ ", lunarDay=" + lunarDay + '}';
+ }
}
// 公历
- @Data
- @NoArgsConstructor
- @AllArgsConstructor
public static class Solar {
private int solarYear;
private int solarMonth;
private int solarDay;
+
+ public Solar(int solarYear, int solarMonth, int solarDay) {
+ this.solarYear = solarYear;
+ this.solarMonth = solarMonth;
+ this.solarDay = solarDay;
+ }
+
+ public Solar() {
+ }
+
+ public int getSolarYear() {
+ return solarYear;
+ }
+
+ public void setSolarYear(int solarYear) {
+ this.solarYear = solarYear;
+ }
+
+ public int getSolarMonth() {
+ return solarMonth;
+ }
+
+ public void setSolarMonth(int solarMonth) {
+ this.solarMonth = solarMonth;
+ }
+
+ public int getSolarDay() {
+ return solarDay;
+ }
+
+ public void setSolarDay(int solarDay) {
+ this.solarDay = solarDay;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Solar solar = (Solar) o;
+ return solarYear == solar.solarYear && solarMonth == solar.solarMonth && solarDay == solar.solarDay;
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(solarYear, solarMonth, solarDay);
+ }
+
+ @Override
+ public String toString() {
+ return "Solar{" + "solarYear=" + solarYear + ", solarMonth=" + solarMonth + ", solarDay=" + solarDay + '}';
+ }
}
}
diff --git a/plugins/image-plugin/pom.xml b/plugins/image-plugin/pom.xml
index e799e71d..667a4857 100644
--- a/plugins/image-plugin/pom.xml
+++ b/plugins/image-plugin/pom.xml
@@ -5,18 +5,18 @@
plugins
com.github.hui.media
- 2.4
+ 2.5
4.0.0
image-plugin
- 2.4
+ 2.5
com.github.hui.media
base-plugin
- 2.4
+ 2.5
diff --git a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/create/ImgCreateOptions.java b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/create/ImgCreateOptions.java
index 575e4c28..c98e9f0f 100644
--- a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/create/ImgCreateOptions.java
+++ b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/create/ImgCreateOptions.java
@@ -1,19 +1,14 @@
package com.github.hui.quick.plugin.image.wrapper.create;
-import lombok.Data;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.HashMap;
import java.util.Map;
+import java.util.Objects;
/**
* Created by yihui on 2017/8/16.
*/
-@Data
public class ImgCreateOptions {
public static final Font DEFAULT_FONT = new Font("宋体", Font.PLAIN, 18);
@@ -76,7 +71,6 @@ public class ImgCreateOptions {
*
* 水平绘制时: 左对齐,居中, 右对齐
* 垂直绘制时: 上对齐,居中,下对齐
- *
*/
private AlignStyle alignStyle;
@@ -86,17 +80,139 @@ public class ImgCreateOptions {
*/
private DrawStyle drawStyle;
+ public BufferedImage getBgImg() {
+ return bgImg;
+ }
+
+ public void setBgImg(BufferedImage bgImg) {
+ this.bgImg = bgImg;
+ }
+
+ public Integer getImgW() {
+ return imgW;
+ }
+
+ public void setImgW(Integer imgW) {
+ this.imgW = imgW;
+ }
+
+ public Integer getImgH() {
+ return imgH;
+ }
+
+ public void setImgH(Integer imgH) {
+ this.imgH = imgH;
+ }
+
+ public Font getFont() {
+ return font;
+ }
+
+ public void setFont(Font font) {
+ this.font = font;
+ }
+
+ public Color getFontColor() {
+ return fontColor;
+ }
+
+ public void setFontColor(Color fontColor) {
+ this.fontColor = fontColor;
+ }
+
+ public int getLeftPadding() {
+ return leftPadding;
+ }
+
+ public void setLeftPadding(int leftPadding) {
+ this.leftPadding = leftPadding;
+ }
+
+ public int getRightPadding() {
+ return rightPadding;
+ }
+
+ public void setRightPadding(int rightPadding) {
+ this.rightPadding = rightPadding;
+ }
+
+ public int getTopPadding() {
+ return topPadding;
+ }
+
+ public void setTopPadding(int topPadding) {
+ this.topPadding = topPadding;
+ }
+
+ public int getBottomPadding() {
+ return bottomPadding;
+ }
+
+ public void setBottomPadding(int bottomPadding) {
+ this.bottomPadding = bottomPadding;
+ }
+
+ public int getLinePadding() {
+ return linePadding;
+ }
+
+ public void setLinePadding(int linePadding) {
+ this.linePadding = linePadding;
+ }
+
+ public AlignStyle getAlignStyle() {
+ return alignStyle;
+ }
+
+ public void setAlignStyle(AlignStyle alignStyle) {
+ this.alignStyle = alignStyle;
+ }
+
+ public DrawStyle getDrawStyle() {
+ return drawStyle;
+ }
+
+ public void setDrawStyle(DrawStyle drawStyle) {
+ this.drawStyle = drawStyle;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ImgCreateOptions that = (ImgCreateOptions) o;
+ return leftPadding == that.leftPadding && rightPadding == that.rightPadding && topPadding == that.topPadding &&
+ bottomPadding == that.bottomPadding && linePadding == that.linePadding &&
+ Objects.equals(bgImg, that.bgImg) && Objects.equals(imgW, that.imgW) &&
+ Objects.equals(imgH, that.imgH) && Objects.equals(font, that.font) &&
+ Objects.equals(fontColor, that.fontColor) && alignStyle == that.alignStyle &&
+ drawStyle == that.drawStyle;
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(bgImg, imgW, imgH, font, fontColor, leftPadding, rightPadding, topPadding, bottomPadding,
+ linePadding, alignStyle, drawStyle);
+ }
+
+ @Override
+ public String toString() {
+ return "ImgCreateOptions{" + "bgImg=" + bgImg + ", imgW=" + imgW + ", imgH=" + imgH + ", font=" + font +
+ ", fontColor=" + fontColor + ", leftPadding=" + leftPadding + ", rightPadding=" + rightPadding +
+ ", topPadding=" + topPadding + ", bottomPadding=" + bottomPadding + ", linePadding=" + linePadding +
+ ", alignStyle=" + alignStyle + ", drawStyle=" + drawStyle + '}';
+ }
/**
* 对齐方式
*/
public enum AlignStyle {
- LEFT,
- CENTER,
- RIGHT,
- TOP,
- BOTTOM
- ;
+ LEFT, CENTER, RIGHT, TOP, BOTTOM;
private static Map map = new HashMap<>();
@@ -124,10 +240,8 @@ public static AlignStyle getStyle(String name) {
*/
public enum DrawStyle {
// 垂直绘制,从左到右
- VERTICAL_LEFT,
- // 垂直绘制,从右到左
- VERTICAL_RIGHT,
- // 水平绘制
+ VERTICAL_LEFT, // 垂直绘制,从右到左
+ VERTICAL_RIGHT, // 水平绘制
HORIZONTAL;
diff --git a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/create/ImgCreateWrapper.java b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/create/ImgCreateWrapper.java
index c7d48fc0..8676982c 100644
--- a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/create/ImgCreateWrapper.java
+++ b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/create/ImgCreateWrapper.java
@@ -7,9 +7,9 @@
import com.github.hui.quick.plugin.base.ImageLoadUtil;
import com.github.hui.quick.plugin.image.helper.CalculateHelper;
import com.github.hui.quick.plugin.image.helper.ImgDrawHelper;
-import lombok.Getter;
-import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.awt.*;
import java.awt.image.BufferedImage;
@@ -18,16 +18,16 @@
/**
* Created by yihui on 2017/8/16.
*/
-@Slf4j
public class ImgCreateWrapper {
+ private static final Logger log = LoggerFactory.getLogger(ImgCreateWrapper.class);
+
public static Builder build() {
return new Builder();
}
- @Getter
public static class Builder {
/**
* 生成的图片创建参数
@@ -226,6 +226,53 @@ public Builder setDrawStyle(ImgCreateOptions.DrawStyle drawStyle) {
return this;
}
+ public ImgCreateOptions getOptions() {
+ return options;
+ }
+
+ public BufferedImage getResult() {
+ return result;
+ }
+
+ public int getContentH() {
+ return contentH;
+ }
+
+ public int getContentW() {
+ return contentW;
+ }
+
+ public Color getBgColor() {
+ return bgColor;
+ }
+
+ public boolean isBorder() {
+ return border;
+ }
+
+ public Color getBorderColor() {
+ return borderColor;
+ }
+
+ public BufferedImage getBorderImage() {
+ return borderImage;
+ }
+
+ public int getBorderTopPadding() {
+ return borderTopPadding;
+ }
+
+ public int getBorderLeftPadding() {
+ return borderLeftPadding;
+ }
+
+ public int getBorderBottomPadding() {
+ return borderBottomPadding;
+ }
+
+ public String getBorderSignText() {
+ return borderSignText;
+ }
public Builder drawContent(String content) {
if(content == null) {
diff --git a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/create/LineGifCreateWrapper.java b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/create/LineGifCreateWrapper.java
index fbe16f3e..7f181b95 100644
--- a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/create/LineGifCreateWrapper.java
+++ b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/create/LineGifCreateWrapper.java
@@ -116,6 +116,7 @@ public boolean asGif(String file) throws FileNotFoundException {
}
+ @Override
public String asString() {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
GifHelper.saveGif(asImages(), delay, outputStream);
diff --git a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/create/WordGifCreateWrapper.java b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/create/WordGifCreateWrapper.java
index edcace37..063296ae 100644
--- a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/create/WordGifCreateWrapper.java
+++ b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/create/WordGifCreateWrapper.java
@@ -19,6 +19,7 @@ public static Builder build() {
public static class Builder extends LineGifCreateWrapper.Builder {
+ @Override
public ImgCreateWrapper.Builder drawContent(String content) {
switch (getOptions().getDrawStyle()) {
case HORIZONTAL:
@@ -61,7 +62,7 @@ protected void doDrawContent(String[] strs, int fontHeight) {
}
}
-
+ @Override
protected void doDrawVerticalLeftContent(String[] strs, int fontSize) {
BufferedImage result = getResult();
int contentW = getContentW();
@@ -93,7 +94,7 @@ protected void doDrawVerticalLeftContent(String[] strs, int fontSize) {
}
}
-
+ @Override
protected void doDrawVerticalRightContent(String[] strs, int fontSize) {
BufferedImage result = getResult();
diff --git a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/emoticon/EmotionOptions.java b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/emoticon/EmotionOptions.java
index 790b1239..64bed86f 100644
--- a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/emoticon/EmotionOptions.java
+++ b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/emoticon/EmotionOptions.java
@@ -1,16 +1,16 @@
package com.github.hui.quick.plugin.image.wrapper.emoticon;
import com.github.hui.quick.plugin.image.wrapper.create.ImgCreateOptions;
-import lombok.Data;
import java.awt.*;
import java.awt.image.BufferedImage;
+import java.util.Arrays;
import java.util.List;
+import java.util.Objects;
/**
* Created by yihui on 2017/9/19.
*/
-@Data
public class EmotionOptions {
private int w;
@@ -70,4 +70,176 @@ public class EmotionOptions {
private int bottomPadding;
private int linePadding;
+
+ public int getW() {
+ return w;
+ }
+
+ public void setW(int w) {
+ this.w = w;
+ }
+
+ public int getH() {
+ return h;
+ }
+
+ public void setH(int h) {
+ this.h = h;
+ }
+
+ public String[] getContent() {
+ return content;
+ }
+
+ public void setContent(String[] content) {
+ this.content = content;
+ }
+
+ public int getContentSize() {
+ return contentSize;
+ }
+
+ public void setContentSize(int contentSize) {
+ this.contentSize = contentSize;
+ }
+
+ public Font getFont() {
+ return font;
+ }
+
+ public void setFont(Font font) {
+ this.font = font;
+ }
+
+ public boolean isImgFirst() {
+ return imgFirst;
+ }
+
+ public void setImgFirst(boolean imgFirst) {
+ this.imgFirst = imgFirst;
+ }
+
+ public Color getFontColor() {
+ return fontColor;
+ }
+
+ public void setFontColor(Color fontColor) {
+ this.fontColor = fontColor;
+ }
+
+ public List getImgs() {
+ return imgs;
+ }
+
+ public void setImgs(List imgs) {
+ this.imgs = imgs;
+ }
+
+ public int getGifW() {
+ return gifW;
+ }
+
+ public void setGifW(int gifW) {
+ this.gifW = gifW;
+ }
+
+ public int getGifH() {
+ return gifH;
+ }
+
+ public void setGifH(int gifH) {
+ this.gifH = gifH;
+ }
+
+ public int getDelay() {
+ return delay;
+ }
+
+ public void setDelay(int delay) {
+ this.delay = delay;
+ }
+
+ public ImgCreateOptions.DrawStyle getDrawStyle() {
+ return drawStyle;
+ }
+
+ public void setDrawStyle(ImgCreateOptions.DrawStyle drawStyle) {
+ this.drawStyle = drawStyle;
+ }
+
+ public int getLeftPadding() {
+ return leftPadding;
+ }
+
+ public void setLeftPadding(int leftPadding) {
+ this.leftPadding = leftPadding;
+ }
+
+ public int getRightPadding() {
+ return rightPadding;
+ }
+
+ public void setRightPadding(int rightPadding) {
+ this.rightPadding = rightPadding;
+ }
+
+ public int getTopPadding() {
+ return topPadding;
+ }
+
+ public void setTopPadding(int topPadding) {
+ this.topPadding = topPadding;
+ }
+
+ public int getBottomPadding() {
+ return bottomPadding;
+ }
+
+ public void setBottomPadding(int bottomPadding) {
+ this.bottomPadding = bottomPadding;
+ }
+
+ public int getLinePadding() {
+ return linePadding;
+ }
+
+ public void setLinePadding(int linePadding) {
+ this.linePadding = linePadding;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ EmotionOptions that = (EmotionOptions) o;
+ return w == that.w && h == that.h && contentSize == that.contentSize && imgFirst == that.imgFirst &&
+ gifW == that.gifW && gifH == that.gifH && delay == that.delay && leftPadding == that.leftPadding &&
+ rightPadding == that.rightPadding && topPadding == that.topPadding &&
+ bottomPadding == that.bottomPadding && linePadding == that.linePadding &&
+ Arrays.equals(content, that.content) && Objects.equals(font, that.font) &&
+ Objects.equals(fontColor, that.fontColor) && Objects.equals(imgs, that.imgs) &&
+ drawStyle == that.drawStyle;
+ }
+
+ @Override
+ public int hashCode() {
+
+ int result = Objects.hash(w, h, contentSize, font, imgFirst, fontColor, imgs, gifW, gifH, delay, drawStyle,
+ leftPadding, rightPadding, topPadding, bottomPadding, linePadding);
+ result = 31 * result + Arrays.hashCode(content);
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "EmotionOptions{" + "w=" + w + ", h=" + h + ", content=" + Arrays.toString(content) + ", contentSize=" +
+ contentSize + ", font=" + font + ", imgFirst=" + imgFirst + ", fontColor=" + fontColor + ", imgs=" +
+ imgs + ", gifW=" + gifW + ", gifH=" + gifH + ", delay=" + delay + ", drawStyle=" + drawStyle +
+ ", leftPadding=" + leftPadding + ", rightPadding=" + rightPadding + ", topPadding=" + topPadding +
+ ", bottomPadding=" + bottomPadding + ", linePadding=" + linePadding + '}';
+ }
}
diff --git a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/emoticon/EmotionWrapper.java b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/emoticon/EmotionWrapper.java
index a581e5da..4a12fd81 100644
--- a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/emoticon/EmotionWrapper.java
+++ b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/emoticon/EmotionWrapper.java
@@ -12,7 +12,6 @@
import com.github.hui.quick.plugin.image.wrapper.create.ImgCreateOptions;
import com.github.hui.quick.plugin.image.wrapper.create.LineGifCreateWrapper;
import com.github.hui.quick.plugin.image.wrapper.create.WordGifCreateWrapper;
-import lombok.Getter;
import org.apache.commons.lang3.StringUtils;
import java.awt.*;
@@ -64,7 +63,8 @@ public String asString() {
private void draw(OutputStream outputStream) {
int w = options.getW(), h = options.getH();
int gifW = options.getGifW(), gifH = options.getGifH();
- int leftPadding = options.getLeftPadding(), rightPadding = options.getRightPadding(), topPadding = options.getTopPadding(), bottomPadding = options.getBottomPadding();
+ int leftPadding = options.getLeftPadding(), rightPadding = options.getRightPadding(), topPadding =
+ options.getTopPadding(), bottomPadding = options.getBottomPadding();
int contentSize = options.getContentSize();
BufferedImage result = new BufferedImage(options.getW(), options.getH(), BufferedImage.TYPE_INT_ARGB);
@@ -83,10 +83,12 @@ private void draw(OutputStream outputStream) {
imgX = (options.getW() - options.getGifW()) >> 1;
if (options.isImgFirst()) {
imgY = options.getTopPadding();
- contentY = ((h - topPadding - bottomPadding - contentSize - gifH) >> 1) + topPadding + gifH + g2d.getFont().getSize();
+ contentY = ((h - topPadding - bottomPadding - contentSize - gifH) >> 1) + topPadding + gifH +
+ g2d.getFont().getSize();
} else {
imgY = options.getH() - options.getBottomPadding() - options.getGifH();
- contentY = ((h - topPadding - bottomPadding - contentSize - gifH) >> 1) + topPadding + g2d.getFont().getSize();
+ contentY = ((h - topPadding - bottomPadding - contentSize - gifH) >> 1) + topPadding +
+ g2d.getFont().getSize();
}
} else if (options.getDrawStyle() == ImgCreateOptions.DrawStyle.VERTICAL_LEFT) {
imgY = (options.getH() - options.getGifH()) >> 1;
@@ -102,10 +104,12 @@ private void draw(OutputStream outputStream) {
imgY = (options.getH() - options.getGifH()) >> 1;
if (options.isImgFirst()) {
imgX = w - rightPadding - gifW;
- contentX = imgX - ((imgX - leftPadding - contentSize) >> 1) - g2d.getFont().getSize() - options.getLinePadding();
+ contentX = imgX - ((imgX - leftPadding - contentSize) >> 1) - g2d.getFont().getSize() -
+ options.getLinePadding();
} else {
imgX = options.getLeftPadding();
- contentX = w - rightPadding - ((w - rightPadding - gifW - leftPadding - contentSize) >> 1) - g2d.getFont().getSize() - options.getLinePadding();
+ contentX = w - rightPadding - ((w - rightPadding - gifW - leftPadding - contentSize) >> 1) -
+ g2d.getFont().getSize() - options.getLinePadding();
}
}
@@ -168,12 +172,8 @@ private int doDrawContent(Graphics2D g2d, String content, int y, int lineSize, i
}
- public int doDrawVerticalContent(Graphics2D g2d,
- String content,
- int lineLen,
- int x,
- int linePadding,
- boolean isRight) {
+ public int doDrawVerticalContent(Graphics2D g2d, String content, int lineLen, int x, int linePadding,
+ boolean isRight) {
FontMetrics fontMetrics = g2d.getFontMetrics();
@@ -195,9 +195,7 @@ public int doDrawVerticalContent(Graphics2D g2d,
for (int i = 0; i < tmp.length(); i++) {
tmpCharOffsetX = PunctuationUtil.isPunctuation(tmp.charAt(i)) ? fontSize >> 1 : 0;
- g2d.drawString(tmp.charAt(i) + "",
- lastX + tmpCharOffsetX,
- startY + lastY);
+ g2d.drawString(tmp.charAt(i) + "", lastX + tmpCharOffsetX, startY + lastY);
lastY += fontMetrics.charWidth(tmp.charAt(i)) + fontMetrics.getDescent();
}
@@ -208,13 +206,23 @@ public int doDrawVerticalContent(Graphics2D g2d,
}
- @Getter
public static class Builder {
private EmotionOptions options = new EmotionOptions();
private int tempGifW;
private int tempGifH;
+ public EmotionOptions getOptions() {
+ return options;
+ }
+
+ public int getTempGifW() {
+ return tempGifW;
+ }
+
+ public int getTempGifH() {
+ return tempGifH;
+ }
public Builder setW(int w) {
this.options.setW(w);
@@ -274,14 +282,14 @@ public Builder setGif(InputStream inputStream) {
}
public Builder setGif(List imgs) {
- int tmpW = Integer.MAX_VALUE, tmpH = Integer.MAX_VALUE;
+ int tmpW = Integer.MAX_VALUE, tmpH = Integer.MAX_VALUE;
for (BufferedImage img : imgs) {
if (tmpW < img.getWidth()) {
tmpW = img.getWidth();
}
- if(tmpH < img.getHeight()) {
+ if (tmpH < img.getHeight()) {
tmpH = img.getHeight();
}
}
diff --git a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/expressionbk/ExpressionCreateOptions.java b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/expressionbk/ExpressionCreateOptions.java
index b04e3cb5..ccab4ada 100644
--- a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/expressionbk/ExpressionCreateOptions.java
+++ b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/expressionbk/ExpressionCreateOptions.java
@@ -1,15 +1,14 @@
package com.github.hui.quick.plugin.image.wrapper.expressionbk;
-import lombok.Data;
import java.awt.*;
import java.util.List;
+import java.util.Objects;
/**
* Created by yihui on 2017/9/14.
*/
-@Data
public class ExpressionCreateOptions {
/**
* 四周的边框
@@ -58,4 +57,120 @@ public class ExpressionCreateOptions {
* 延迟时间
*/
private int delay = 100;
+
+ public Integer getPadding() {
+ return padding;
+ }
+
+ public void setPadding(Integer padding) {
+ this.padding = padding;
+ }
+
+ public Integer getW() {
+ return w;
+ }
+
+ public void setW(Integer w) {
+ this.w = w;
+ }
+
+ public Integer getH() {
+ return h;
+ }
+
+ public void setH(Integer h) {
+ this.h = h;
+ }
+
+ public Font getFont() {
+ return font;
+ }
+
+ public void setFont(Font font) {
+ this.font = font;
+ }
+
+ public Integer getLogoW() {
+ return logoW;
+ }
+
+ public void setLogoW(Integer logoW) {
+ this.logoW = logoW;
+ }
+
+ public Integer getLogoH() {
+ return logoH;
+ }
+
+ public void setLogoH(Integer logoH) {
+ this.logoH = logoH;
+ }
+
+ public int getLogoX() {
+ return logoX;
+ }
+
+ public void setLogoX(int logoX) {
+ this.logoX = logoX;
+ }
+
+ public int getLogoY() {
+ return logoY;
+ }
+
+ public void setLogoY(int logoY) {
+ this.logoY = logoY;
+ }
+
+ public Color getBgColor() {
+ return bgColor;
+ }
+
+ public void setBgColor(Color bgColor) {
+ this.bgColor = bgColor;
+ }
+
+ public List getFrameList() {
+ return frameList;
+ }
+
+ public void setFrameList(List frameList) {
+ this.frameList = frameList;
+ }
+
+ public int getDelay() {
+ return delay;
+ }
+
+ public void setDelay(int delay) {
+ this.delay = delay;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ExpressionCreateOptions that = (ExpressionCreateOptions) o;
+ return logoX == that.logoX && logoY == that.logoY && delay == that.delay &&
+ Objects.equals(padding, that.padding) && Objects.equals(w, that.w) && Objects.equals(h, that.h) &&
+ Objects.equals(font, that.font) && Objects.equals(logoW, that.logoW) &&
+ Objects.equals(logoH, that.logoH) && Objects.equals(bgColor, that.bgColor) &&
+ Objects.equals(frameList, that.frameList);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(padding, w, h, font, logoW, logoH, logoX, logoY, bgColor, frameList, delay);
+ }
+
+ @Override
+ public String toString() {
+ return "ExpressionCreateOptions{" + "padding=" + padding + ", w=" + w + ", h=" + h + ", font=" + font +
+ ", logoW=" + logoW + ", logoH=" + logoH + ", logoX=" + logoX + ", logoY=" + logoY + ", bgColor=" +
+ bgColor + ", frameList=" + frameList + ", delay=" + delay + '}';
+ }
}
diff --git a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/expressionbk/ExpressionCreateWrapper.java b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/expressionbk/ExpressionCreateWrapper.java
index 313e5ca4..71718c24 100644
--- a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/expressionbk/ExpressionCreateWrapper.java
+++ b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/expressionbk/ExpressionCreateWrapper.java
@@ -5,7 +5,6 @@
import com.github.hui.quick.plugin.base.gif.GifHelper;
import com.github.hui.quick.plugin.image.util.FontUtil;
import com.github.hui.quick.plugin.image.wrapper.create.ImgCreateOptions;
-import lombok.Getter;
import java.awt.*;
import java.awt.image.BufferedImage;
@@ -52,7 +51,6 @@ public OutputStream asStream() {
}
- @Getter
public static class Builder {
private List globalImgs = new ArrayList<>();
@@ -170,6 +168,53 @@ public Builder frame() {
return this;
}
+ public List getGlobalImgs() {
+ return globalImgs;
+ }
+
+ public List getContents() {
+ return contents;
+ }
+
+ public Integer getBgW() {
+ return bgW;
+ }
+
+ public Integer getBgH() {
+ return bgH;
+ }
+
+ public Color getBgColor() {
+ return bgColor;
+ }
+
+ public BufferedImage getBgImg() {
+ return bgImg;
+ }
+
+ public ImgCreateOptions.DrawStyle getStyle() {
+ return style;
+ }
+
+ public Font getFont() {
+ return font;
+ }
+
+ public Color getFontColor() {
+ return fontColor;
+ }
+
+ public int getDelay() {
+ return delay;
+ }
+
+ public int getLastImgIndex() {
+ return lastImgIndex;
+ }
+
+ public List getFrameEntities() {
+ return frameEntities;
+ }
public ExpressionCreateWrapper builder() {
ExpressionCreateOptions options = new ExpressionCreateOptions();
diff --git a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/expressionbk/ExpressionFrameEntity.java b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/expressionbk/ExpressionFrameEntity.java
index 895a4ea8..6314bad3 100644
--- a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/expressionbk/ExpressionFrameEntity.java
+++ b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/expressionbk/ExpressionFrameEntity.java
@@ -1,16 +1,15 @@
package com.github.hui.quick.plugin.image.wrapper.expressionbk;
import com.github.hui.quick.plugin.image.wrapper.create.ImgCreateOptions;
-import lombok.Data;
import java.awt.*;
import java.awt.image.BufferedImage;
+import java.util.Objects;
/**
* 表情包中每一帧的内容
* Created by yihui on 2017/9/14.
*/
-@Data
public class ExpressionFrameEntity {
private String content;
@@ -30,4 +29,61 @@ public ExpressionFrameEntity(ExpressionFrameEntity entity) {
this.bg = entity.getBg();
this.drawStyle = entity.getDrawStyle();
}
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public Color getFontColor() {
+ return fontColor;
+ }
+
+ public void setFontColor(Color fontColor) {
+ this.fontColor = fontColor;
+ }
+
+ public BufferedImage getBg() {
+ return bg;
+ }
+
+ public void setBg(BufferedImage bg) {
+ this.bg = bg;
+ }
+
+ public ImgCreateOptions.DrawStyle getDrawStyle() {
+ return drawStyle;
+ }
+
+ public void setDrawStyle(ImgCreateOptions.DrawStyle drawStyle) {
+ this.drawStyle = drawStyle;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ExpressionFrameEntity that = (ExpressionFrameEntity) o;
+ return Objects.equals(content, that.content) && Objects.equals(fontColor, that.fontColor) &&
+ Objects.equals(bg, that.bg) && drawStyle == that.drawStyle;
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(content, fontColor, bg, drawStyle);
+ }
+
+ @Override
+ public String toString() {
+ return "ExpressionFrameEntity{" + "content='" + content + '\'' + ", fontColor=" + fontColor + ", bg=" + bg +
+ ", drawStyle=" + drawStyle + '}';
+ }
}
diff --git a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/ImgCell.java b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/ImgCell.java
index 4902c0ce..c155df55 100644
--- a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/ImgCell.java
+++ b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/ImgCell.java
@@ -1,16 +1,13 @@
package com.github.hui.quick.plugin.image.wrapper.merge.cell;
-import lombok.Builder;
-import lombok.Data;
import java.awt.*;
import java.awt.image.BufferedImage;
+import java.util.Objects;
/**
* Created by yihui on 2017/10/13.
*/
-@Data
-@Builder
public class ImgCell implements IMergeCell {
private BufferedImage img;
@@ -30,4 +27,112 @@ public void draw(Graphics2D g2d) {
g2d.drawImage(img, x, y, w, h, null);
}
+
+ public BufferedImage getImg() {
+ return img;
+ }
+
+ public void setImg(BufferedImage img) {
+ this.img = img;
+ }
+
+ public Integer getX() {
+ return x;
+ }
+
+ public void setX(Integer x) {
+ this.x = x;
+ }
+
+ public Integer getY() {
+ return y;
+ }
+
+ public void setY(Integer y) {
+ this.y = y;
+ }
+
+ public Integer getW() {
+ return w;
+ }
+
+ public void setW(Integer w) {
+ this.w = w;
+ }
+
+ public Integer getH() {
+ return h;
+ }
+
+ public void setH(Integer h) {
+ this.h = h;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ImgCell imgCell = (ImgCell) o;
+ return Objects.equals(img, imgCell.img) && Objects.equals(x, imgCell.x) && Objects.equals(y, imgCell.y) &&
+ Objects.equals(w, imgCell.w) && Objects.equals(h, imgCell.h);
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(img, x, y, w, h);
+ }
+
+ @Override
+ public String toString() {
+ return "ImgCell{" + "img=" + img + ", x=" + x + ", y=" + y + ", w=" + w + ", h=" + h + '}';
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ private BufferedImage img;
+ private int x, y, w, h;
+
+ public Builder img(BufferedImage img) {
+ this.img = img;
+ return this;
+ }
+
+ public Builder x(int x) {
+ this.x = x;
+ return this;
+ }
+
+ public Builder y(int y) {
+ this.y = y;
+ return this;
+ }
+
+ public Builder w(int w) {
+ this.w = w;
+ return this;
+ }
+
+ public Builder h(int h) {
+ this.h = h;
+ return this;
+ }
+
+ public ImgCell build() {
+ ImgCell imgCell = new ImgCell();
+ imgCell.img = img;
+ imgCell.x = x;
+ imgCell.y = y;
+ imgCell.w = w;
+ imgCell.h = h;
+ return imgCell;
+ }
+ }
}
diff --git a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/LineCell.java b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/LineCell.java
index f2a9b39a..14ca1702 100644
--- a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/LineCell.java
+++ b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/LineCell.java
@@ -1,15 +1,12 @@
package com.github.hui.quick.plugin.image.wrapper.merge.cell;
-import lombok.Builder;
-import lombok.Data;
import java.awt.*;
+import java.util.Objects;
/**
* Created by yihui on 2017/10/13.
*/
-@Data
-@Builder
public class LineCell implements IMergeCell {
/**
@@ -51,4 +48,165 @@ public void draw(Graphics2D g2d) {
g2d.setStroke(origin);
}
}
+
+ public int getX1() {
+ return x1;
+ }
+
+ public void setX1(int x1) {
+ this.x1 = x1;
+ }
+
+ public int getY1() {
+ return y1;
+ }
+
+ public void setY1(int y1) {
+ this.y1 = y1;
+ }
+
+ public int getX2() {
+ return x2;
+ }
+
+ public void setX2(int x2) {
+ this.x2 = x2;
+ }
+
+ public int getY2() {
+ return y2;
+ }
+
+ public void setY2(int y2) {
+ this.y2 = y2;
+ }
+
+ public Color getColor() {
+ return color;
+ }
+
+ public void setColor(Color color) {
+ this.color = color;
+ }
+
+ public boolean isDashed() {
+ return dashed;
+ }
+
+ public void setDashed(boolean dashed) {
+ this.dashed = dashed;
+ }
+
+ public Stroke getStroke() {
+ return stroke;
+ }
+
+ public void setStroke(Stroke stroke) {
+ this.stroke = stroke;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ LineCell lineCell = (LineCell) o;
+ return x1 == lineCell.x1 && y1 == lineCell.y1 && x2 == lineCell.x2 && y2 == lineCell.y2 &&
+ dashed == lineCell.dashed && Objects.equals(color, lineCell.color) &&
+ Objects.equals(stroke, lineCell.stroke);
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(x1, y1, x2, y2, color, dashed, stroke);
+ }
+
+ @Override
+ public String toString() {
+ return "LineCell{" + "x1=" + x1 + ", y1=" + y1 + ", x2=" + x2 + ", y2=" + y2 + ", color=" + color +
+ ", dashed=" + dashed + ", stroke=" + stroke + '}';
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ /**
+ * 起点坐标
+ */
+ private int x1, y1;
+
+ /**
+ * 终点坐标
+ */
+ private int x2, y2;
+
+ /**
+ * 颜色
+ */
+ private Color color;
+
+
+ /**
+ * 是否是虚线
+ */
+ private boolean dashed;
+
+ /**
+ * 虚线样式
+ */
+ private Stroke stroke = CellConstants.LINE_DEFAULT_STROKE;
+
+ public Builder x1(int x1) {
+ this.x1 = x1;
+ return this;
+ }
+
+ public Builder x2(int x2) {
+ this.x2 = x2;
+ return this;
+ }
+
+ public Builder y1(int y1) {
+ this.y1 = y1;
+ return this;
+ }
+
+ public Builder y2(int y2) {
+ this.y2 = y2;
+ return this;
+ }
+
+ public Builder color(Color color) {
+ this.color = color;
+ return this;
+ }
+
+ public Builder dashed(boolean dashed) {
+ this.dashed = dashed;
+ return this;
+ }
+
+ public Builder stroke(Stroke stroke) {
+ this.stroke = stroke;
+ return this;
+ }
+
+ public LineCell build() {
+ LineCell lineCell = new LineCell();
+ lineCell.x1 = x1;
+ lineCell.x2 = x2;
+ lineCell.y1 = y1;
+ lineCell.y2 = y2;
+ lineCell.dashed = dashed;
+ lineCell.color = color;
+ lineCell.stroke = stroke;
+ return lineCell;
+ }
+ }
}
diff --git a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/RectCell.java b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/RectCell.java
index 7834b22c..a148b921 100644
--- a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/RectCell.java
+++ b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/RectCell.java
@@ -1,19 +1,11 @@
package com.github.hui.quick.plugin.image.wrapper.merge.cell;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
import java.awt.*;
+import java.util.Objects;
/**
* Created by yihui on 2017/10/13.
*/
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@Builder
public class RectCell implements IMergeCell {
/**
@@ -50,6 +42,19 @@ public class RectCell implements IMergeCell {
*/
private int radius;
+ public RectCell() {
+ }
+
+ public RectCell(int x, int y, int w, int h, Color color, boolean dashed, Stroke stroke, int radius) {
+ this.x = x;
+ this.y = y;
+ this.w = w;
+ this.h = h;
+ this.color = color;
+ this.dashed = dashed;
+ this.stroke = stroke;
+ this.radius = radius;
+ }
@Override
public void draw(Graphics2D g2d) {
@@ -63,4 +68,178 @@ public void draw(Graphics2D g2d) {
g2d.setStroke(stroke);
}
}
+
+ public int getX() {
+ return x;
+ }
+
+ public void setX(int x) {
+ this.x = x;
+ }
+
+ public int getY() {
+ return y;
+ }
+
+ public void setY(int y) {
+ this.y = y;
+ }
+
+ public int getW() {
+ return w;
+ }
+
+ public void setW(int w) {
+ this.w = w;
+ }
+
+ public int getH() {
+ return h;
+ }
+
+ public void setH(int h) {
+ this.h = h;
+ }
+
+ public Color getColor() {
+ return color;
+ }
+
+ public void setColor(Color color) {
+ this.color = color;
+ }
+
+ public boolean isDashed() {
+ return dashed;
+ }
+
+ public void setDashed(boolean dashed) {
+ this.dashed = dashed;
+ }
+
+ public Stroke getStroke() {
+ return stroke;
+ }
+
+ public void setStroke(Stroke stroke) {
+ this.stroke = stroke;
+ }
+
+ public int getRadius() {
+ return radius;
+ }
+
+ public void setRadius(int radius) {
+ this.radius = radius;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ RectCell rectCell = (RectCell) o;
+ return x == rectCell.x && y == rectCell.y && w == rectCell.w && h == rectCell.h && dashed == rectCell.dashed &&
+ radius == rectCell.radius && Objects.equals(color, rectCell.color) &&
+ Objects.equals(stroke, rectCell.stroke);
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(x, y, w, h, color, dashed, stroke, radius);
+ }
+
+ @Override
+ public String toString() {
+ return "RectCell{" + "x=" + x + ", y=" + y + ", w=" + w + ", h=" + h + ", color=" + color + ", dashed=" +
+ dashed + ", stroke=" + stroke + ", radius=" + radius + '}';
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ /**
+ * 起始坐标
+ */
+ private int x, y;
+
+ /**
+ * 矩形宽高
+ */
+ private int w, h;
+
+
+ /**
+ * 颜色
+ */
+ private Color color;
+
+
+ /**
+ * 是否为虚线
+ */
+ private boolean dashed;
+
+
+ /**
+ * 虚线样式
+ */
+ private Stroke stroke;
+
+
+ /**
+ * 圆角弧度
+ */
+ private int radius;
+
+ public Builder x(int x) {
+ this.x = x;
+ return this;
+ }
+
+ public Builder y(int y) {
+ this.y = y;
+ return this;
+ }
+
+ public Builder w(int w) {
+ this.w = w;
+ return this;
+ }
+
+ public Builder h(int h) {
+ this.h = h;
+ return this;
+ }
+
+ public Builder color(Color color) {
+ this.color = color;
+ return this;
+ }
+
+ public Builder dashed(boolean dashed) {
+ this.dashed = dashed;
+ return this;
+ }
+
+ public Builder stroke(Stroke stroke) {
+ this.stroke = stroke;
+ return this;
+ }
+
+ public Builder radius(int radius) {
+ this.radius = radius;
+ return this;
+ }
+
+ public RectCell build() {
+ return new RectCell(x, y, w, h, color, dashed, stroke, radius);
+ }
+ }
}
diff --git a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/RectFillCell.java b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/RectFillCell.java
index ccad0153..0be90290 100644
--- a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/RectFillCell.java
+++ b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/RectFillCell.java
@@ -1,16 +1,13 @@
package com.github.hui.quick.plugin.image.wrapper.merge.cell;
-import lombok.Builder;
-import lombok.Data;
import java.awt.*;
+import java.util.Objects;
/**
* 填充矩形框
* Created by yihui on 2017/10/16.
*/
-@Data
-@Builder
public class RectFillCell implements IMergeCell {
private Font font;
@@ -18,12 +15,145 @@ public class RectFillCell implements IMergeCell {
private Color color;
- private int x,y,w,h;
+ private int x, y, w, h;
@Override
public void draw(Graphics2D g2d) {
g2d.setFont(font);
- g2d.setColor(color);;
+ g2d.setColor(color);
+ ;
g2d.fillRect(x, y, w, h);
}
+
+ public RectFillCell() {
+ }
+
+ public RectFillCell(Font font, Color color, int x, int y, int w, int h) {
+ this.font = font;
+ this.color = color;
+ this.x = x;
+ this.y = y;
+ this.w = w;
+ this.h = h;
+ }
+
+ public Font getFont() {
+ return font;
+ }
+
+ public void setFont(Font font) {
+ this.font = font;
+ }
+
+ public Color getColor() {
+ return color;
+ }
+
+ public void setColor(Color color) {
+ this.color = color;
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ public void setX(int x) {
+ this.x = x;
+ }
+
+ public int getY() {
+ return y;
+ }
+
+ public void setY(int y) {
+ this.y = y;
+ }
+
+ public int getW() {
+ return w;
+ }
+
+ public void setW(int w) {
+ this.w = w;
+ }
+
+ public int getH() {
+ return h;
+ }
+
+ public void setH(int h) {
+ this.h = h;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ RectFillCell that = (RectFillCell) o;
+ return x == that.x && y == that.y && w == that.w && h == that.h && Objects.equals(font, that.font) &&
+ Objects.equals(color, that.color);
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(font, color, x, y, w, h);
+ }
+
+ @Override
+ public String toString() {
+ return "RectFillCell{" + "font=" + font + ", color=" + color + ", x=" + x + ", y=" + y + ", w=" + w + ", h=" +
+ h + '}';
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ private Font font;
+
+ private Color color;
+
+
+ private int x, y, w, h;
+
+ public Builder font(Font font) {
+ this.font = font;
+ return this;
+ }
+
+ public Builder color(Color color) {
+ this.color = color;
+ return this;
+ }
+
+ public Builder x(int x) {
+ this.x = x;
+ return this;
+ }
+
+ public Builder y(int y) {
+ this.y = y;
+ return this;
+ }
+
+ public Builder w(int w) {
+ this.w = w;
+ return this;
+ }
+
+ public Builder h(int h) {
+ this.h = h;
+ return this;
+ }
+
+ public RectFillCell build() {
+ return new RectFillCell(font, color, x, y, w, h);
+ }
+ }
}
diff --git a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/TextCell.java b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/TextCell.java
index d994d0f6..609c12a0 100644
--- a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/TextCell.java
+++ b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/merge/cell/TextCell.java
@@ -1,21 +1,20 @@
package com.github.hui.quick.plugin.image.wrapper.merge.cell;
-import com.github.hui.quick.plugin.image.wrapper.create.ImgCreateOptions;
import com.github.hui.quick.plugin.image.helper.CalculateHelper;
import com.github.hui.quick.plugin.image.util.FontUtil;
import com.github.hui.quick.plugin.image.util.PunctuationUtil;
-import lombok.Data;
+import com.github.hui.quick.plugin.image.wrapper.create.ImgCreateOptions;
import java.awt.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import java.util.Objects;
/**
* Created by yihui on 2017/10/13.
*/
-@Data
public class TextCell implements IMergeCell {
private List texts;
@@ -40,6 +39,86 @@ public class TextCell implements IMergeCell {
private ImgCreateOptions.AlignStyle alignStyle = ImgCreateOptions.AlignStyle.LEFT;
+ public List getTexts() {
+ return texts;
+ }
+
+ public void setTexts(List texts) {
+ this.texts = texts;
+ }
+
+ public Color getColor() {
+ return color;
+ }
+
+ public void setColor(Color color) {
+ this.color = color;
+ }
+
+ public Font getFont() {
+ return font;
+ }
+
+ public void setFont(Font font) {
+ this.font = font;
+ }
+
+ public int getLineSpace() {
+ return lineSpace;
+ }
+
+ public void setLineSpace(int lineSpace) {
+ this.lineSpace = lineSpace;
+ }
+
+ public int getStartX() {
+ return startX;
+ }
+
+ public void setStartX(int startX) {
+ this.startX = startX;
+ }
+
+ public int getStartY() {
+ return startY;
+ }
+
+ public void setStartY(int startY) {
+ this.startY = startY;
+ }
+
+ public int getEndX() {
+ return endX;
+ }
+
+ public void setEndX(int endX) {
+ this.endX = endX;
+ }
+
+ public int getEndY() {
+ return endY;
+ }
+
+ public void setEndY(int endY) {
+ this.endY = endY;
+ }
+
+ public ImgCreateOptions.DrawStyle getDrawStyle() {
+ return drawStyle;
+ }
+
+ public void setDrawStyle(ImgCreateOptions.DrawStyle drawStyle) {
+ this.drawStyle = drawStyle;
+ }
+
+ public ImgCreateOptions.AlignStyle getAlignStyle() {
+ return alignStyle;
+ }
+
+ public void setAlignStyle(ImgCreateOptions.AlignStyle alignStyle) {
+ this.alignStyle = alignStyle;
+ }
+
public void addText(String text) {
if (texts == null) {
texts = new ArrayList<>();
@@ -57,9 +136,9 @@ public void draw(Graphics2D g2d) {
FontMetrics fontMetrics = FontUtil.getFontMetric(font);
int tmpHeight = fontMetrics.getHeight(), tmpW = font.getSize() >>> 1;
int tmpY = startY, tmpX = startX;
- int offsetX = drawStyle == ImgCreateOptions.DrawStyle.VERTICAL_LEFT
- ? (font.getSize() + fontMetrics.getDescent() + lineSpace)
- : -(font.getSize() + fontMetrics.getDescent() + lineSpace);
+ int offsetX = drawStyle == ImgCreateOptions.DrawStyle.VERTICAL_LEFT ?
+ (font.getSize() + fontMetrics.getDescent() + lineSpace) :
+ -(font.getSize() + fontMetrics.getDescent() + lineSpace);
List splitText = batchSplitText(texts, fontMetrics);
for (String info : splitText) {
if (drawStyle == ImgCreateOptions.DrawStyle.HORIZONTAL) {
@@ -73,9 +152,7 @@ public void draw(Graphics2D g2d) {
tmpY = calculateY(info, fontMetrics);
for (int i = 0; i < chars.length; i++) {
tmpX = PunctuationUtil.isPunctuation(chars[i]) ? tmpW : 0;
- g2d.drawString(chars[i] + "",
- tmpX + (PunctuationUtil.isPunctuation(chars[i]) ? tmpW : 0),
- tmpY);
+ g2d.drawString(chars[i] + "", tmpX + (PunctuationUtil.isPunctuation(chars[i]) ? tmpW : 0), tmpY);
tmpY += tmpHeight;
}
@@ -91,12 +168,12 @@ private List batchSplitText(List texts, FontMetrics fontMetrics)
List ans = new ArrayList<>();
if (drawStyle == ImgCreateOptions.DrawStyle.HORIZONTAL) {
int lineLen = Math.abs(endX - startX);
- for(String t: texts) {
+ for (String t : texts) {
ans.addAll(Arrays.asList(CalculateHelper.splitStr(t, lineLen, fontMetrics)));
}
} else {
int lineLen = Math.abs(endY - startY);
- for(String t: texts) {
+ for (String t : texts) {
ans.addAll(Arrays.asList(CalculateHelper.splitVerticalStr(t, lineLen, fontMetrics)));
}
}
@@ -127,4 +204,32 @@ private int calculateY(String text, FontMetrics fontMetrics) {
return startY + ((endY - endX - size) >>> 1);
}
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ TextCell textCell = (TextCell) o;
+ return lineSpace == textCell.lineSpace && startX == textCell.startX && startY == textCell.startY &&
+ endX == textCell.endX && endY == textCell.endY && Objects.equals(texts, textCell.texts) &&
+ Objects.equals(color, textCell.color) && Objects.equals(font, textCell.font) &&
+ drawStyle == textCell.drawStyle && alignStyle == textCell.alignStyle;
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(texts, color, font, lineSpace, startX, startY, endX, endY, drawStyle, alignStyle);
+ }
+
+ @Override
+ public String toString() {
+ return "TextCell{" + "texts=" + texts + ", color=" + color + ", font=" + font + ", lineSpace=" + lineSpace +
+ ", startX=" + startX + ", startY=" + startY + ", endX=" + endX + ", endY=" + endY + ", drawStyle=" +
+ drawStyle + ", alignStyle=" + alignStyle + '}';
+ }
}
diff --git a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/wartermark/WaterMarkOptions.java b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/wartermark/WaterMarkOptions.java
index c4c219c2..a3b73088 100644
--- a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/wartermark/WaterMarkOptions.java
+++ b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/wartermark/WaterMarkOptions.java
@@ -1,15 +1,13 @@
package com.github.hui.quick.plugin.image.wrapper.wartermark;
-import lombok.Data;
-
import java.awt.image.BufferedImage;
import java.util.HashMap;
import java.util.Map;
+import java.util.Objects;
/**
* Created by yihui on 2017/9/28.
*/
-@Data
public class WaterMarkOptions {
@@ -25,8 +23,88 @@ public class WaterMarkOptions {
private float opacity;
- private int basicW ;
+ private int basicW;
+
+ public BufferedImage getSource() {
+ return source;
+ }
+
+ public void setSource(BufferedImage source) {
+ this.source = source;
+ }
+
+ public BufferedImage getWater() {
+ return water;
+ }
+
+ public void setWater(BufferedImage water) {
+ this.water = water;
+ }
+
+ public WaterStyle getStyle() {
+ return style;
+ }
+
+ public void setStyle(WaterStyle style) {
+ this.style = style;
+ }
+
+ public int getX() {
+ return x;
+ }
+ public void setX(int x) {
+ this.x = x;
+ }
+
+ public int getY() {
+ return y;
+ }
+
+ public void setY(int y) {
+ this.y = y;
+ }
+
+ public float getOpacity() {
+ return opacity;
+ }
+
+ public void setOpacity(float opacity) {
+ this.opacity = opacity;
+ }
+
+ public int getBasicW() {
+ return basicW;
+ }
+
+ public void setBasicW(int basicW) {
+ this.basicW = basicW;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ WaterMarkOptions that = (WaterMarkOptions) o;
+ return x == that.x && y == that.y && Float.compare(that.opacity, opacity) == 0 && basicW == that.basicW &&
+ Objects.equals(source, that.source) && Objects.equals(water, that.water) && style == that.style;
+ }
+
+ @Override
+ public String toString() {
+ return "WaterMarkOptions{" + "source=" + source + ", water=" + water + ", style=" + style + ", x=" + x +
+ ", y=" + y + ", opacity=" + opacity + ", basicW=" + basicW + '}';
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(source, water, style, x, y, opacity, basicW);
+ }
public enum WaterStyle {
/**
@@ -40,39 +118,32 @@ public enum WaterStyle {
*/
// 左上角
- OVERRIDE_LEFT_TOP,
- // 上居中
- OVERRIDE_TOP_CENTER,
- // 右上角
+ OVERRIDE_LEFT_TOP, // 上居中
+ OVERRIDE_TOP_CENTER, // 右上角
OVERRIDE_RIGHT_TOP,
// 左中
- OVERRIDE_LEFT_CENTER,
- // 正中
- OVERRIDE_CENTER,
- // 右中
+ OVERRIDE_LEFT_CENTER, // 正中
+ OVERRIDE_CENTER, // 右中
OVERRIDE_RIGHT_CENTER,
// 左下
- OVERRIDE_LEFT_BOTTOM,
- // 下中
- OVERRIDE_BOTTOM_CENTER,
- // 右下
- OVERRIDE_RIGHT_BOTTOM,
- ;
+ OVERRIDE_LEFT_BOTTOM, // 下中
+ OVERRIDE_BOTTOM_CENTER, // 右下
+ OVERRIDE_RIGHT_BOTTOM,;
private static Map map = new HashMap<>();
+
static {
- for(WaterStyle style: values()) {
+ for (WaterStyle style : values()) {
map.put(style.name(), style);
}
}
-
public static WaterStyle getStyle(String style) {
- if(style == null) {
+ if (style == null) {
return OVERRIDE_RIGHT_BOTTOM;
}
diff --git a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/wartermark/WaterMarkWrapper.java b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/wartermark/WaterMarkWrapper.java
index 0a8869b9..4f8bb94f 100644
--- a/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/wartermark/WaterMarkWrapper.java
+++ b/plugins/image-plugin/src/main/java/com/github/hui/quick/plugin/image/wrapper/wartermark/WaterMarkWrapper.java
@@ -5,8 +5,6 @@
import com.github.hui.quick.plugin.image.helper.ImgDrawHelper;
import com.github.hui.quick.plugin.image.util.FontUtil;
import com.google.common.base.Splitter;
-import lombok.Getter;
-import lombok.ToString;
import java.awt.*;
import java.awt.image.BufferedImage;
@@ -52,8 +50,6 @@ public BufferedImage asImage() {
}
- @Getter
- @ToString
public static class Builder {
/**
* 水印绘制的 x 坐标
@@ -205,6 +201,66 @@ public Builder setPaddingY(int paddingY) {
return this;
}
+ public int getX() {
+ return x;
+ }
+
+ public int getY() {
+ return y;
+ }
+
+ public BufferedImage getSource() {
+ return source;
+ }
+
+ public BufferedImage getWaterLogo() {
+ return waterLogo;
+ }
+
+ public int getWaterLogoHeight() {
+ return waterLogoHeight;
+ }
+
+ public List getWaterInfo() {
+ return waterInfo;
+ }
+
+ public Font getWaterFont() {
+ return waterFont;
+ }
+
+ public Color getWaterColor() {
+ return waterColor;
+ }
+
+ public boolean isInline() {
+ return inline;
+ }
+
+ public float getWaterOpacity() {
+ return waterOpacity;
+ }
+
+ public WaterMarkOptions.WaterStyle getStyle() {
+ return style;
+ }
+
+ public int getRotate() {
+ return rotate;
+ }
+
+ public int getPaddingX() {
+ return paddingX;
+ }
+
+ public int getPaddingY() {
+ return paddingY;
+ }
+
+ public BufferedImage getTmpWater() {
+ return tmpWater;
+ }
+
public WaterMarkWrapper build() {
WaterMarkOptions options = new WaterMarkOptions();
options.setSource(source);
@@ -401,6 +457,15 @@ private void updatePosition() {
return;
}
}
+
+ @Override
+ public String toString() {
+ return "Builder{" + "x=" + x + ", y=" + y + ", source=" + source + ", waterLogo=" + waterLogo +
+ ", waterLogoHeight=" + waterLogoHeight + ", waterInfo=" + waterInfo + ", waterFont=" + waterFont +
+ ", waterColor=" + waterColor + ", inline=" + inline + ", waterOpacity=" + waterOpacity +
+ ", style=" + style + ", rotate=" + rotate + ", paddingX=" + paddingX + ", paddingY=" + paddingY +
+ ", tmpWater=" + tmpWater + '}';
+ }
}
}
diff --git a/plugins/imagic-plugin/pom.xml b/plugins/imagic-plugin/pom.xml
index ebe99c05..16bcb96e 100644
--- a/plugins/imagic-plugin/pom.xml
+++ b/plugins/imagic-plugin/pom.xml
@@ -5,12 +5,12 @@
plugins
com.github.hui.media
- 2.4
+ 2.5
4.0.0
imagic-plugin
- 2.4
+ 2.5
1.4.0
@@ -33,12 +33,6 @@
commons-collections
commons-collections
-
-
- org.projectlombok
- lombok
-
-
org.slf4j
slf4j-api
diff --git a/plugins/imagic-plugin/src/main/java/com/github/hui/quick/plugin/imagic/base/ImgBaseOperate.java b/plugins/imagic-plugin/src/main/java/com/github/hui/quick/plugin/imagic/base/ImgBaseOperate.java
index 80c6a457..2f1d1be9 100644
--- a/plugins/imagic-plugin/src/main/java/com/github/hui/quick/plugin/imagic/base/ImgBaseOperate.java
+++ b/plugins/imagic-plugin/src/main/java/com/github/hui/quick/plugin/imagic/base/ImgBaseOperate.java
@@ -2,10 +2,11 @@
import com.github.hui.quick.plugin.imagic.ImgWrapper;
import com.github.hui.quick.plugin.imagic.exception.ImgOperateException;
-import lombok.extern.slf4j.Slf4j;
import org.im4java.core.ConvertCmd;
import org.im4java.core.IM4JavaException;
import org.im4java.core.IMOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.List;
@@ -13,9 +14,10 @@
/**
* Created by yihui on 18/04/17.
*/
-@Slf4j
public class ImgBaseOperate {
+ private static final Logger log = LoggerFactory.getLogger(ImgBaseOperate.class);
+
/**
* 执行图片的复合操作
*
diff --git a/plugins/markdown-plugin/pom.xml b/plugins/markdown-plugin/pom.xml
index 08e86c79..cad912be 100644
--- a/plugins/markdown-plugin/pom.xml
+++ b/plugins/markdown-plugin/pom.xml
@@ -5,12 +5,12 @@
plugins
com.github.hui.media
- 2.4
+ 2.5
4.0.0
markdown-plugin
- 2.4
+ 2.5
0.26.4
@@ -20,7 +20,7 @@
com.github.hui.media
base-plugin
- 2.4
+ 2.5
diff --git a/plugins/markdown-plugin/src/main/java/com/github/hui/quick/plugin/md/Html2ImageWrapper.java b/plugins/markdown-plugin/src/main/java/com/github/hui/quick/plugin/md/Html2ImageWrapper.java
index a6fddda7..9deb601f 100644
--- a/plugins/markdown-plugin/src/main/java/com/github/hui/quick/plugin/md/Html2ImageWrapper.java
+++ b/plugins/markdown-plugin/src/main/java/com/github/hui/quick/plugin/md/Html2ImageWrapper.java
@@ -6,7 +6,6 @@
import com.github.hui.quick.plugin.md.entity.HtmlRenderOptions;
import com.github.hui.quick.plugin.md.entity.MarkdownEntity;
import com.github.hui.quick.plugin.md.helper.HtmlRenderHelper;
-import lombok.Getter;
import org.apache.xerces.parsers.DOMParser;
import org.cyberneko.html.HTMLConfiguration;
import org.w3c.dom.Document;
@@ -106,7 +105,6 @@ public String asString() throws IOException {
}
- @Getter
public static class Builder {
/**
* 输出图片的宽
@@ -224,6 +222,50 @@ public Builder setDocument(String html) throws Exception {
return this;
}
+ public Integer getW() {
+ return w;
+ }
+
+ public Integer getH() {
+ return h;
+ }
+
+ public boolean isAutoW() {
+ return autoW;
+ }
+
+ public boolean isAutoH() {
+ return autoH;
+ }
+
+ public String getOutType() {
+ return outType;
+ }
+
+ public MarkdownEntity getHtml() {
+ return html;
+ }
+
+ public String getCss() {
+ return css;
+ }
+
+ public String getFontFamily() {
+ return fontFamily;
+ }
+
+ public Font getFont() {
+ return font;
+ }
+
+ public Integer getFontColor() {
+ return fontColor;
+ }
+
+ public Document getDocument() {
+ return document;
+ }
+
public Html2ImageWrapper build() throws Exception {
HtmlRenderOptions options = new HtmlRenderOptions();
options.setFont(font);
diff --git a/plugins/markdown-plugin/src/main/java/com/github/hui/quick/plugin/md/entity/HtmlRenderOptions.java b/plugins/markdown-plugin/src/main/java/com/github/hui/quick/plugin/md/entity/HtmlRenderOptions.java
index 308ab42a..3aea2923 100644
--- a/plugins/markdown-plugin/src/main/java/com/github/hui/quick/plugin/md/entity/HtmlRenderOptions.java
+++ b/plugins/markdown-plugin/src/main/java/com/github/hui/quick/plugin/md/entity/HtmlRenderOptions.java
@@ -1,14 +1,13 @@
package com.github.hui.quick.plugin.md.entity;
-import lombok.Data;
import org.w3c.dom.Document;
import java.awt.*;
+import java.util.Objects;
/**
* Created by yihui on 2017/9/11.
*/
-@Data
public class HtmlRenderOptions {
/**
@@ -56,4 +55,94 @@ public class HtmlRenderOptions {
* 绘制字体颜色
*/
private String fontColor;
+
+ public Integer getW() {
+ return w;
+ }
+
+ public void setW(Integer w) {
+ this.w = w;
+ }
+
+ public Integer getH() {
+ return h;
+ }
+
+ public void setH(Integer h) {
+ this.h = h;
+ }
+
+ public boolean isAutoW() {
+ return autoW;
+ }
+
+ public void setAutoW(boolean autoW) {
+ this.autoW = autoW;
+ }
+
+ public boolean isAutoH() {
+ return autoH;
+ }
+
+ public void setAutoH(boolean autoH) {
+ this.autoH = autoH;
+ }
+
+ public String getOutType() {
+ return outType;
+ }
+
+ public void setOutType(String outType) {
+ this.outType = outType;
+ }
+
+ public Document getDocument() {
+ return document;
+ }
+
+ public void setDocument(Document document) {
+ this.document = document;
+ }
+
+ public Font getFont() {
+ return font;
+ }
+
+ public void setFont(Font font) {
+ this.font = font;
+ }
+
+ public String getFontColor() {
+ return fontColor;
+ }
+
+ public void setFontColor(String fontColor) {
+ this.fontColor = fontColor;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ HtmlRenderOptions that = (HtmlRenderOptions) o;
+ return autoW == that.autoW && autoH == that.autoH && Objects.equals(w, that.w) && Objects.equals(h, that.h) &&
+ Objects.equals(outType, that.outType) && Objects.equals(document, that.document) &&
+ Objects.equals(font, that.font) && Objects.equals(fontColor, that.fontColor);
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(w, h, autoW, autoH, outType, document, font, fontColor);
+ }
+
+ @Override
+ public String toString() {
+ return "HtmlRenderOptions{" + "w=" + w + ", h=" + h + ", autoW=" + autoW + ", autoH=" + autoH + ", outType='" +
+ outType + '\'' + ", document=" + document + ", font=" + font + ", fontColor='" + fontColor + '\'' + '}';
+ }
}
diff --git a/plugins/markdown-plugin/src/main/java/com/github/hui/quick/plugin/md/entity/MarkdownEntity.java b/plugins/markdown-plugin/src/main/java/com/github/hui/quick/plugin/md/entity/MarkdownEntity.java
index a22116ff..d5bb9f15 100644
--- a/plugins/markdown-plugin/src/main/java/com/github/hui/quick/plugin/md/entity/MarkdownEntity.java
+++ b/plugins/markdown-plugin/src/main/java/com/github/hui/quick/plugin/md/entity/MarkdownEntity.java
@@ -1,14 +1,12 @@
package com.github.hui.quick.plugin.md.entity;
-import lombok.Data;
-
import java.util.Map;
+import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
/**
* Created by yihui on 2017/9/11.
*/
-@Data
public class MarkdownEntity {
public static String TAG_WIDTH = "";
@@ -57,5 +55,48 @@ public void addWidthCss(String tag) {
String wcss = String.format(TAG_WIDTH, tag);
css += wcss;
}
+
+ public String getCss() {
+ return css;
+ }
+
+ public void setCss(String css) {
+ this.css = css;
+ }
+
+ public Map getDivStyle() {
+ return divStyle;
+ }
+
+ public void setDivStyle(Map divStyle) {
+ this.divStyle = divStyle;
+ }
+
+ public String getHtml() {
+ return html;
+ }
+
+ public void setHtml(String html) {
+ this.html = html;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ MarkdownEntity entity = (MarkdownEntity) o;
+ return Objects.equals(css, entity.css) && Objects.equals(divStyle, entity.divStyle) &&
+ Objects.equals(html, entity.html);
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(css, divStyle, html);
+ }
}
diff --git a/plugins/markdown-plugin/src/test/java/com/github/hui/quick/plugin/test/Md2ImgTest.java b/plugins/markdown-plugin/src/test/java/com/github/hui/quick/plugin/test/Md2ImgTest.java
index 92363586..81cea7b6 100644
--- a/plugins/markdown-plugin/src/test/java/com/github/hui/quick/plugin/test/Md2ImgTest.java
+++ b/plugins/markdown-plugin/src/test/java/com/github/hui/quick/plugin/test/Md2ImgTest.java
@@ -1,6 +1,5 @@
package com.github.hui.quick.plugin.test;
-import com.github.hui.quick.plugin.base.FileWriteUtil;
import com.github.hui.quick.plugin.md.Html2ImageWrapper;
import com.github.hui.quick.plugin.md.MarkDown2HtmlWrapper;
import com.github.hui.quick.plugin.md.entity.MarkdownEntity;
diff --git a/plugins/phantom-plugin/pom.xml b/plugins/phantom-plugin/pom.xml
index 8dde9621..5fed4d67 100644
--- a/plugins/phantom-plugin/pom.xml
+++ b/plugins/phantom-plugin/pom.xml
@@ -5,12 +5,12 @@
plugins
com.github.hui.media
- 2.4
+ 2.5
4.0.0
phantom-plugin
- 2.4
+ 2.5
diff --git a/plugins/pom.xml b/plugins/pom.xml
index a8995e27..67c52fd7 100644
--- a/plugins/pom.xml
+++ b/plugins/pom.xml
@@ -11,7 +11,7 @@
plugins
- 2.4
+ 2.5
pom
@@ -41,22 +41,18 @@
org.apache.commons
commons-lang3
- 3.5
-
-
- org.projectlombok
- lombok
- 1.18.8
+ 3.11
+
org.slf4j
slf4j-api
- 1.7.25
+ 1.7.30
ch.qos.logback
logback-classic
- 1.1.7
+ 1.2.3
commons-collections
diff --git a/plugins/qrcode-plugin/pom.xml b/plugins/qrcode-plugin/pom.xml
index 96457a1d..e86cf730 100644
--- a/plugins/qrcode-plugin/pom.xml
+++ b/plugins/qrcode-plugin/pom.xml
@@ -5,27 +5,22 @@
plugins
com.github.hui.media
- 2.4
+ 2.5
4.0.0
qrcode-plugin
- 2.4.2
+ 2.5.0
- 3.3.0
+ 3.4.0
com.github.hui.media
base-plugin
- 2.4
-
-
-
- org.projectlombok
- lombok
+ 2.5
diff --git a/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/entity/DotSize.java b/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/entity/DotSize.java
index 0361183c..eef27c78 100644
--- a/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/entity/DotSize.java
+++ b/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/entity/DotSize.java
@@ -1,17 +1,10 @@
package com.github.hui.quick.plugin.qrcode.entity;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
import java.util.Objects;
/**
* Created by @author yihui in 19:31 19/3/12.
*/
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
public class DotSize {
public static final DotSize SIZE_1_1 = new DotSize(1, 1);
public static final DotSize SIZE_2_1 = new DotSize(2, 1);
@@ -38,4 +31,51 @@ public static DotSize create(int row, int col) {
return new DotSize(row, col);
}
}
+
+ public DotSize() {
+ }
+
+ public DotSize(int row, int col) {
+ this.row = row;
+ this.col = col;
+ }
+
+ public int getRow() {
+ return row;
+ }
+
+ public void setRow(int row) {
+ this.row = row;
+ }
+
+ public int getCol() {
+ return col;
+ }
+
+ public void setCol(int col) {
+ this.col = col;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ DotSize dotSize = (DotSize) o;
+ return row == dotSize.row && col == dotSize.col;
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(row, col);
+ }
+
+ @Override
+ public String toString() {
+ return "DotSize{" + "row=" + row + ", col=" + col + '}';
+ }
}
\ No newline at end of file
diff --git a/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/helper/QrCodeGenerateHelper.java b/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/helper/QrCodeGenerateHelper.java
index 02143fba..d76093e4 100644
--- a/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/helper/QrCodeGenerateHelper.java
+++ b/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/helper/QrCodeGenerateHelper.java
@@ -9,8 +9,9 @@
import com.google.zxing.qrcode.encoder.ByteMatrix;
import com.google.zxing.qrcode.encoder.Encoder;
import com.google.zxing.qrcode.encoder.QRCode;
-import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.awt.*;
import java.awt.image.BufferedImage;
@@ -23,8 +24,8 @@
* 二维码生成辅助类,主要两个方法,一个是生成二维码矩阵,一个是渲染矩阵为图片
* Created by yihui on 2018/3/23.
*/
-@Slf4j
public class QrCodeGenerateHelper {
+ private static Logger log = LoggerFactory.getLogger(QrCodeGenerateHelper.class);
private static final int QUIET_ZONE_SIZE = 4;
diff --git a/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/helper/QrCodeRenderHelper.java b/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/helper/QrCodeRenderHelper.java
index 0c0b8a75..ad9faa07 100644
--- a/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/helper/QrCodeRenderHelper.java
+++ b/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/helper/QrCodeRenderHelper.java
@@ -7,8 +7,9 @@
import com.github.hui.quick.plugin.qrcode.wrapper.BitMatrixEx;
import com.github.hui.quick.plugin.qrcode.wrapper.QrCodeOptions;
import com.google.zxing.qrcode.encoder.ByteMatrix;
-import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.awt.*;
import java.awt.image.BufferedImage;
@@ -20,9 +21,8 @@
* 二维码渲染辅助类,主要用于绘制背景,logo,定位点,二维码信息
* Created by yihui on 2017/4/7.
*/
-@Slf4j
public class QrCodeRenderHelper {
-
+ private static Logger log = LoggerFactory.getLogger(QrCodeGenerateHelper.class);
/**
* 绘制logo图片
diff --git a/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/wrapper/BitMatrixEx.java b/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/wrapper/BitMatrixEx.java
index 01991420..161338cc 100644
--- a/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/wrapper/BitMatrixEx.java
+++ b/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/wrapper/BitMatrixEx.java
@@ -1,16 +1,12 @@
package com.github.hui.quick.plugin.qrcode.wrapper;
import com.google.zxing.qrcode.encoder.ByteMatrix;
-import lombok.Getter;
-import lombok.Setter;
/**
* 扩展的二维码矩阵信息, 主要新增了三个位置探测图形的判定
*
* Created by yihui on 2017/7/27.
*/
-@Getter
-@Setter
public class BitMatrixEx {
/**
* 实际生成二维码的宽
@@ -40,4 +36,52 @@ public class BitMatrixEx {
private int multiple;
private ByteMatrix byteMatrix;
+
+ public int getWidth() {
+ return width;
+ }
+
+ public void setWidth(int width) {
+ this.width = width;
+ }
+
+ public int getHeight() {
+ return height;
+ }
+
+ public void setHeight(int height) {
+ this.height = height;
+ }
+
+ public int getLeftPadding() {
+ return leftPadding;
+ }
+
+ public void setLeftPadding(int leftPadding) {
+ this.leftPadding = leftPadding;
+ }
+
+ public int getTopPadding() {
+ return topPadding;
+ }
+
+ public void setTopPadding(int topPadding) {
+ this.topPadding = topPadding;
+ }
+
+ public int getMultiple() {
+ return multiple;
+ }
+
+ public void setMultiple(int multiple) {
+ this.multiple = multiple;
+ }
+
+ public ByteMatrix getByteMatrix() {
+ return byteMatrix;
+ }
+
+ public void setByteMatrix(ByteMatrix byteMatrix) {
+ this.byteMatrix = byteMatrix;
+ }
}
diff --git a/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/wrapper/QrCodeGenWrapper.java b/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/wrapper/QrCodeGenWrapper.java
index cb77c4bc..b30a425b 100644
--- a/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/wrapper/QrCodeGenWrapper.java
+++ b/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/wrapper/QrCodeGenWrapper.java
@@ -10,9 +10,9 @@
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.MatrixToImageConfig;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
-import lombok.ToString;
-import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.imageio.ImageIO;
import java.awt.*;
@@ -93,9 +93,8 @@ private static boolean asFile(QrCodeOptions qrCodeOptions, String absFileName) t
}
- @ToString
- @Slf4j
public static class Builder {
+ private static Logger log = LoggerFactory.getLogger(QrCodeGenWrapper.Builder.class);
private static final MatrixToImageConfig DEFAULT_CONFIG = new MatrixToImageConfig();
/**
@@ -877,5 +876,13 @@ public ByteArrayOutputStream asStream() throws WriterException, IOException {
public boolean asFile(String absFileName) throws IOException, WriterException {
return QrCodeGenWrapper.asFile(build(), absFileName);
}
+
+ @Override
+ public String toString() {
+ return "Builder{" + "msg='" + msg + '\'' + ", w=" + w + ", h=" + h + ", code='" + code + '\'' +
+ ", padding=" + padding + ", errorCorrection=" + errorCorrection + ", picType='" + picType + '\'' +
+ ", bgImgOptions=" + bgImgOptions + ", logoOptions=" + logoOptions + ", drawOptions=" + drawOptions +
+ ", detectOptions=" + detectOptions + '}';
+ }
}
}
diff --git a/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/wrapper/QrCodeOptions.java b/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/wrapper/QrCodeOptions.java
index 1cb67f72..b7629010 100644
--- a/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/wrapper/QrCodeOptions.java
+++ b/plugins/qrcode-plugin/src/main/java/com/github/hui/quick/plugin/qrcode/wrapper/QrCodeOptions.java
@@ -5,8 +5,6 @@
import com.github.hui.quick.plugin.qrcode.entity.DotSize;
import com.github.hui.quick.plugin.qrcode.helper.QrCodeRenderHelper;
import com.google.zxing.EncodeHintType;
-import lombok.Builder;
-import lombok.Data;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
@@ -15,11 +13,11 @@
import java.awt.image.BufferedImage;
import java.util.HashMap;
import java.util.Map;
+import java.util.Objects;
/**
* Created by yihui on 2017/7/17.
*/
-@Data
public class QrCodeOptions {
/**
* 塞入二维码的信息
@@ -82,11 +80,111 @@ public boolean gifQrCode() {
}
+ public String getMsg() {
+ return msg;
+ }
+
+ public void setMsg(String msg) {
+ this.msg = msg;
+ }
+
+ public Integer getW() {
+ return w;
+ }
+
+ public void setW(Integer w) {
+ this.w = w;
+ }
+
+ public Integer getH() {
+ return h;
+ }
+
+ public void setH(Integer h) {
+ this.h = h;
+ }
+
+ public DrawOptions getDrawOptions() {
+ return drawOptions;
+ }
+
+ public void setDrawOptions(DrawOptions drawOptions) {
+ this.drawOptions = drawOptions;
+ }
+
+ public BgImgOptions getBgImgOptions() {
+ return bgImgOptions;
+ }
+
+ public void setBgImgOptions(BgImgOptions bgImgOptions) {
+ this.bgImgOptions = bgImgOptions;
+ }
+
+ public LogoOptions getLogoOptions() {
+ return logoOptions;
+ }
+
+ public void setLogoOptions(LogoOptions logoOptions) {
+ this.logoOptions = logoOptions;
+ }
+
+ public DetectOptions getDetectOptions() {
+ return detectOptions;
+ }
+
+ public void setDetectOptions(DetectOptions detectOptions) {
+ this.detectOptions = detectOptions;
+ }
+
+ public Map getHints() {
+ return hints;
+ }
+
+ public void setHints(Map hints) {
+ this.hints = hints;
+ }
+
+ public String getPicType() {
+ return picType;
+ }
+
+ public void setPicType(String picType) {
+ this.picType = picType;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ QrCodeOptions options = (QrCodeOptions) o;
+ return Objects.equals(msg, options.msg) && Objects.equals(w, options.w) && Objects.equals(h, options.h) &&
+ Objects.equals(drawOptions, options.drawOptions) &&
+ Objects.equals(bgImgOptions, options.bgImgOptions) &&
+ Objects.equals(logoOptions, options.logoOptions) &&
+ Objects.equals(detectOptions, options.detectOptions) && Objects.equals(hints, options.hints) &&
+ Objects.equals(picType, options.picType);
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(msg, w, h, drawOptions, bgImgOptions, logoOptions, detectOptions, hints, picType);
+ }
+
+ @Override
+ public String toString() {
+ return "QrCodeOptions{" + "msg='" + msg + '\'' + ", w=" + w + ", h=" + h + ", drawOptions=" + drawOptions +
+ ", bgImgOptions=" + bgImgOptions + ", logoOptions=" + logoOptions + ", detectOptions=" + detectOptions +
+ ", hints=" + hints + ", picType='" + picType + '\'' + '}';
+ }
+
/**
* logo 的配置信息
*/
- @Builder
- @Data
public static class LogoOptions {
/**
@@ -124,14 +222,190 @@ public static class LogoOptions {
* 用于设置logo的透明度
*/
private Float opacity;
+
+ public LogoOptions() {
+ }
+
+ public LogoOptions(BufferedImage logo, LogoStyle logoStyle, int rate, boolean border, Color borderColor,
+ Color outerBorderColor, Float opacity) {
+ this.logo = logo;
+ this.logoStyle = logoStyle;
+ this.rate = rate;
+ this.border = border;
+ this.borderColor = borderColor;
+ this.outerBorderColor = outerBorderColor;
+ this.opacity = opacity;
+ }
+
+ public BufferedImage getLogo() {
+ return logo;
+ }
+
+ public void setLogo(BufferedImage logo) {
+ this.logo = logo;
+ }
+
+ public LogoStyle getLogoStyle() {
+ return logoStyle;
+ }
+
+ public void setLogoStyle(LogoStyle logoStyle) {
+ this.logoStyle = logoStyle;
+ }
+
+ public int getRate() {
+ return rate;
+ }
+
+ public void setRate(int rate) {
+ this.rate = rate;
+ }
+
+ public boolean isBorder() {
+ return border;
+ }
+
+ public void setBorder(boolean border) {
+ this.border = border;
+ }
+
+ public Color getBorderColor() {
+ return borderColor;
+ }
+
+ public void setBorderColor(Color borderColor) {
+ this.borderColor = borderColor;
+ }
+
+ public Color getOuterBorderColor() {
+ return outerBorderColor;
+ }
+
+ public void setOuterBorderColor(Color outerBorderColor) {
+ this.outerBorderColor = outerBorderColor;
+ }
+
+ public Float getOpacity() {
+ return opacity;
+ }
+
+ public void setOpacity(Float opacity) {
+ this.opacity = opacity;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ LogoOptions that = (LogoOptions) o;
+ return rate == that.rate && border == that.border && Objects.equals(logo, that.logo) &&
+ logoStyle == that.logoStyle && Objects.equals(borderColor, that.borderColor) &&
+ Objects.equals(outerBorderColor, that.outerBorderColor) && Objects.equals(opacity, that.opacity);
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(logo, logoStyle, rate, border, borderColor, outerBorderColor, opacity);
+ }
+
+ @Override
+ public String toString() {
+ return "LogoOptions{" + "logo=" + logo + ", logoStyle=" + logoStyle + ", rate=" + rate + ", border=" +
+ border + ", borderColor=" + borderColor + ", outerBorderColor=" + outerBorderColor + ", opacity=" +
+ opacity + '}';
+ }
+
+ public static LogoOptionsBuilder builder() {
+ return new LogoOptionsBuilder();
+ }
+
+ public static class LogoOptionsBuilder {
+ /**
+ * logo 图片
+ */
+ private BufferedImage logo;
+
+ /**
+ * logo 样式
+ */
+ private LogoStyle logoStyle;
+
+ /**
+ * logo 占二维码的比例
+ */
+ private int rate;
+
+ /**
+ * true 表示有边框,
+ * false 表示无边框
+ */
+ private boolean border;
+
+ /**
+ * 边框颜色
+ */
+ private Color borderColor;
+
+ /**
+ * 外围边框颜色
+ */
+ private Color outerBorderColor;
+
+ /**
+ * 用于设置logo的透明度
+ */
+ private Float opacity;
+
+ public LogoOptionsBuilder logo(BufferedImage logo) {
+ this.logo = logo;
+ return this;
+ }
+
+ public LogoOptionsBuilder logoStyle(LogoStyle logoStyle) {
+ this.logoStyle = logoStyle;
+ return this;
+ }
+
+ public LogoOptionsBuilder rate(int rate) {
+ this.rate = rate;
+ return this;
+ }
+
+ public LogoOptionsBuilder border(boolean border) {
+ this.border = border;
+ return this;
+ }
+
+ public LogoOptionsBuilder borderColor(Color borderColor) {
+ this.borderColor = borderColor;
+ return this;
+ }
+
+ public LogoOptionsBuilder outerBorderColor(Color outerBorderColor) {
+ this.outerBorderColor = outerBorderColor;
+ return this;
+ }
+
+ public LogoOptionsBuilder opacity(Float opacity) {
+ this.opacity = opacity;
+ return this;
+ }
+
+ public LogoOptions build() {
+ return new LogoOptions(logo, logoStyle, rate, border, borderColor, outerBorderColor, opacity);
+ }
+ }
}
/**
* 背景图的配置信息
*/
- @Builder
- @Data
public static class BgImgOptions {
/**
* 背景图
@@ -180,6 +454,20 @@ public static class BgImgOptions {
*/
private int startY;
+ public BgImgOptions() {
+ }
+
+ public BgImgOptions(BufferedImage bgImg, GifDecoder gifDecoder, int bgW, int bgH, BgImgStyle bgImgStyle,
+ float opacity, int startX, int startY) {
+ this.bgImg = bgImg;
+ this.gifDecoder = gifDecoder;
+ this.bgW = bgW;
+ this.bgH = bgH;
+ this.bgImgStyle = bgImgStyle;
+ this.opacity = opacity;
+ this.startX = startX;
+ this.startY = startY;
+ }
public int getBgW() {
if (bgImgStyle == BgImgStyle.FILL && bgW == 0) {
@@ -202,14 +490,192 @@ public int getBgH() {
}
return bgH;
}
+
+ public BufferedImage getBgImg() {
+ return bgImg;
+ }
+
+ public void setBgImg(BufferedImage bgImg) {
+ this.bgImg = bgImg;
+ }
+
+ public GifDecoder getGifDecoder() {
+ return gifDecoder;
+ }
+
+ public void setGifDecoder(GifDecoder gifDecoder) {
+ this.gifDecoder = gifDecoder;
+ }
+
+ public void setBgW(int bgW) {
+ this.bgW = bgW;
+ }
+
+ public void setBgH(int bgH) {
+ this.bgH = bgH;
+ }
+
+ public BgImgStyle getBgImgStyle() {
+ return bgImgStyle;
+ }
+
+ public void setBgImgStyle(BgImgStyle bgImgStyle) {
+ this.bgImgStyle = bgImgStyle;
+ }
+
+ public float getOpacity() {
+ return opacity;
+ }
+
+ public void setOpacity(float opacity) {
+ this.opacity = opacity;
+ }
+
+ public int getStartX() {
+ return startX;
+ }
+
+ public void setStartX(int startX) {
+ this.startX = startX;
+ }
+
+ public int getStartY() {
+ return startY;
+ }
+
+ public void setStartY(int startY) {
+ this.startY = startY;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ BgImgOptions that = (BgImgOptions) o;
+ return bgW == that.bgW && bgH == that.bgH && Float.compare(that.opacity, opacity) == 0 &&
+ startX == that.startX && startY == that.startY && Objects.equals(bgImg, that.bgImg) &&
+ Objects.equals(gifDecoder, that.gifDecoder) && bgImgStyle == that.bgImgStyle;
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(bgImg, gifDecoder, bgW, bgH, bgImgStyle, opacity, startX, startY);
+ }
+
+ @Override
+ public String toString() {
+ return "BgImgOptions{" + "bgImg=" + bgImg + ", gifDecoder=" + gifDecoder + ", bgW=" + bgW + ", bgH=" + bgH +
+ ", bgImgStyle=" + bgImgStyle + ", opacity=" + opacity + ", startX=" + startX + ", startY=" +
+ startY + '}';
+ }
+
+ public static BgImgOptionsBuilder builder() {
+ return new BgImgOptionsBuilder();
+ }
+
+ public static class BgImgOptionsBuilder {
+ /**
+ * 背景图
+ */
+ private BufferedImage bgImg;
+
+ /**
+ * 动态背景图
+ */
+ private GifDecoder gifDecoder;
+
+ /**
+ * 背景图宽
+ */
+ private int bgW;
+
+ /**
+ * 背景图高
+ */
+ private int bgH;
+
+ /**
+ * 背景图样式
+ */
+ private BgImgStyle bgImgStyle;
+
+ /**
+ * if {@link #bgImgStyle} == QrCodeOptions.BgImgStyle.OVERRIDE,
+ * 用于设置二维码的透明度
+ */
+ private float opacity;
+
+
+ /**
+ * if {@link #bgImgStyle} == QrCodeOptions.BgImgStyle.FILL
+ *
+ * 用于设置二维码的绘制在背景图上的x坐标
+ */
+ private int startX;
+
+
+ /**
+ * if {@link #bgImgStyle} == QrCodeOptions.BgImgStyle.FILL
+ *
+ * 用于设置二维码的绘制在背景图上的y坐标
+ */
+ private int startY;
+
+ public BgImgOptionsBuilder bgImg(BufferedImage bgImg) {
+ this.bgImg = bgImg;
+ return this;
+ }
+
+ public BgImgOptionsBuilder gifDecoder(GifDecoder gifDecoder) {
+ this.gifDecoder = gifDecoder;
+ return this;
+ }
+
+ public BgImgOptionsBuilder bgW(int bgW) {
+ this.bgW = bgW;
+ return this;
+ }
+
+ public BgImgOptionsBuilder bgH(int bgH) {
+ this.bgH = bgH;
+ return this;
+ }
+
+ public BgImgOptionsBuilder bgImgStyle(BgImgStyle bgImgStyle) {
+ this.bgImgStyle = bgImgStyle;
+ return this;
+ }
+
+ public BgImgOptionsBuilder opacity(float opacity) {
+ this.opacity = opacity;
+ return this;
+ }
+
+ public BgImgOptionsBuilder startX(int startX) {
+ this.startX = startX;
+ return this;
+ }
+
+ public BgImgOptionsBuilder startY(int startY) {
+ this.startY = startY;
+ return this;
+ }
+
+ public BgImgOptions build() {
+ return new BgImgOptions(bgImg, gifDecoder, bgW, bgH, bgImgStyle, opacity, startX, startY);
+ }
+ }
}
/**
* 探测图形的配置信息
*/
- @Builder
- @Data
public static class DetectOptions {
private Color outColor;
@@ -245,6 +711,72 @@ public Boolean getSpecial() {
return BooleanUtils.isTrue(special);
}
+ public DetectOptions() {
+ }
+
+ public DetectOptions(Color outColor, Color inColor, BufferedImage detectImg, BufferedImage detectImgLT,
+ BufferedImage detectImgRT, BufferedImage detectImgLD, Boolean special) {
+ this.outColor = outColor;
+ this.inColor = inColor;
+ this.detectImg = detectImg;
+ this.detectImgLT = detectImgLT;
+ this.detectImgRT = detectImgRT;
+ this.detectImgLD = detectImgLD;
+ this.special = special;
+ }
+
+ public Color getOutColor() {
+ return outColor;
+ }
+
+ public void setOutColor(Color outColor) {
+ this.outColor = outColor;
+ }
+
+ public Color getInColor() {
+ return inColor;
+ }
+
+ public void setInColor(Color inColor) {
+ this.inColor = inColor;
+ }
+
+ public BufferedImage getDetectImg() {
+ return detectImg;
+ }
+
+ public void setDetectImg(BufferedImage detectImg) {
+ this.detectImg = detectImg;
+ }
+
+ public BufferedImage getDetectImgLT() {
+ return detectImgLT;
+ }
+
+ public void setDetectImgLT(BufferedImage detectImgLT) {
+ this.detectImgLT = detectImgLT;
+ }
+
+ public BufferedImage getDetectImgRT() {
+ return detectImgRT;
+ }
+
+ public void setDetectImgRT(BufferedImage detectImgRT) {
+ this.detectImgRT = detectImgRT;
+ }
+
+ public BufferedImage getDetectImgLD() {
+ return detectImgLD;
+ }
+
+ public void setDetectImgLD(BufferedImage detectImgLD) {
+ this.detectImgLD = detectImgLD;
+ }
+
+ public void setSpecial(Boolean special) {
+ this.special = special;
+ }
+
public BufferedImage chooseDetectedImg(QrCodeRenderHelper.DetectLocation detectLocation) {
switch (detectLocation) {
case LD:
@@ -258,13 +790,98 @@ public BufferedImage chooseDetectedImg(QrCodeRenderHelper.DetectLocation detectL
}
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ DetectOptions that = (DetectOptions) o;
+ return Objects.equals(outColor, that.outColor) && Objects.equals(inColor, that.inColor) &&
+ Objects.equals(detectImg, that.detectImg) && Objects.equals(detectImgLT, that.detectImgLT) &&
+ Objects.equals(detectImgRT, that.detectImgRT) && Objects.equals(detectImgLD, that.detectImgLD) &&
+ Objects.equals(special, that.special);
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(outColor, inColor, detectImg, detectImgLT, detectImgRT, detectImgLD, special);
+ }
+
+ @Override
+ public String toString() {
+ return "DetectOptions{" + "outColor=" + outColor + ", inColor=" + inColor + ", detectImg=" + detectImg +
+ ", detectImgLT=" + detectImgLT + ", detectImgRT=" + detectImgRT + ", detectImgLD=" + detectImgLD +
+ ", special=" + special + '}';
+ }
+
+ public static DetectOptionsBuilder builder() {
+ return new DetectOptionsBuilder();
+ }
+
+ public static class DetectOptionsBuilder {
+ private Color outColor;
+
+ private Color inColor;
+
+ private BufferedImage detectImg;
+
+ private BufferedImage detectImgLT;
+
+ private BufferedImage detectImgRT;
+
+ private BufferedImage detectImgLD;
+
+ private Boolean special;
+
+ public DetectOptionsBuilder outColor(Color outColor) {
+ this.outColor = outColor;
+ return this;
+ }
+
+ public DetectOptionsBuilder inColor(Color inColor) {
+ this.inColor = inColor;
+ return this;
+ }
+
+ public DetectOptionsBuilder detectImg(BufferedImage detectImg) {
+ this.detectImg = detectImg;
+ return this;
+ }
+
+ public DetectOptionsBuilder detectImgLT(BufferedImage detectImgLT) {
+ this.detectImgLT = detectImgLT;
+ return this;
+ }
+
+ public DetectOptionsBuilder detectImgRT(BufferedImage detectImgRT) {
+ this.detectImgRT = detectImgRT;
+ return this;
+ }
+
+ public DetectOptionsBuilder detectImgLD(BufferedImage detectImgLD) {
+ this.detectImgLD = detectImgLD;
+ return this;
+ }
+
+ public DetectOptionsBuilder special(Boolean special) {
+ this.special = special;
+ return this;
+ }
+
+ public DetectOptions build() {
+ return new DetectOptions(outColor, inColor, detectImg, detectImgLT, detectImgRT, detectImgLD, special);
+ }
+ }
}
/**
* 绘制二维码的配置信息
*/
- @Data
public static class DrawOptions {
/**
* 着色颜色
@@ -344,6 +961,126 @@ public String getDrawQrTxt() {
return QuickQrUtil.qrTxt(text, txtMode != null && txtMode == TxtMode.RANDOM);
}
+ public Color getPreColor() {
+ return preColor;
+ }
+
+ public void setPreColor(Color preColor) {
+ this.preColor = preColor;
+ }
+
+ public Color getBgColor() {
+ return bgColor;
+ }
+
+ public void setBgColor(Color bgColor) {
+ this.bgColor = bgColor;
+ }
+
+ public BufferedImage getBgImg() {
+ return bgImg;
+ }
+
+ public void setBgImg(BufferedImage bgImg) {
+ this.bgImg = bgImg;
+ }
+
+ public DrawStyle getDrawStyle() {
+ return drawStyle;
+ }
+
+ public void setDrawStyle(DrawStyle drawStyle) {
+ this.drawStyle = drawStyle;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public String getFontName() {
+ return fontName;
+ }
+
+ public void setFontName(String fontName) {
+ this.fontName = fontName;
+ }
+
+ public TxtMode getTxtMode() {
+ return txtMode;
+ }
+
+ public void setTxtMode(TxtMode txtMode) {
+ this.txtMode = txtMode;
+ }
+
+ public int getFontStyle() {
+ return fontStyle;
+ }
+
+ public void setFontStyle(int fontStyle) {
+ this.fontStyle = fontStyle;
+ }
+
+ public boolean isEnableScale() {
+ return enableScale;
+ }
+
+ public void setEnableScale(boolean enableScale) {
+ this.enableScale = enableScale;
+ }
+
+ public boolean isDiaphaneityFill() {
+ return diaphaneityFill;
+ }
+
+ public void setDiaphaneityFill(boolean diaphaneityFill) {
+ this.diaphaneityFill = diaphaneityFill;
+ }
+
+ public Map getImgMapper() {
+ return imgMapper;
+ }
+
+ public void setImgMapper(Map imgMapper) {
+ this.imgMapper = imgMapper;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ DrawOptions that = (DrawOptions) o;
+ return fontStyle == that.fontStyle && enableScale == that.enableScale &&
+ diaphaneityFill == that.diaphaneityFill && Objects.equals(preColor, that.preColor) &&
+ Objects.equals(bgColor, that.bgColor) && Objects.equals(bgImg, that.bgImg) &&
+ drawStyle == that.drawStyle && Objects.equals(text, that.text) &&
+ Objects.equals(fontName, that.fontName) && txtMode == that.txtMode &&
+ Objects.equals(imgMapper, that.imgMapper);
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(preColor, bgColor, bgImg, drawStyle, text, fontName, txtMode, fontStyle, enableScale,
+ diaphaneityFill, imgMapper);
+ }
+
+ @Override
+ public String toString() {
+ return "DrawOptions{" + "preColor=" + preColor + ", bgColor=" + bgColor + ", bgImg=" + bgImg +
+ ", drawStyle=" + drawStyle + ", text='" + text + '\'' + ", fontName='" + fontName + '\'' +
+ ", txtMode=" + txtMode + ", fontStyle=" + fontStyle + ", enableScale=" + enableScale +
+ ", diaphaneityFill=" + diaphaneityFill + ", imgMapper=" + imgMapper + '}';
+ }
+
public static DrawOptionsBuilder builder() {
return new DrawOptionsBuilder();
}
diff --git a/plugins/qrcode-plugin/src/test/java/com/github/hui/quick/plugin/test/QrCodeWrapperTest.java b/plugins/qrcode-plugin/src/test/java/com/github/hui/quick/plugin/test/QrCodeWrapperTest.java
index 76a8f280..f018af0b 100644
--- a/plugins/qrcode-plugin/src/test/java/com/github/hui/quick/plugin/test/QrCodeWrapperTest.java
+++ b/plugins/qrcode-plugin/src/test/java/com/github/hui/quick/plugin/test/QrCodeWrapperTest.java
@@ -10,8 +10,9 @@
import com.google.zxing.WriterException;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import junit.framework.Assert;
-import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.imageio.ImageIO;
import java.awt.*;
@@ -23,8 +24,8 @@
/**
* Created by yihui on 2017/7/17.
*/
-@Slf4j
public class QrCodeWrapperTest {
+ private static final Logger log = LoggerFactory.getLogger(QrCodeWrapperTest.class);
private String msg = "https://liuyueyi.github.io/hexblog/2018/03/23/mysql之锁与事务详解/";
diff --git a/plugins/svg-plugin/batik-codec-fix/pom.xml b/plugins/svg-plugin/batik-codec-fix/pom.xml
index 4254270c..d141d875 100644
--- a/plugins/svg-plugin/batik-codec-fix/pom.xml
+++ b/plugins/svg-plugin/batik-codec-fix/pom.xml
@@ -5,12 +5,12 @@
svg-plugin
com.github.hui.media
- 2.4
+ 2.5
4.0.0
batik-codec-fix
- 2.4
+ 2.5
diff --git a/plugins/svg-plugin/pom.xml b/plugins/svg-plugin/pom.xml
index 2fbac281..8ad1629d 100644
--- a/plugins/svg-plugin/pom.xml
+++ b/plugins/svg-plugin/pom.xml
@@ -5,12 +5,12 @@
plugins
com.github.hui.media
- 2.4
+ 2.5
4.0.0
svg-plugin
- 2.4
+ 2.5
pom
diff --git a/plugins/svg-plugin/svg-core/pom.xml b/plugins/svg-plugin/svg-core/pom.xml
index 8021073a..8f601c89 100644
--- a/plugins/svg-plugin/svg-core/pom.xml
+++ b/plugins/svg-plugin/svg-core/pom.xml
@@ -5,12 +5,12 @@
svg-plugin
com.github.hui.media
- 2.4
+ 2.5
4.0.0
svg-core
- 2.4
+ 2.5
diff --git a/pom.xml b/pom.xml
index f9382bda..eaa773ad 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,10 +20,13 @@
yihui-maven-repo
https://raw.githubusercontent.com/liuyueyi/maven-repository/master/repository
+
+ jitpack.io
+ https://jitpack.io
+
- 1.0.1
UTF-8
UTF-8
1.8