|
@@ -13,75 +13,6 @@ export class SLineLegendItem extends SPolylineItem {
|
|
|
|
|
|
data: Legend;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- set name(v: string) {
|
|
|
- this.data.Name = v;
|
|
|
- }
|
|
|
-
|
|
|
- set line(arr: SPoint[]) {
|
|
|
- if (this.data.Properties) {
|
|
|
- this.data.Properties.Line = arr;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- set x(v: number) {
|
|
|
- this.data.Pos.X = v;
|
|
|
- }
|
|
|
-
|
|
|
- set y(v: number) {
|
|
|
- this.data.Pos.Y = v;
|
|
|
- }
|
|
|
-
|
|
|
- set width(v: number) {
|
|
|
- if (this.data.Size) {
|
|
|
- this.data.Size.Width = v;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- set height(v: number) {
|
|
|
- if (this.data.Size) {
|
|
|
- this.data.Size.Height = v;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
* 构造函数
|
|
|
*
|
|
@@ -92,20 +23,33 @@ export class SLineLegendItem extends SPolylineItem {
|
|
|
super(parent,[]);
|
|
|
this.data = data;
|
|
|
this.id = data.ID;
|
|
|
+ this.name = data.Name;
|
|
|
this.moveTo(data.Pos.X, data.Pos.Y);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- if (data.Size) {
|
|
|
- this.width = data.Size.Width;
|
|
|
- this.height = data.Size.Height;
|
|
|
- }
|
|
|
if (data.Properties && data.Properties.Line) {
|
|
|
- this.line = data.Properties.Line;
|
|
|
+ let setPointList: SPoint[];
|
|
|
+ setPointList = data.Properties.Line.map(i => {
|
|
|
+ return new SPoint(i.x, i.y)
|
|
|
+ })
|
|
|
+ this.pointList = setPointList;
|
|
|
+ }
|
|
|
+ if (data.Properties && data.Properties.LineWidth) {
|
|
|
+ this.lineWidth = data.Properties.LineWidth;
|
|
|
+ }
|
|
|
+ if (data.Properties && data.Properties.StrokeColor) {
|
|
|
+ this.strokeColor = data.Properties.StrokeColor;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ toData(): Legend {
|
|
|
+ this.data.Pos = {X: this.x, Y: this.y};
|
|
|
+ this.data.Properties.Line = this.pointList.map(pos => {
|
|
|
+ return {
|
|
|
+ X: pos.x,
|
|
|
+ Y: pos.y
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.data.Properties.LineWidth = this.lineWidth;
|
|
|
+ this.data.Properties.StrokeColor = this.strokeColor;
|
|
|
+ return this.data;
|
|
|
+ }
|
|
|
}
|