pxt-ev3/sim/visuals/nodes/portView.ts

25 lines
666 B
TypeScript
Raw Normal View History

/// <reference path="./moduleView.ts" />
2017-12-18 22:04:17 +01:00
namespace pxsim.visuals {
export class PortView extends ModuleView implements LayoutElement {
2017-12-18 22:04:17 +01:00
constructor(port: NodeType, private label: string) {
super(PORT_SVG, "port", NodeType.Port, port);
}
protected buildDomCore() {
const textLabel = this.content.getElementById(this.normalizeId("port_text")) as SVGTextElement;
textLabel.textContent = this.label;
textLabel.style.userSelect = 'none';
}
public getPaddingRatio() {
return 1 / 6;
}
public hasClick() {
return false;
}
}
}