1 /** 2 *"..i have changed in the basic.js file and added the following function 3 *its for creating the icon stop..." 4 *@author Nour Al-Harake <n_harake@hotmail.com> 5 **/ 6 function figure_Stop(x,y) 7 { 8 9 var r = new Polygon(); 10 r.addPoint(new Point(x, y)); 11 r.addPoint(new Point(x + figure_defaultFigureSegmentSize, y)); 12 r.addPoint(new Point(x + figure_defaultFigureSegmentSize, y + figure_defaultFigureSegmentSize)); 13 r.addPoint(new Point(x, y + figure_defaultFigureSegmentSize)); 14 15 16 var f=new Figure("Square"); 17 f.style.fillStyle = figure_defaultFillStyle; 18 f.style.strokeStyle = figure_defaultStrokeStyle; 19 //todo: if uncomment next line it will creates artefacts 20 //f.style.image="Icons/Stop Form.ico"; 21 f.properties.push(new BuilderProperty('Text', 'primitives.1.str', BuilderProperty.TYPE_TEXT)); 22 f.properties.push(new BuilderProperty('Text Size ', 'primitives.1.size', BuilderProperty.TYPE_TEXT_FONT_SIZE)); 23 f.properties.push(new BuilderProperty('Font ', 'primitives.1.font', BuilderProperty.TYPE_TEXT_FONT_FAMILY)); 24 f.properties.push(new BuilderProperty('Alignment ', 'primitives.1.align', BuilderProperty.TYPE_TEXT_FONT_ALIGNMENT)); 25 f.properties.push(new BuilderProperty('Text Color', 'primitives.1.style.fillStyle', BuilderProperty.TYPE_COLOR)); 26 f.properties.push(new BuilderProperty(BuilderProperty.SEPARATOR)); 27 f.properties.push(new BuilderProperty('Stroke Style', 'style.strokeStyle', BuilderProperty.TYPE_COLOR)); 28 f.properties.push(new BuilderProperty('Fill Style', 'style.fillStyle', BuilderProperty.TYPE_COLOR)); 29 f.properties.push(new BuilderProperty('Line Width', 'style.lineWidth',BuilderProperty.TYPE_LINE_WIDTH));//f.properties.push(new BuilderProperty('Vertical Alignment ', 'primitives.1.valign', Text.VALIGNMENTS)); 30 f.addPrimitive(r); 31 32 var t2 = new Text(figure_defaultFigureTextStr, x + figure_defaultFigureSegmentSize/2, y + figure_defaultFigureSegmentSize/2, figure_defaultFigureTextFont, figure_defaultFigureTextSize); 33 t2.style.fillStyle = figure_defaultFillTextStyle; 34 f.addPrimitive(t2); 35 36 37 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize / 2, y),ConnectionPoint.TYPE_FIGURE); 38 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize, y + figure_defaultFigureSegmentSize / 2 - 10),ConnectionPoint.TYPE_FIGURE); 39 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize, y + figure_defaultFigureSegmentSize / 2 + 10),ConnectionPoint.TYPE_FIGURE); 40 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y + figure_defaultFigureSegmentSize / 2 - 10),ConnectionPoint.TYPE_FIGURE); 41 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y + figure_defaultFigureSegmentSize / 2 + 10),ConnectionPoint.TYPE_FIGURE); 42 f.finalise(); 43 return f; 44 45 }