1 var figure_defaultFigureSegmentSize = 70; 2 var figure_defaultFigureSegmentShortSize = 40; 3 var figure_defaultFigureRadiusSize = 35; 4 var figure_defaultFigureParalelsOffsetSize = 40; 5 var figure_defaultFigureCorner = 10 6 7 var figure_defaultFigureCornerRoundness = 8; 8 9 var figure_defaultXCoordonate = 0; 10 var figure_defaultYCoordonate = 0; 11 12 var figure_defaultFigureTextSize = 12; 13 var figure_defaultFigureTextStr = "Text"; 14 var figure_defaultFigureTextFont = "Arial"; 15 var figure_defaultStrokeStyle = "#000000"; 16 var figure_defaultFillStyle = "#ffffff"; 17 var figure_defaultFillTextStyle = "#000000"; 18 19 function figure_CanvasImage(x, y){ 20 var f = new Figure("Image"); 21 var img = new CanvasImage(x, y, ""); 22 f.properties.push(new BuilderProperty('URL','primitives.0.URL', BuilderProperty.TYPE_SINGLE_TEXT)); 23 f.properties.push(new BuilderProperty('File','primitives.0.File', BuilderProperty.TYPE_IMAGE_UPLOAD)); 24 f.properties.push(new BuilderProperty('Encoded','primitives.0.encoded', BuilderProperty.TYPE_TEXT)); 25 f.properties.push(new BuilderProperty('Scaleing','primitives.0.fixed', BuilderProperty.TYPE_IMAGE_FILL)); 26 f.addPrimitive(img); 27 f.finalise(); 28 return f; 29 } 30 function figure_Polyline(x, y) 31 { 32 var f = new Figure("Polyline"); 33 f.style.fillStyle = figure_defaultFillStyle; 34 f.style.strokeStyle = figure_defaultStrokeStyle; 35 f.properties.push(new BuilderProperty('Fill Style', 'style.fillStyle', BuilderProperty.TYPE_COLOR)); 36 f.properties.push(new BuilderProperty('Line Width', 'style.lineWidth',BuilderProperty.TYPE_LINE_WIDTH)); 37 38 var p = new Polyline(); 39 p.addPoint(new Point(x, y)); 40 p.addPoint(new Point(x+50, y)); 41 p.addPoint(new Point(x+50, y+50)); 42 p.addPoint(new Point(x, y+50)); 43 p.addPoint(new Point(x, y)); 44 f.addPrimitive(p); 45 f.finalise(); 46 return f; 47 } 48 function figure_Rectangle(x, y) 49 { 50 var f = new Figure("Rectangle"); 51 f.style.fillStyle = figure_defaultFillStyle; 52 f.style.strokeStyle = figure_defaultStrokeStyle; 53 54 55 f.properties.push(new BuilderProperty('Text', 'primitives.1.str', BuilderProperty.TYPE_TEXT)); 56 f.properties.push(new BuilderProperty('Text Size', 'primitives.1.size', BuilderProperty.TYPE_TEXT_FONT_SIZE)); 57 f.properties.push(new BuilderProperty('Font', 'primitives.1.font', BuilderProperty.TYPE_TEXT_FONT_FAMILY)); 58 f.properties.push(new BuilderProperty('Alignment', 'primitives.1.align', BuilderProperty.TYPE_TEXT_FONT_ALIGNMENT)); 59 f.properties.push(new BuilderProperty('Text Color', 'primitives.1.style.fillStyle', BuilderProperty.TYPE_COLOR)); 60 61 f.properties.push(new BuilderProperty(BuilderProperty.SEPARATOR)); 62 f.properties.push(new BuilderProperty('Stroke Style', 'style.strokeStyle', BuilderProperty.TYPE_COLOR)); 63 f.properties.push(new BuilderProperty('Fill Style', 'style.fillStyle', BuilderProperty.TYPE_COLOR)); 64 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); 65 66 var r = new Polygon(); 67 // var r = new Polyline(); 68 // r.style.lineCap = r.style.STYLE_LINE_CAP_BUTT; 69 // r.style.lineJoin = r.style.STYLE_LINE_JOIN_MITER; 70 r.addPoint(new Point(x, y)); 71 r.addPoint(new Point(x + figure_defaultFigureSegmentSize, y)); 72 r.addPoint(new Point(x + figure_defaultFigureSegmentSize, y + figure_defaultFigureSegmentShortSize+5)); 73 r.addPoint(new Point(x, y + figure_defaultFigureSegmentShortSize+5)); 74 75 f.addPrimitive(r); 76 77 var t2 = new Text(figure_defaultFigureTextStr, x + figure_defaultFigureSegmentSize/2, y + figure_defaultFigureSegmentShortSize/2, figure_defaultFigureTextFont, figure_defaultFigureTextSize); 78 t2.style.fillStyle = figure_defaultFillTextStyle; 79 80 f.addPrimitive(t2); 81 82 //test line style 83 // f.addPrimitive(new Line(new Point(10, 10), new Point(300, 300))); 84 //end test 85 86 // //point 87 // var p = new Point(x + 50, y +50); 88 // f.addPrimitive(p); 89 90 var l = figure_defaultFigureSegmentShortSize + 5; 91 //top 92 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize / 2 - 10, y), ConnectionPoint.TYPE_FIGURE); 93 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize / 2, y), ConnectionPoint.TYPE_FIGURE); 94 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize / 2 + 10, y), ConnectionPoint.TYPE_FIGURE); 95 96 //bottom 97 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize / 2 - 10, y + l), ConnectionPoint.TYPE_FIGURE); 98 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize / 2, y + l), ConnectionPoint.TYPE_FIGURE); 99 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize / 2 + 10, y + l), ConnectionPoint.TYPE_FIGURE); 100 101 //right 102 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize, y + l / 2 - 10), ConnectionPoint.TYPE_FIGURE); 103 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize, y + l / 2), ConnectionPoint.TYPE_FIGURE); 104 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize, y + l / 2 + 10), ConnectionPoint.TYPE_FIGURE); 105 106 //left 107 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y + l / 2 - 10), ConnectionPoint.TYPE_FIGURE); 108 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y + l / 2), ConnectionPoint.TYPE_FIGURE); 109 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y + l / 2 + 10), ConnectionPoint.TYPE_FIGURE); 110 111 f.finalise(); 112 return f; 113 } 114 115 function figure_Square(x,y) 116 { 117 var r = new Polygon(); 118 r.addPoint(new Point(x, y)); 119 r.addPoint(new Point(x + figure_defaultFigureSegmentSize, y)); 120 r.addPoint(new Point(x + figure_defaultFigureSegmentSize, y + figure_defaultFigureSegmentSize)); 121 r.addPoint(new Point(x, y + figure_defaultFigureSegmentSize)); 122 var f=new Figure("Square"); 123 f.style.fillStyle = figure_defaultFillStyle; 124 f.style.strokeStyle = figure_defaultStrokeStyle; 125 126 f.properties.push(new BuilderProperty('Text', 'primitives.1.str', BuilderProperty.TYPE_TEXT)); 127 f.properties.push(new BuilderProperty('Text Size ', 'primitives.1.size', BuilderProperty.TYPE_TEXT_FONT_SIZE)); 128 f.properties.push(new BuilderProperty('Font ', 'primitives.1.font', BuilderProperty.TYPE_TEXT_FONT_FAMILY)); 129 f.properties.push(new BuilderProperty('Alignment ', 'primitives.1.align', BuilderProperty.TYPE_TEXT_FONT_ALIGNMENT)); 130 f.properties.push(new BuilderProperty('Text Color', 'primitives.1.style.fillStyle', BuilderProperty.TYPE_COLOR)); 131 132 133 f.properties.push(new BuilderProperty(BuilderProperty.SEPARATOR)); 134 f.properties.push(new BuilderProperty('Stroke Style', 'style.strokeStyle', BuilderProperty.TYPE_COLOR)); 135 f.properties.push(new BuilderProperty('Fill Style', 'style.fillStyle', BuilderProperty.TYPE_COLOR)); 136 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)); 137 138 f.addPrimitive(r); 139 140 var t2 = new Text(figure_defaultFigureTextStr, x + figure_defaultFigureSegmentSize/2, y + figure_defaultFigureSegmentSize/2, figure_defaultFigureTextFont, figure_defaultFigureTextSize); 141 t2.style.fillStyle = figure_defaultFillTextStyle; 142 143 f.addPrimitive(t2); 144 145 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize / 2 - 10,y),ConnectionPoint.TYPE_FIGURE); 146 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize / 2, y),ConnectionPoint.TYPE_FIGURE); 147 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize / 2 + 10, y),ConnectionPoint.TYPE_FIGURE); 148 149 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize / 2 - 10, y + figure_defaultFigureSegmentSize),ConnectionPoint.TYPE_FIGURE); 150 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize / 2, y + figure_defaultFigureSegmentSize),ConnectionPoint.TYPE_FIGURE); 151 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize / 2 + 10, y + figure_defaultFigureSegmentSize),ConnectionPoint.TYPE_FIGURE); 152 153 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize, y + figure_defaultFigureSegmentSize / 2 - 10),ConnectionPoint.TYPE_FIGURE); 154 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize, y + figure_defaultFigureSegmentSize / 2),ConnectionPoint.TYPE_FIGURE); 155 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize, y + figure_defaultFigureSegmentSize / 2 + 10),ConnectionPoint.TYPE_FIGURE); 156 157 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y + figure_defaultFigureSegmentSize / 2 - 10),ConnectionPoint.TYPE_FIGURE); 158 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y + figure_defaultFigureSegmentSize / 2),ConnectionPoint.TYPE_FIGURE); 159 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y + figure_defaultFigureSegmentSize / 2 + 10),ConnectionPoint.TYPE_FIGURE); 160 f.finalise(); 161 return f; 162 } 163 164 function figure_Circle(x,y) 165 { 166 167 var f = new Figure("Circle"); 168 f.style.fillStyle = figure_defaultFillStyle; 169 f.style.strokeStyle = figure_defaultStrokeStyle; 170 171 172 f.properties.push(new BuilderProperty('Text', 'primitives.1.str', BuilderProperty.TYPE_TEXT)); 173 f.properties.push(new BuilderProperty('Text Size ', 'primitives.1.size', BuilderProperty.TYPE_TEXT_FONT_SIZE)); 174 f.properties.push(new BuilderProperty('Font ', 'primitives.1.font', BuilderProperty.TYPE_TEXT_FONT_FAMILY)); 175 f.properties.push(new BuilderProperty('Alignment ', 'primitives.1.align', BuilderProperty.TYPE_TEXT_FONT_ALIGNMENT)); 176 f.properties.push(new BuilderProperty('Text Color', 'primitives.1.style.fillStyle', BuilderProperty.TYPE_COLOR)); 177 178 f.properties.push(new BuilderProperty(BuilderProperty.SEPARATOR)); 179 f.properties.push(new BuilderProperty('Stroke Style', 'style.strokeStyle', BuilderProperty.TYPE_COLOR)); 180 f.properties.push(new BuilderProperty('Fill Style', 'style.fillStyle', BuilderProperty.TYPE_COLOR)); 181 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); 182 183 184 var c = new Arc(x, y, figure_defaultFigureRadiusSize, 0, 360, false, 0); 185 186 f.addPrimitive(c); 187 var t2 = new Text(figure_defaultFigureTextStr, x, y, figure_defaultFigureTextFont, figure_defaultFigureTextSize); 188 t2.style.fillStyle = figure_defaultFillTextStyle; 189 190 f.addPrimitive(t2); 191 192 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureRadiusSize, y), ConnectionPoint.TYPE_FIGURE); 193 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y + figure_defaultFigureRadiusSize), ConnectionPoint.TYPE_FIGURE); 194 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x - figure_defaultFigureRadiusSize, y), ConnectionPoint.TYPE_FIGURE); 195 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y - figure_defaultFigureRadiusSize), ConnectionPoint.TYPE_FIGURE); 196 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y), ConnectionPoint.TYPE_FIGURE); 197 f.finalise(); 198 return f; 199 } 200 201 function figure_Diamond(x,y) 202 { 203 204 var r = new Polygon(); 205 r.addPoint(new Point(x, y - figure_defaultFigureSegmentSize/2)); 206 r.addPoint(new Point(x + figure_defaultFigureSegmentShortSize / 3*2, y)); 207 r.addPoint(new Point(x, y + figure_defaultFigureSegmentSize/2)); 208 r.addPoint(new Point(x - figure_defaultFigureSegmentShortSize/3*2, y)); 209 var f=new Figure("Diamond"); 210 f.style.fillStyle = figure_defaultFillStyle; 211 f.style.strokeStyle = figure_defaultStrokeStyle; 212 213 f.properties.push(new BuilderProperty('Text', 'primitives.1.str', BuilderProperty.TYPE_TEXT)); 214 f.properties.push(new BuilderProperty('Text Size ', 'primitives.1.size', BuilderProperty.TYPE_TEXT_FONT_SIZE)); 215 f.properties.push(new BuilderProperty('Font ', 'primitives.1.font', BuilderProperty.TYPE_TEXT_FONT_FAMILY)); 216 f.properties.push(new BuilderProperty('Alignment ', 'primitives.1.align', BuilderProperty.TYPE_TEXT_FONT_ALIGNMENT)); 217 f.properties.push(new BuilderProperty('Text Color', 'primitives.1.style.fillStyle', BuilderProperty.TYPE_COLOR)); 218 219 f.properties.push(new BuilderProperty(BuilderProperty.SEPARATOR)); 220 f.properties.push(new BuilderProperty('Stroke Style', 'style.strokeStyle', BuilderProperty.TYPE_COLOR)); 221 f.properties.push(new BuilderProperty('Fill Style', 'style.fillStyle', BuilderProperty.TYPE_COLOR)); 222 f.properties.push(new BuilderProperty('Line Width', 'style.lineWidth',BuilderProperty.TYPE_LINE_WIDTH)) 223 //f.properties.push(new BuilderProperty('Vertical Alignment ', 'primitives.1.valign', Text.VALIGNMENTS); 224 225 f.addPrimitive(r); 226 227 var t2 = new Text(figure_defaultFigureTextStr, x, y, figure_defaultFigureTextFont, figure_defaultFigureTextSize); 228 t2.style.fillStyle = figure_defaultFillTextStyle; 229 230 f.addPrimitive(t2); 231 232 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y),ConnectionPoint.TYPE_FIGURE); 233 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y - figure_defaultFigureSegmentSize/2), ConnectionPoint.TYPE_FIGURE); 234 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentShortSize/3*2, y), ConnectionPoint.TYPE_FIGURE); 235 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y + figure_defaultFigureSegmentSize/2), ConnectionPoint.TYPE_FIGURE); 236 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x - figure_defaultFigureSegmentShortSize/3*2, y), ConnectionPoint.TYPE_FIGURE); 237 238 f.finalise(); 239 return f; 240 } 241 242 function figure_Parallelogram(x,y) 243 { 244 245 var r = new Polygon(); 246 r.addPoint(new Point(x + 10, y)); 247 r.addPoint(new Point(x + figure_defaultFigureSegmentSize + 10, y)); 248 r.addPoint(new Point(x + figure_defaultFigureSegmentSize + figure_defaultFigureParalelsOffsetSize, y + figure_defaultFigureSegmentShortSize)); 249 r.addPoint(new Point(x + figure_defaultFigureParalelsOffsetSize, y + figure_defaultFigureSegmentShortSize)); 250 var f=new Figure("Diamond"); 251 f.style.fillStyle = figure_defaultFillStyle; 252 f.style.strokeStyle = figure_defaultStrokeStyle; 253 f.properties.push(new BuilderProperty('Text', 'primitives.1.str', BuilderProperty.TYPE_TEXT)); 254 f.properties.push(new BuilderProperty('Text Size ', 'primitives.1.size', BuilderProperty.TYPE_TEXT_FONT_SIZE)); 255 f.properties.push(new BuilderProperty('Font ', 'primitives.1.font', BuilderProperty.TYPE_TEXT_FONT_FAMILY)); 256 f.properties.push(new BuilderProperty('Alignment ', 'primitives.1.align', BuilderProperty.TYPE_TEXT_FONT_ALIGNMENT)); 257 f.properties.push(new BuilderProperty('Text Color', 'primitives.1.style.fillStyle', BuilderProperty.TYPE_COLOR)); 258 259 260 f.properties.push(new BuilderProperty(BuilderProperty.SEPARATOR)); 261 f.properties.push(new BuilderProperty('Stroke Style', 'style.strokeStyle', BuilderProperty.TYPE_COLOR)); 262 f.properties.push(new BuilderProperty('Fill Style', 'style.fillStyle', BuilderProperty.TYPE_COLOR)); 263 f.properties.push(new BuilderProperty('Line Width', 'style.lineWidth',BuilderProperty.TYPE_LINE_WIDTH)); 264 //f.properties.push(new BuilderProperty('Vertical Alignment ', 'primitives.1.valign', Text.VALIGNMENTS); 265 266 f.addPrimitive(r); 267 268 var t2 = new Text(figure_defaultFigureTextStr, x + figure_defaultFigureSegmentSize/2 + figure_defaultFigureParalelsOffsetSize/2 + 5, y + figure_defaultFigureSegmentShortSize/2, figure_defaultFigureTextFont, figure_defaultFigureTextSize); 269 t2.style.fillStyle = figure_defaultFillTextStyle; 270 271 f.addPrimitive(t2); 272 273 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + 10, y),ConnectionPoint.TYPE_FIGURE); 274 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize + 10, y), ConnectionPoint.TYPE_FIGURE); 275 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize + figure_defaultFigureParalelsOffsetSize, y + figure_defaultFigureSegmentShortSize), ConnectionPoint.TYPE_FIGURE); 276 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureParalelsOffsetSize, y + figure_defaultFigureSegmentShortSize), ConnectionPoint.TYPE_FIGURE); 277 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize + figure_defaultFigureParalelsOffsetSize / 2 + 5, y + figure_defaultFigureSegmentShortSize / 2), ConnectionPoint.TYPE_FIGURE); 278 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureParalelsOffsetSize / 2 + 5, y + figure_defaultFigureSegmentShortSize / 2), ConnectionPoint.TYPE_FIGURE); 279 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize / 2 + figure_defaultFigureParalelsOffsetSize, y + figure_defaultFigureSegmentShortSize), ConnectionPoint.TYPE_FIGURE); 280 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize / 2 + 10, y), ConnectionPoint.TYPE_FIGURE); 281 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentSize / 2 + figure_defaultFigureParalelsOffsetSize/2 + 2, y + figure_defaultFigureSegmentShortSize/2), ConnectionPoint.TYPE_FIGURE); 282 283 f.finalise(); 284 return f; 285 } 286 287 function figure_Ellipse(x,y) 288 { 289 290 var f = new Figure("Ellipse"); 291 f.style.fillStyle = figure_defaultFillStyle; 292 f.style.strokeStyle = figure_defaultStrokeStyle; 293 294 f.properties.push(new BuilderProperty('Text', 'primitives.1.str', BuilderProperty.TYPE_TEXT)); 295 f.properties.push(new BuilderProperty('Text Size ', 'primitives.1.size', BuilderProperty.TYPE_TEXT_FONT_SIZE)); 296 f.properties.push(new BuilderProperty('Font ', 'primitives.1.font', BuilderProperty.TYPE_TEXT_FONT_FAMILY)); 297 f.properties.push(new BuilderProperty('Alignment ', 'primitives.1.align', BuilderProperty.TYPE_TEXT_FONT_ALIGNMENT)); 298 f.properties.push(new BuilderProperty('Text Color', 'primitives.1.style.fillStyle', BuilderProperty.TYPE_COLOR)); 299 300 f.properties.push(new BuilderProperty(BuilderProperty.SEPARATOR)); 301 f.properties.push(new BuilderProperty('Stroke Style', 'style.strokeStyle', BuilderProperty.TYPE_COLOR)); 302 f.properties.push(new BuilderProperty('Fill Style', 'style.fillStyle', BuilderProperty.TYPE_COLOR)); 303 f.properties.push(new BuilderProperty('Line Width', 'style.lineWidth',BuilderProperty.TYPE_LINE_WIDTH)); 304 //f.properties.push(new BuilderProperty('Vertical Alignment ', 'primitives.1.valign', Text.VALIGNMENTS); 305 306 307 var c = new Ellipse(new Point(x, y), figure_defaultFigureSegmentShortSize, figure_defaultFigureSegmentShortSize/2); 308 309 f.addPrimitive(c); 310 var t2 = new Text(figure_defaultFigureTextStr, x, y - 2, figure_defaultFigureTextFont, figure_defaultFigureTextSize); 311 t2.style.fillStyle = figure_defaultFillTextStyle; 312 313 f.addPrimitive(t2); 314 315 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + figure_defaultFigureSegmentShortSize, y), ConnectionPoint.TYPE_FIGURE); 316 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y + figure_defaultFigureSegmentShortSize/2), ConnectionPoint.TYPE_FIGURE); 317 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x - figure_defaultFigureSegmentShortSize, y), ConnectionPoint.TYPE_FIGURE); 318 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y - figure_defaultFigureSegmentShortSize/2), ConnectionPoint.TYPE_FIGURE); 319 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y), ConnectionPoint.TYPE_FIGURE); 320 f.finalise(); 321 return f; 322 } 323 324 function figure_RightTriangle(x,y) 325 { 326 327 var t = new Polygon(); 328 t.addPoint(new Point(x, y)); 329 t.addPoint(new Point(x + figure_defaultFigureSegmentShortSize, y + figure_defaultFigureSegmentSize)); 330 t.addPoint(new Point(x, y + figure_defaultFigureSegmentSize)); 331 332 var e = new Figure("RightTriangle"); 333 e.style.fillStyle = figure_defaultFillStyle; 334 e.style.strokeStyle = figure_defaultStrokeStyle; 335 336 e.properties.push(new BuilderProperty('Text', 'primitives.1.str', BuilderProperty.TYPE_TEXT)); 337 e.properties.push(new BuilderProperty('Text Size ', 'primitives.1.size', BuilderProperty.TYPE_TEXT_FONT_SIZE)); 338 e.properties.push(new BuilderProperty('Font ', 'primitives.1.font', BuilderProperty.TYPE_TEXT_FONT_FAMILY)); 339 e.properties.push(new BuilderProperty('Alignment ', 'primitives.1.align', BuilderProperty.TYPE_TEXT_FONT_ALIGNMENT)); 340 e.properties.push(new BuilderProperty('Text Color', 'primitives.1.style.fillStyle', BuilderProperty.TYPE_COLOR)); 341 342 e.properties.push(new BuilderProperty(BuilderProperty.SEPARATOR)); 343 e.properties.push(new BuilderProperty('Stroke Style', 'style.strokeStyle', BuilderProperty.TYPE_COLOR)); 344 e.properties.push(new BuilderProperty('Fill Style', 'style.fillStyle', BuilderProperty.TYPE_COLOR)); 345 e.properties.push(new BuilderProperty('Line Width', 'style.lineWidth',BuilderProperty.TYPE_LINE_WIDTH));//f.properties.push(new BuilderProperty('Vertical Alignment ', 'primitives.1.valign', Text.VALIGNMENTS); 346 347 var t2=new Text(figure_defaultFigureTextStr, x + figure_defaultFigureSegmentShortSize/2, y + figure_defaultFigureSegmentSize/2, figure_defaultFigureTextFont, figure_defaultFigureTextSize); 348 t2.style.fillStyle = figure_defaultFillTextStyle; 349 350 e.addPrimitive(t); 351 e.addPrimitive(t2); 352 353 CONNECTOR_MANAGER.connectionPointCreate(e.id, new Point(x, y), ConnectionPoint.TYPE_FIGURE); 354 CONNECTOR_MANAGER.connectionPointCreate(e.id, new Point(x + figure_defaultFigureSegmentShortSize, y + figure_defaultFigureSegmentSize), ConnectionPoint.TYPE_FIGURE); 355 CONNECTOR_MANAGER.connectionPointCreate(e.id, new Point(x, y + figure_defaultFigureSegmentSize), ConnectionPoint.TYPE_FIGURE); 356 CONNECTOR_MANAGER.connectionPointCreate(e.id, new Point(x + figure_defaultFigureSegmentShortSize/2, y + figure_defaultFigureSegmentSize/2), ConnectionPoint.TYPE_FIGURE); 357 358 359 e.finalise(); 360 return e; 361 } 362 363 function figure_Pentagon(x,y) 364 { 365 var r = new Polygon(); 366 var l = figure_defaultFigureRadiusSize; 367 /*r.addPoint(new Point(x + (l * Math.cos(180/Math.PI*72)), y - (l * Math.sin(180/Math.PI*72)))); 368 r.addPoint(new Point(x - (l * Math.cos(180/Math.PI*36)), y + (l * Math.sin(180/Math.PI*36)))); 369 r.addPoint(new Point(x + l, y)); 370 r.addPoint(new Point(x - (l * Math.cos(180/Math.PI*36)), y - (l * Math.sin(180/Math.PI*36)))); 371 r.addPoint(new Point(x + (l * Math.cos(180/Math.PI*72)), y + (l * Math.sin(180/Math.PI*72))));*/ 372 for (var i = 0; i < 5; i++){ 373 r.addPoint(new Point(x - l * Math.sin(2 * Math.PI * i / 5), y - l * Math.cos(2 * Math.PI * i / 5))); 374 } 375 var f=new Figure("Pentagon"); 376 f.style.fillStyle = figure_defaultFillStyle; 377 f.style.strokeStyle = figure_defaultStrokeStyle; 378 379 f.properties.push(new BuilderProperty('Text', 'primitives.1.str', BuilderProperty.TYPE_TEXT)); 380 f.properties.push(new BuilderProperty('Text Size ', 'primitives.1.size', BuilderProperty.TYPE_TEXT_FONT_SIZE)); 381 f.properties.push(new BuilderProperty('Font ', 'primitives.1.font', BuilderProperty.TYPE_TEXT_FONT_FAMILY)); 382 f.properties.push(new BuilderProperty('Alignment ', 'primitives.1.align', BuilderProperty.TYPE_TEXT_FONT_ALIGNMENT)); 383 f.properties.push(new BuilderProperty('Text Color', 'primitives.1.style.fillStyle', BuilderProperty.TYPE_COLOR)); 384 385 f.properties.push(new BuilderProperty(BuilderProperty.SEPARATOR)); 386 f.properties.push(new BuilderProperty('Stroke Style', 'style.strokeStyle', BuilderProperty.TYPE_COLOR)); 387 f.properties.push(new BuilderProperty('Fill Style', 'style.fillStyle', BuilderProperty.TYPE_COLOR)); 388 f.properties.push(new BuilderProperty('Line Width', 'style.lineWidth',BuilderProperty.TYPE_LINE_WIDTH)); 389 //f.properties.push(new BuilderProperty('Vertical Alignment ', 'primitives.1.valign', Text.VALIGNMENTS); 390 391 f.addPrimitive(r); 392 393 var t2 = new Text(figure_defaultFigureTextStr, x, y, figure_defaultFigureTextFont, figure_defaultFigureTextSize); 394 t2.style.fillStyle = figure_defaultFillTextStyle; 395 396 f.addPrimitive(t2); 397 398 for (var i = 0; i < 5; i++){ 399 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x - l * Math.sin(2 * Math.PI * i / 5), y - l * Math.cos(2 * Math.PI * i / 5)),ConnectionPoint.TYPE_FIGURE); 400 } 401 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x,y),ConnectionPoint.TYPE_FIGURE); 402 403 f.finalise(); 404 return f; 405 } 406 407 function figure_Hexagon(x,y) 408 { 409 var r = new Polygon(); 410 var l = figure_defaultFigureSegmentShortSize/4*3+2; 411 r.addPoint(new Point(x, y + l)); 412 r.addPoint(new Point(x + l, y + l / 2));//(l * (Math.sqrt(3 / 2))) 413 r.addPoint(new Point(x + l, y - l / 2));//(l * (Math.sqrt(3 / 2))) 414 r.addPoint(new Point(x, y - l)); 415 r.addPoint(new Point((x - l), y - l / 2));//(l * (Math.sqrt(3 / 2))) 416 r.addPoint(new Point((x - l), y + l / 2));//(l * (Math.sqrt(3 / 2))) 417 var f=new Figure("Hexagon"); 418 419 f.style.fillStyle = figure_defaultFillStyle; 420 f.style.strokeStyle = figure_defaultStrokeStyle; 421 422 f.properties.push(new BuilderProperty('Text', 'primitives.1.str', BuilderProperty.TYPE_TEXT)); 423 f.properties.push(new BuilderProperty('Text Size ', 'primitives.1.size', BuilderProperty.TYPE_TEXT_FONT_SIZE)); 424 f.properties.push(new BuilderProperty('Font ', 'primitives.1.font', BuilderProperty.TYPE_TEXT_FONT_FAMILY)); 425 f.properties.push(new BuilderProperty('Alignment ', 'primitives.1.align', BuilderProperty.TYPE_TEXT_FONT_ALIGNMENT)); 426 f.properties.push(new BuilderProperty('Text Color', 'primitives.1.style.fillStyle', BuilderProperty.TYPE_COLOR)); 427 428 f.properties.push(new BuilderProperty(BuilderProperty.SEPARATOR)); 429 f.properties.push(new BuilderProperty('Stroke Style', 'style.strokeStyle', BuilderProperty.TYPE_COLOR)); 430 f.properties.push(new BuilderProperty('Fill Style', 'style.fillStyle', BuilderProperty.TYPE_COLOR)); 431 f.properties.push(new BuilderProperty('Line Width', 'style.lineWidth',BuilderProperty.TYPE_LINE_WIDTH)); 432 //f.properties.push(new BuilderProperty('Vertical Alignment ', 'primitives.1.valign', Text.VALIGNMENTS); 433 434 f.addPrimitive(r); 435 436 var t2 = new Text(figure_defaultFigureTextStr, x, y - 2, figure_defaultFigureTextFont, figure_defaultFigureTextSize); 437 t2.style.fillStyle = figure_defaultFillTextStyle; 438 439 f.addPrimitive(t2); 440 441 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y + l), ConnectionPoint.TYPE_FIGURE); 442 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + l, y + l / 2), ConnectionPoint.TYPE_FIGURE); 443 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + l, y - l / 2), ConnectionPoint.TYPE_FIGURE); 444 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y - l), ConnectionPoint.TYPE_FIGURE); 445 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x - l, y - l / 2), ConnectionPoint.TYPE_FIGURE); 446 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x - l, y + l / 2), ConnectionPoint.TYPE_FIGURE); 447 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y), ConnectionPoint.TYPE_FIGURE); 448 f.finalise(); 449 return f; 450 } 451 452 function figure_Octogon(x,y) 453 { 454 var r = new Polygon(); 455 456 var l = figure_defaultFigureSegmentShortSize/3*2; 457 var a = l/Math.sqrt(2); 458 r.addPoint(new Point(x, y)); 459 r.addPoint(new Point(x + l, y)); 460 r.addPoint(new Point(x + l + a, y + a)); 461 r.addPoint(new Point(x + l + a, y + a + l)); 462 r.addPoint(new Point(x + l, y + a + l + a)); 463 r.addPoint(new Point(x, y + a + l + a)); 464 r.addPoint(new Point(x - a, y + a + l)); 465 r.addPoint(new Point(x - a, y + a)); 466 467 var f=new Figure("Octogon"); 468 f.style.fillStyle = figure_defaultFillStyle; 469 f.style.strokeStyle = figure_defaultStrokeStyle; 470 471 f.properties.push(new BuilderProperty('Text', 'primitives.1.str', BuilderProperty.TYPE_TEXT)); 472 f.properties.push(new BuilderProperty('Text Size ', 'primitives.1.size', BuilderProperty.TYPE_TEXT_FONT_SIZE)); 473 f.properties.push(new BuilderProperty('Font ', 'primitives.1.font', BuilderProperty.TYPE_TEXT_FONT_FAMILY)); 474 f.properties.push(new BuilderProperty('Alignment ', 'primitives.1.align', BuilderProperty.TYPE_TEXT_FONT_ALIGNMENT)); 475 f.properties.push(new BuilderProperty('Text Color', 'primitives.1.style.fillStyle', BuilderProperty.TYPE_COLOR)); 476 477 f.properties.push(new BuilderProperty(BuilderProperty.SEPARATOR)); 478 f.properties.push(new BuilderProperty('Stroke Style', 'style.strokeStyle', BuilderProperty.TYPE_COLOR)); 479 f.properties.push(new BuilderProperty('Fill Style', 'style.fillStyle', BuilderProperty.TYPE_COLOR)); 480 f.properties.push(new BuilderProperty('Line Width', 'style.lineWidth',BuilderProperty.TYPE_LINE_WIDTH)); 481 //f.properties.push(new BuilderProperty('Vertical Alignment ', 'primitives.1.valign', Text.VALIGNMENTS); 482 483 f.addPrimitive(r); 484 485 var t2 = new Text(figure_defaultFigureTextStr, x + l/2, y + (l+a+a)/2 - 2, figure_defaultFigureTextFont, figure_defaultFigureTextSize); 486 t2.style.fillStyle = figure_defaultFillTextStyle; 487 488 f.addPrimitive(t2); 489 490 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y), ConnectionPoint.TYPE_FIGURE); 491 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + l, y), ConnectionPoint.TYPE_FIGURE); 492 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + l + a, y + a), ConnectionPoint.TYPE_FIGURE); 493 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + l + a, y + a + l), ConnectionPoint.TYPE_FIGURE); 494 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + l, y + a + l + a), ConnectionPoint.TYPE_FIGURE); 495 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y + a + l + a), ConnectionPoint.TYPE_FIGURE); 496 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x - a, y + a + l), ConnectionPoint.TYPE_FIGURE); 497 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x - a, y + a), ConnectionPoint.TYPE_FIGURE); 498 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + l / 2, y + (l+a+a)/2), ConnectionPoint.TYPE_FIGURE); 499 f.finalise(); 500 return f; 501 } 502 503 504 505 506 507 function figure_Text(x,y) 508 { 509 510 var f = new Figure('Text'); 511 f.style.fillStyle = figure_defaultFillStyle; 512 513 f.properties.push(new BuilderProperty('Text', 'primitives.0.text', BuilderProperty.TYPE_TEXT)); 514 515 //when we change textSize we need to transform the connectionPoints, 516 //this is the only time connecitonPoints get transformed for text 517 f.properties.push(new BuilderProperty('Text Size ', 'primitives.0.textSize', BuilderProperty.TYPE_TEXT_FONT_SIZE)); 518 f.properties.push(new BuilderProperty('Font ', 'primitives.0.font', BuilderProperty.TYPE_TEXT_FONT_FAMILY)); 519 f.properties.push(new BuilderProperty('Alignment ', 'primitives.0.align', BuilderProperty.TYPE_TEXT_FONT_ALIGNMENT)); 520 f.properties.push(new BuilderProperty('Text Color', 'primitives.0.style.fillStyle', BuilderProperty.TYPE_COLOR)); 521 //f.properties.push(new BuilderProperty('Vertical Alignment ', 'primitives.0.valign', Text.VALIGNMENTS); 522 523 524 525 526 var t2 = new Text(figure_defaultFigureTextStr, x, y + figure_defaultFigureRadiusSize/2, figure_defaultFigureTextFont, figure_defaultFigureTextSize); 527 t2.style.fillStyle = figure_defaultFillTextStyle; 528 529 f.addPrimitive(t2); 530 531 //lets set up our connection points to be right on the bounds 532 // var bounds = f.getBounds(); 533 // var width = bounds[2] - bounds[0]; 534 // var height = bounds[3] - bounds[1]; 535 // CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(bounds[0] + width/2, bounds[1] - 2), ConnectionPoint.TYPE_FIGURE); 536 // CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(bounds[0] + width/2, bounds[3] + 2), ConnectionPoint.TYPE_FIGURE); 537 // CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(bounds[0] - 2, bounds[1] + height/2), ConnectionPoint.TYPE_FIGURE); 538 // CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(bounds[2] + 2, bounds[1] + height/2), ConnectionPoint.TYPE_FIGURE); 539 f.finalise(); 540 return f; 541 } 542 543 function figure_RoundedRectangle(x,y) 544 { 545 var f=new Figure("RoundedRectangle"); 546 f.style.fillStyle = figure_defaultFillStyle; 547 f.style.strokeStyle = figure_defaultStrokeStyle; 548 f.style.lineWidth = 2; 549 550 f.properties.push(new BuilderProperty('Text', 'primitives.1.str', BuilderProperty.TYPE_TEXT)); 551 f.properties.push(new BuilderProperty('Text Size ', 'primitives.1.size', BuilderProperty.TYPE_TEXT_FONT_SIZE)); 552 f.properties.push(new BuilderProperty('Font ', 'primitives.1.font', BuilderProperty.TYPE_TEXT_FONT_FAMILY)); 553 f.properties.push(new BuilderProperty('Alignment ', 'primitives.1.align', BuilderProperty.TYPE_TEXT_FONT_ALIGNMENT)); 554 f.properties.push(new BuilderProperty('Text Color', 'primitives.1.style.fillStyle', BuilderProperty.TYPE_COLOR)); 555 556 f.properties.push(new BuilderProperty(BuilderProperty.SEPARATOR)); 557 f.properties.push(new BuilderProperty('Stroke Style', 'style.strokeStyle', BuilderProperty.TYPE_COLOR)); 558 f.properties.push(new BuilderProperty('Fill Style', 'style.fillStyle', BuilderProperty.TYPE_COLOR)); 559 f.properties.push(new BuilderProperty('Line Width', 'style.lineWidth',BuilderProperty.TYPE_LINE_WIDTH)); 560 561 var p = new Path(); 562 var hShrinker = 10; 563 var vShrinker = 6; 564 var l1 = new Line(new Point(x + hShrinker, y + vShrinker), 565 new Point(x + figure_defaultFigureSegmentSize - hShrinker, y + vShrinker)); 566 567 var c1 = new QuadCurve(new Point(x + figure_defaultFigureSegmentSize - hShrinker, y + vShrinker), 568 new Point(x + figure_defaultFigureSegmentSize - hShrinker + figure_defaultFigureCorner*(figure_defaultFigureCornerRoundness/10), y + figure_defaultFigureCorner/figure_defaultFigureCornerRoundness + vShrinker), 569 new Point(x + figure_defaultFigureSegmentSize - hShrinker + figure_defaultFigureCorner, y + figure_defaultFigureCorner + vShrinker)) 570 571 var l2 = new Line(new Point(x + figure_defaultFigureSegmentSize - hShrinker + figure_defaultFigureCorner, y + figure_defaultFigureCorner + vShrinker), 572 new Point(x + figure_defaultFigureSegmentSize - hShrinker + figure_defaultFigureCorner, y + figure_defaultFigureCorner + figure_defaultFigureSegmentShortSize - vShrinker)); 573 574 var c2 = new QuadCurve(new Point(x + figure_defaultFigureSegmentSize - hShrinker + figure_defaultFigureCorner, y + figure_defaultFigureCorner + figure_defaultFigureSegmentShortSize - vShrinker), 575 new Point(x + figure_defaultFigureSegmentSize - hShrinker + figure_defaultFigureCorner*(figure_defaultFigureCornerRoundness/10), y + figure_defaultFigureCorner + figure_defaultFigureSegmentShortSize - vShrinker + figure_defaultFigureCorner*(figure_defaultFigureCornerRoundness/10)), 576 new Point(x + figure_defaultFigureSegmentSize - hShrinker, y + figure_defaultFigureCorner + figure_defaultFigureSegmentShortSize - vShrinker + figure_defaultFigureCorner)) 577 578 var l3 = new Line(new Point(x + figure_defaultFigureSegmentSize - hShrinker, y + figure_defaultFigureCorner + figure_defaultFigureSegmentShortSize - vShrinker + figure_defaultFigureCorner), 579 new Point(x + hShrinker, y + figure_defaultFigureCorner + figure_defaultFigureSegmentShortSize - vShrinker + figure_defaultFigureCorner)); 580 581 var c3 = new QuadCurve( 582 new Point(x + hShrinker, y + figure_defaultFigureCorner + figure_defaultFigureSegmentShortSize - vShrinker + figure_defaultFigureCorner), 583 new Point(x + hShrinker - figure_defaultFigureCorner*(figure_defaultFigureCornerRoundness/10), y + figure_defaultFigureCorner + figure_defaultFigureSegmentShortSize - vShrinker + figure_defaultFigureCorner*(figure_defaultFigureCornerRoundness/10)), 584 new Point(x + hShrinker - figure_defaultFigureCorner, y + figure_defaultFigureCorner + figure_defaultFigureSegmentShortSize - vShrinker)) 585 586 var l4 = new Line(new Point(x + hShrinker - figure_defaultFigureCorner, y + figure_defaultFigureCorner + figure_defaultFigureSegmentShortSize - vShrinker), 587 new Point(x + hShrinker - figure_defaultFigureCorner, y + figure_defaultFigureCorner + vShrinker)); 588 589 var c4 = new QuadCurve( 590 new Point(x + hShrinker - figure_defaultFigureCorner, y + figure_defaultFigureCorner + vShrinker), 591 new Point(x + hShrinker - figure_defaultFigureCorner*(figure_defaultFigureCornerRoundness/10), y + vShrinker), 592 new Point(x + hShrinker, y + vShrinker)) 593 594 p.addPrimitive(l1); 595 p.addPrimitive(c1); 596 p.addPrimitive(l2); 597 p.addPrimitive(c2); 598 p.addPrimitive(l3); 599 p.addPrimitive(c3); 600 p.addPrimitive(l4); 601 p.addPrimitive(c4); 602 f.addPrimitive(p); 603 604 var t2 = new Text(figure_defaultFigureTextStr, x + figure_defaultFigureSegmentSize/2, y + figure_defaultFigureSegmentShortSize/2 + figure_defaultFigureCorner, figure_defaultFigureTextFont, figure_defaultFigureTextSize); 605 t2.style.fillStyle = figure_defaultFillTextStyle; 606 607 f.addPrimitive(t2); 608 609 var wid = figure_defaultFigureSegmentSize - hShrinker + figure_defaultFigureCorner; 610 var height = figure_defaultFigureCorner + figure_defaultFigureSegmentShortSize - vShrinker + figure_defaultFigureCorner; 611 //top 612 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + wid / 2 - 10, y + vShrinker), ConnectionPoint.TYPE_FIGURE); 613 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + wid / 2, y + vShrinker), ConnectionPoint.TYPE_FIGURE); 614 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + wid / 2 + 10, y + vShrinker), ConnectionPoint.TYPE_FIGURE); 615 616 //right 617 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + wid, y + height / 2 - 10), ConnectionPoint.TYPE_FIGURE); 618 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + wid, y + height / 2), ConnectionPoint.TYPE_FIGURE); 619 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + wid, y + height / 2 + 10), ConnectionPoint.TYPE_FIGURE); 620 621 //bottom 622 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + wid / 2 - 10, y + height), ConnectionPoint.TYPE_FIGURE); 623 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + wid / 2, y + height), ConnectionPoint.TYPE_FIGURE); 624 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x + wid / 2 + 10, y + height), ConnectionPoint.TYPE_FIGURE); 625 626 //left 627 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y + height / 2 - 10), ConnectionPoint.TYPE_FIGURE); 628 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y + height / 2), ConnectionPoint.TYPE_FIGURE); 629 CONNECTOR_MANAGER.connectionPointCreate(f.id, new Point(x, y + height / 2 + 10), ConnectionPoint.TYPE_FIGURE); 630 f.finalise(); 631 return f; 632 }