From 4465d373639dad51dc11071cc7fb45fa314b4867 Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Tue, 26 May 2020 09:32:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1,=E5=8F=8D?= =?UTF-8?q?=E5=90=91=E5=90=88=E4=BB=A3=E7=A0=81=E5=BC=95=E8=B5=B7=E7=9A=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF=EF=BC=88=E5=A0=B5=E5=A1=9E=E6=89=93=E5=8C=85?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../text/html/simpleparser/IncCell.java | 5 +- .../text/html/simpleparser/IncTable.java | 2 +- .../text/html/utils}/BackgroundUtil.java | 96 +++++++++---------- 3 files changed, 50 insertions(+), 53 deletions(-) rename {fine-itext-old/src/main/java/com/fr/third/com/lowagie/text/html/Utils => fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/utils}/BackgroundUtil.java (94%) diff --git a/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/IncCell.java b/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/IncCell.java index 8b8318bb1..eaf6ec573 100644 --- a/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/IncCell.java +++ b/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/IncCell.java @@ -47,16 +47,13 @@ package com.fr.third.v2.lowagie.text.html.simpleparser; -import com.fr.third.v2.lowagie.text.html.Utils.BackgroundUtil; +import com.fr.third.v2.lowagie.text.html.utils.BackgroundUtil; import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; import com.fr.third.v2.lowagie.text.Element; import com.fr.third.v2.lowagie.text.ElementListener; import com.fr.third.v2.lowagie.text.TextElementArray; import com.fr.third.v2.lowagie.text.html.CSSUtils; -import com.fr.third.v2.lowagie.text.html.Markup; import com.fr.third.v2.lowagie.text.pdf.PdfPCell; import com.fr.third.v2.lowagie.text.Phrase; diff --git a/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/IncTable.java b/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/IncTable.java index 0e99b6d65..3fca955a7 100644 --- a/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/IncTable.java +++ b/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/IncTable.java @@ -48,7 +48,7 @@ package com.fr.third.v2.lowagie.text.html.simpleparser; import com.fr.third.v2.lowagie.text.html.HtmlTags; -import com.fr.third.v2.lowagie.text.html.Utils.BackgroundUtil; +import com.fr.third.v2.lowagie.text.html.utils.BackgroundUtil; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; diff --git a/fine-itext-old/src/main/java/com/fr/third/com/lowagie/text/html/Utils/BackgroundUtil.java b/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/utils/BackgroundUtil.java similarity index 94% rename from fine-itext-old/src/main/java/com/fr/third/com/lowagie/text/html/Utils/BackgroundUtil.java rename to fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/utils/BackgroundUtil.java index 61c0ce452..23cc892df 100644 --- a/fine-itext-old/src/main/java/com/fr/third/com/lowagie/text/html/Utils/BackgroundUtil.java +++ b/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/utils/BackgroundUtil.java @@ -1,48 +1,48 @@ -package com.fr.third.v2.lowagie.text.html.Utils; - -import com.fr.third.v2.lowagie.text.html.CSSUtils; -import com.fr.third.v2.lowagie.text.html.simpleparser.ChainedProperties; -import java.util.HashMap; -import java.util.Map; - -/** - * @author Hugh.C - * @version 1.0 - * Created by Hugh.C on 2020/2/26 - */ -public class BackgroundUtil { - - public static Map parse2RulesMap(ChainedProperties props) { - Map backgroundRules = new HashMap(); - String value = props.getProperty("bgcolor"); - if (value != null) { - backgroundRules.put("background-color", value); - } - value = props.getLastChainProperty("background-size"); - if (value != null) { - backgroundRules.put("background-size", value); - } - value = props.getLastChainProperty("background"); - if (value != null) { - Map backgroundStyles = CSSUtils.processBackground(value); - backgroundRules.putAll(backgroundStyles); - } - value = props.getLastChainProperty("background-color"); - if (value != null) { - backgroundRules.put("background-color", value); - } - value = props.getLastChainProperty("background-position"); - if (value != null) { - backgroundRules.put("background-position", value); - } - value = props.getLastChainProperty("background-repeat"); - if (value != null) { - backgroundRules.put("background-repeat", value); - } - value = props.getLastChainProperty("background-image"); - if (value != null) { - backgroundRules.put("background-image", value); - } - return backgroundRules; - } -} +package com.fr.third.v2.lowagie.text.html.utils; + +import com.fr.third.v2.lowagie.text.html.CSSUtils; +import com.fr.third.v2.lowagie.text.html.simpleparser.ChainedProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Hugh.C + * @version 1.0 + * Created by Hugh.C on 2020/2/26 + */ +public class BackgroundUtil { + + public static Map parse2RulesMap(ChainedProperties props) { + Map backgroundRules = new HashMap(); + String value = props.getProperty("bgcolor"); + if (value != null) { + backgroundRules.put("background-color", value); + } + value = props.getLastChainProperty("background-size"); + if (value != null) { + backgroundRules.put("background-size", value); + } + value = props.getLastChainProperty("background"); + if (value != null) { + Map backgroundStyles = CSSUtils.processBackground(value); + backgroundRules.putAll(backgroundStyles); + } + value = props.getLastChainProperty("background-color"); + if (value != null) { + backgroundRules.put("background-color", value); + } + value = props.getLastChainProperty("background-position"); + if (value != null) { + backgroundRules.put("background-position", value); + } + value = props.getLastChainProperty("background-repeat"); + if (value != null) { + backgroundRules.put("background-repeat", value); + } + value = props.getLastChainProperty("background-image"); + if (value != null) { + backgroundRules.put("background-image", value); + } + return backgroundRules; + } +}