package com.trade.service.filestorage.util.watermark;

import com.trade.common.utils.StringUtils;

/**
 * @description: 文字水印
 * @Author: wanglang
 * @Date: 2023/3/3 9:25
 * @Version: 1.0
 */
public class TextMark {

    /**
     * 水印内容
     */
    private String waterMarkText = "长安银科";
    /**
     * 旋转角度
     */
    private Integer degree = 30;
    /**
     * 字号
     */
    private Integer fontSize = 20;
    /**
     * 字体名称
     */
    private String fontName = "STSong-Light";
    /**
     * 字体颜色
     */
    private String fontColor;
    /**
     * 水印透明度
     */
    private float alpha = 0.08f;
    /**
     * 水印名称 excel水印是镶入图片的
     */
    private String waterMarkName;

    public TextMark(){
    }

    public TextMark(String waterMarkText){
        if (StringUtils.isNotEmpty(waterMarkText) && waterMarkText.contains("_")) {
            setWaterMarkName(waterMarkText.split("_")[0]);
            setWaterMarkText(waterMarkText.split("_")[1]);
        } else {
            setWaterMarkText(waterMarkText);
            setWaterMarkName(waterMarkText);
        }
    }

    public String getWaterMarkText() {
        return waterMarkText;
    }

    public void setWaterMarkText(String waterMarkText) {
        this.waterMarkText = waterMarkText;
    }

    public Integer getDegree() {
        return degree;
    }

    public void setDegree(Integer degree) {
        this.degree = degree;
    }

    public Integer getFontSize() {
        return fontSize;
    }

    public void setFontSize(Integer fontSize) {
        this.fontSize = fontSize;
    }

    public String getFontName() {
        return fontName;
    }

    public void setFontName(String fontName) {
        this.fontName = fontName;
    }

    public String getFontColor() {
        return fontColor;
    }

    public void setFontColor(String fontColor) {
        this.fontColor = fontColor;
    }

    public float getAlpha() {
        return alpha;
    }

    public void setAlpha(float alpha) {
        this.alpha = alpha;
    }

    public String getWaterMarkName() {
        return waterMarkName;
    }

    public void setWaterMarkName(String waterMarkName) {
        this.waterMarkName = waterMarkName;
    }
}
