You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
2.1 KiB
79 lines
2.1 KiB
2 years ago
|
/*
|
||
|
* Copyright (C), 2018-2022
|
||
|
* Project: starter
|
||
|
* FileName: PdfExportAttr
|
||
|
* Author: xx
|
||
|
* Date: 2022/1/4 13:58
|
||
|
*/
|
||
|
package com.fr.plugin.ajhdf.provider;
|
||
|
|
||
|
import com.fr.json.JSONException;
|
||
|
import com.fr.json.JSONObject;
|
||
|
import com.fr.stable.fun.Authorize;
|
||
|
import com.fr.stable.fun.impl.AbstractIOFileAttrMark;
|
||
|
import com.fr.stable.xml.XMLPrintWriter;
|
||
|
import com.fr.stable.xml.XMLableReader;
|
||
|
|
||
|
import static com.fr.plugin.ajhdf.LocaleFinder.PLUGIN_ID;
|
||
|
|
||
|
/**
|
||
|
* <Function Description><br>
|
||
|
* <PdfExportAttr>
|
||
|
*
|
||
|
* @author xx
|
||
|
* @since 1.0.0
|
||
|
*/
|
||
|
@Authorize(callSignKey = PLUGIN_ID)
|
||
|
public class PdfExportAttr extends AbstractIOFileAttrMark {
|
||
|
public final static String XML_TAG = "PdfExportAttr";
|
||
|
private static final long serialVersionUID = 6037990832141495913L;
|
||
|
// 边框缩放比例,参考GraphDrawHelper.drawLine() -> draw() -> getStroke() -> zoomStroke()
|
||
|
private float strokeScale;
|
||
|
|
||
|
public PdfExportAttr() {
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public String xmlTag() {
|
||
|
return XML_TAG;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void readXML(XMLableReader reader) {
|
||
|
if (reader.isChildNode()) {
|
||
|
String tagName = reader.getTagName();
|
||
|
if ("Attr".equals(tagName)) {
|
||
|
setStrokeScale(reader.getAttrAsFloat("strokeScale", 1.0F));
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void writeXML(XMLPrintWriter writer) {
|
||
|
writer.startTAG("Attr");
|
||
|
writer.attr("strokeScale", this.strokeScale);
|
||
|
writer.end();
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public PdfExportAttr clone() {
|
||
|
PdfExportAttr cloned = (PdfExportAttr) super.clone();
|
||
|
cloned.strokeScale = strokeScale;
|
||
|
return cloned;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public JSONObject createJSONConfig() throws JSONException {
|
||
|
JSONObject json = super.createJSONConfig();
|
||
|
json.put("strokeScale", this.strokeScale);
|
||
|
return json;
|
||
|
}
|
||
|
|
||
|
public float getStrokeScale() {
|
||
|
return strokeScale;
|
||
|
}
|
||
|
|
||
|
public void setStrokeScale(float strokeScale) {
|
||
|
this.strokeScale = strokeScale;
|
||
|
}
|
||
|
}
|