|
@@ -7,6 +7,11 @@ import { SGraphItem } from "../SGraphItem";
|
|
*
|
|
*
|
|
* @author 张宇(taohuzy@163.com)
|
|
* @author 张宇(taohuzy@163.com)
|
|
*/
|
|
*/
|
|
|
|
+/**
|
|
|
|
+ * 文本item
|
|
|
|
+ *
|
|
|
|
+ * @author 张宇(taohuzy@163.com)
|
|
|
|
+ */
|
|
export class STextItem extends SObjectItem {
|
|
export class STextItem extends SObjectItem {
|
|
/** 文本内容 */
|
|
/** 文本内容 */
|
|
private _text: string = "";
|
|
private _text: string = "";
|
|
@@ -39,21 +44,21 @@ export class STextItem extends SObjectItem {
|
|
}
|
|
}
|
|
|
|
|
|
/** 背景色 */
|
|
/** 背景色 */
|
|
- private _backgroundColor: string = "#00000000";
|
|
|
|
- get backgroundColor(): string {
|
|
|
|
|
|
+ private _backgroundColor: SColor = new SColor("#00000000");
|
|
|
|
+ get backgroundColor(): SColor {
|
|
return this._backgroundColor;
|
|
return this._backgroundColor;
|
|
}
|
|
}
|
|
- set backgroundColor(v: string) {
|
|
|
|
|
|
+ set backgroundColor(v: SColor) {
|
|
this._backgroundColor = v;
|
|
this._backgroundColor = v;
|
|
this.update();
|
|
this.update();
|
|
}
|
|
}
|
|
|
|
|
|
/** 边框色 */
|
|
/** 边框色 */
|
|
- private _strokeColor: string = "#00000000";
|
|
|
|
- get strokeColor(): string {
|
|
|
|
|
|
+ private _strokeColor: SColor = new SColor("#00000000");
|
|
|
|
+ get strokeColor(): SColor {
|
|
return this._strokeColor;
|
|
return this._strokeColor;
|
|
}
|
|
}
|
|
- set strokeColor(v: string) {
|
|
|
|
|
|
+ set strokeColor(v: SColor) {
|
|
this._strokeColor = v;
|
|
this._strokeColor = v;
|
|
this.update();
|
|
this.update();
|
|
}
|
|
}
|
|
@@ -103,8 +108,8 @@ export class STextItem extends SObjectItem {
|
|
protected drawShowText(painter: SPainter): void {
|
|
protected drawShowText(painter: SPainter): void {
|
|
//绘制矩形轮廓
|
|
//绘制矩形轮廓
|
|
if (this.showBorder) {
|
|
if (this.showBorder) {
|
|
- painter.brush.color = new SColor(this.backgroundColor);
|
|
|
|
- painter.pen.color = new SColor(this.strokeColor);
|
|
|
|
|
|
+ painter.brush.color = this.backgroundColor;
|
|
|
|
+ painter.pen.color = this.strokeColor;
|
|
painter.drawRect(this.boundingRect());
|
|
painter.drawRect(this.boundingRect());
|
|
}
|
|
}
|
|
|
|
|