默认
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.
 
 

65 lines
1.5 KiB

package com.fr.plugin.sqy.surface.option;
import com.fanruan.api.json.JSONKit;
import com.finebi.cbb.utils.data.NumberUtils;
import com.fr.json.JSONObject;
import com.fr.plugin.sqy.surface.option.modle.OptionProvider;
import com.fr.plugin.sqy.surface.util.PluginStringUtils;
import com.fr.stable.StringUtils;
import java.awt.*;
public class LineStyle implements OptionProvider {
private Color color;
private double width;
private String type;
public LineStyle() {
}
public LineStyle(Color color, double width, String type) {
this.color = color;
this.width = width;
this.type = type;
}
public Color getColor() {
return color;
}
public void setColor(Color color) {
this.color = color;
}
public double getWidth() {
return width;
}
public void setWidth(double width) {
this.width = width;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
public JSONObject getJSONObject() {
JSONObject lineStyle = JSONKit.create();
if(this.getColor() != null){
lineStyle.put("color", PluginStringUtils.colorToString(this.getColor()));
}
if(this.getWidth() != 0){
lineStyle.put("width",this.getWidth());
}
if(StringUtils.isNotBlank(this.getType())){
lineStyle.put("type",this.getType());
}
return lineStyle;
}
}