META-INF.resources.frontend.org.ikasan.draw2d.Cube.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ikasan-designer Show documentation
Show all versions of ikasan-designer Show documentation
Integration of vis.js library for Ikasan platform
The newest version!
TriangleFigure = draw2d.shape.basic.Polygon.extend({
init : function(attr)
{
this._super($.extend({bgColor:"#00a3f6",color:"#1B1B1B"},attr));
this.resetVertices();
var box = this.getBoundingBox();
this.addVertex(0 , 0); // Go to the top center..
this.addVertex(box.w, 0); // ...draw line to the right bottom
this.addVertex(box.w , box.h); // ...bottom left...
// it is not necessary to close the path. A Polygon is always closed by definition.
// (Use a Polyline if you need an open path)
// this.addVertex(box.w/2 , 0); // and close the path
// override the selection handler from the polygon. Because the vertices of
// the triangle are not selectable and modifiable
//
this.installEditPolicy(new RotateRectangleSelectionFeedbackPolicy());
this.setPosition(box.getTopLeft());
}
});