|
@@ -2,8 +2,8 @@
|
|
|
import { SGraphItem } from "@saga-web/graph/lib";
|
|
|
import { SIconTextItem } from '@saga-web/big/lib/items/SIconTextItem';
|
|
|
import { Legend } from '../types/Legend';
|
|
|
-import { ItemOrder } from '@saga-web/big/lib';
|
|
|
-import { SFont, SColor } from '@saga-web/draw/lib';
|
|
|
+import { ItemOrder, SItemStatus } from '@saga-web/big/lib';
|
|
|
+import { SFont, SColor, SPainter, SRect } from '@saga-web/draw/lib';
|
|
|
/**
|
|
|
* 图例节点Item(图标类型)
|
|
|
*
|
|
@@ -30,6 +30,19 @@ export class SImageLegendItem extends SIconTextItem {
|
|
|
this.update();
|
|
|
}
|
|
|
|
|
|
+ /** 是否蒙版遮罩 */
|
|
|
+ _maskFlag: boolean = false;
|
|
|
+ get maskFlag(): boolean {
|
|
|
+ return this._maskFlag;
|
|
|
+ }
|
|
|
+ set maskFlag(v: boolean) {
|
|
|
+ if (v === this._maskFlag) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this._maskFlag = v;
|
|
|
+ this.update()
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 构造函数
|
|
|
*
|
|
@@ -110,4 +123,24 @@ export class SImageLegendItem extends SIconTextItem {
|
|
|
})
|
|
|
return this.data;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Item绘制框架
|
|
|
+ *
|
|
|
+ * @param painter painter对象
|
|
|
+ * @param rect 绘制区域
|
|
|
+ */
|
|
|
+ onPaint(painter: SPainter, rect: SRect): void {
|
|
|
+ super.onPaint(painter, rect);
|
|
|
+ if (this.maskFlag && this.status == SItemStatus.Normal) {
|
|
|
+ painter.pen.color = SColor.Transparent;
|
|
|
+ painter.brush.color = new SColor("#ffffffa1");
|
|
|
+ if (this.selected) {
|
|
|
+ painter.drawCircle(this.img.x, this.img.y, (this.sWidth / 2.0) * 1.25);
|
|
|
+ } else {
|
|
|
+ painter.drawCircle(this.img.x, this.img.y, this.sWidth / 2.0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } // Function onPaint()
|
|
|
+
|
|
|
} // Class SImageLegendItem
|