| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570 |
- /**
- * $Id: mxEip.js,v 1.0 2014/11/27 06:09:21 mate Exp $
- * Copyright (c) 2006-2015, JGraph Ltd
- */
- //**********************************************************************************************************************************************************
- //Message Expiration
- //**********************************************************************************************************************************************************
- /**
- * Extends mxShape.
- */
- function mxShapeEipMessageExpiration(bounds, fill, stroke, strokewidth)
- {
- mxShape.call(this);
- this.bounds = bounds;
- this.fill = fill;
- this.stroke = stroke;
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
- };
- /**
- * Extends mxShape.
- */
- mxUtils.extend(mxShapeEipMessageExpiration, mxShape);
- mxShapeEipMessageExpiration.prototype.cst = {
- SHAPE_MESS_EXP : 'mxgraph.eip.messExp'
- };
- /**
- * Function: paintVertexShape
- *
- * Paints the vertex shape.
- */
- mxShapeEipMessageExpiration.prototype.paintVertexShape = function(c, x, y, w, h)
- {
- c.translate(x, y);
- this.background(c, x, y, w, h);
- };
- mxShapeEipMessageExpiration.prototype.background = function(c, x, y, w, h)
- {
- c.ellipse(0, 0, w, h);
- c.stroke();
-
- c.setStrokeColor("#808080");
- c.begin();
- c.moveTo(w * 0.5, h * 0.1);
- c.lineTo(w * 0.5, h * 0.5);
- c.lineTo(w * 0.6, h * 0.8);
- c.stroke();
- };
- mxCellRenderer.registerShape(mxShapeEipMessageExpiration.prototype.cst.SHAPE_MESS_EXP, mxShapeEipMessageExpiration);
- mxShapeEipMessageExpiration.prototype.getConstraints = function(style, w, h)
- {
- var constr = [];
- constr.push(new mxConnectionConstraint(new mxPoint(0.145, 0.145), false));
- constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
- constr.push(new mxConnectionConstraint(new mxPoint(0.855, 0.145), false));
- constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
- constr.push(new mxConnectionConstraint(new mxPoint(0.855, 0.855), false));
- constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
- constr.push(new mxConnectionConstraint(new mxPoint(0.145, 0.855), false));
- constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
- return (constr);
- };
- //**********************************************************************************************************************************************************
- //Return Address
- //**********************************************************************************************************************************************************
- /**
- * Extends mxShape.
- */
- function mxShapeEipReturnAddress(bounds, fill, stroke, strokewidth)
- {
- mxShape.call(this);
- this.bounds = bounds;
- this.fill = fill;
- this.stroke = stroke;
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
- };
- /**
- * Extends mxShape.
- */
- mxUtils.extend(mxShapeEipReturnAddress, mxShape);
- mxShapeEipReturnAddress.prototype.cst = {
- SHAPE_RET_ADDR : 'mxgraph.eip.retAddr'
- };
- /**
- * Function: paintVertexShape
- *
- * Paints the vertex shape.
- */
- mxShapeEipReturnAddress.prototype.paintVertexShape = function(c, x, y, w, h)
- {
- c.translate(x, y);
- this.background(c, x, y, w, h);
- c.setShadow(false);
- this.foreground(c, x, y, w, h);
- };
- mxShapeEipReturnAddress.prototype.background = function(c, x, y, w, h)
- {
- c.rect(0, 0, w, h);
- c.fillAndStroke();
- };
- mxShapeEipReturnAddress.prototype.foreground = function(c, x, y, w, h)
- {
- c.begin();
- c.moveTo(w * 0.05, h * 0.11);
- c.lineTo(w * 0.25, h * 0.11);
- c.moveTo(w * 0.05, h * 0.18);
- c.lineTo(w * 0.25, h * 0.18);
- c.moveTo(w * 0.05, h * 0.25);
- c.lineTo(w * 0.25, h * 0.25);
- c.setStrokeWidth(2);
- c.moveTo(w * 0.3, h * 0.63);
- c.lineTo(w * 0.8, h * 0.63);
- c.moveTo(w * 0.3, h * 0.72);
- c.lineTo(w * 0.8, h * 0.72);
- c.moveTo(w * 0.3, h * 0.80);
- c.lineTo(w * 0.8, h * 0.80);
- c.stroke();
- c.setFillColor("#EDEDED");
- c.rect(w * 0.8, h * 0.1, w * 0.12, h * 0.19);
- c.fillAndStroke();
- };
- mxCellRenderer.registerShape(mxShapeEipReturnAddress.prototype.cst.SHAPE_RET_ADDR, mxShapeEipReturnAddress);
- mxShapeEipReturnAddress.prototype.getConstraints = function(style, w, h)
- {
- var constr = [];
- constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));
- constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));
- constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));
- constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));
- constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));
- constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));
- constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));
- constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));
- constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));
- constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));
- constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));
- constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));
- constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));
- constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));
- constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));
- constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));
- return (constr);
- };
- //**********************************************************************************************************************************************************
- //Anchor
- //**********************************************************************************************************************************************************
- /**
- * Extends mxShape.
- */
- function mxShapeEipAnchor(bounds, fill, stroke, strokewidth)
- {
- mxShape.call(this);
- this.bounds = bounds;
- this.fill = fill;
- this.stroke = stroke;
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
- };
- /**
- * Extends mxShape.
- */
- mxUtils.extend(mxShapeEipAnchor, mxShape);
- mxShapeEipAnchor.prototype.cst = {
- SHAPE_ANCHOR : 'mxgraph.eip.anchor'
- };
- /**
- * Function: paintVertexShape
- *
- * Paints the vertex shape.
- */
- mxShapeEipAnchor.prototype.paintVertexShape = function(c, x, y, w, h)
- {
- };
- mxCellRenderer.registerShape(mxShapeEipAnchor.prototype.cst.SHAPE_ANCHOR, mxShapeEipAnchor);
- //**********************************************************************************************************************************************************
- //Message Channel
- //**********************************************************************************************************************************************************
- /**
- * Extends mxShape.
- */
- function mxShapeEipMessageChannel(bounds, fill, stroke, strokewidth)
- {
- mxShape.call(this);
- this.bounds = bounds;
- this.fill = fill;
- this.stroke = stroke;
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
- };
- /**
- * Extends mxShape.
- */
- mxUtils.extend(mxShapeEipMessageChannel, mxShape);
- mxShapeEipMessageChannel.prototype.cst = {
- SHAPE_MESSAGE_CHANNEL : 'mxgraph.eip.messageChannel'
- };
- /**
- * Function: paintVertexShape
- *
- * Paints the vertex shape.
- */
- mxShapeEipMessageChannel.prototype.paintVertexShape = function(c, x, y, w, h)
- {
- c.translate(x, y);
- this.background(c, x, y, w, h);
- c.setShadow(false);
- this.foreground(c, x, y, w, h);
- };
- mxShapeEipMessageChannel.prototype.background = function(c, x, y, w, h)
- {
- c.setGradient('#e6e6e6', '#808080', 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
- c.begin();
- c.moveTo(8, h * 0.5 + 10);
- c.arcTo(12, 12, 0, 0, 1, 8, h * 0.5 - 10);
- c.lineTo(w - 8, h * 0.5 - 10);
- c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 + 10);
- c.close();
- c.fillAndStroke();
- };
- mxShapeEipMessageChannel.prototype.foreground = function(c, x, y, w, h)
- {
- c.setFillColor('#e6e6e6');
- c.begin();
- c.moveTo(w - 8, h * 0.5 - 10);
- c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 + 10);
- c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 - 10);
- c.fillAndStroke();
- };
- mxCellRenderer.registerShape(mxShapeEipMessageChannel.prototype.cst.SHAPE_MESSAGE_CHANNEL, mxShapeEipMessageChannel);
- mxShapeEipMessageChannel.prototype.getConstraints = function(style, w, h)
- {
- var constr = [];
- constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, 2.7, 0));
- constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false, null, -2.7, 0));
- var currW = 10;
-
- while (currW < w)
- {
- constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, currW, 0));
- constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false, null, currW, 0));
-
- currW = currW + 10;
- }
-
- return (constr);
- };
- //**********************************************************************************************************************************************************
- //Datatype Channel
- //**********************************************************************************************************************************************************
- /**
- * Extends mxShape.
- */
- function mxShapeEipDatatypeChannel(bounds, fill, stroke, strokewidth)
- {
- mxShape.call(this);
- this.bounds = bounds;
- this.fill = fill;
- this.stroke = stroke;
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
- };
- /**
- * Extends mxShape.
- */
- mxUtils.extend(mxShapeEipDatatypeChannel, mxShape);
- mxShapeEipDatatypeChannel.prototype.cst = {
- SHAPE_DATATYPE_CHANNEL : 'mxgraph.eip.dataChannel'
- };
- /**
- * Function: paintVertexShape
- *
- * Paints the vertex shape.
- */
- mxShapeEipDatatypeChannel.prototype.paintVertexShape = function(c, x, y, w, h)
- {
- c.translate(x, y);
- this.background(c, x, y, w, h);
- c.setShadow(false);
- this.foreground(c, x, y, w, h);
- };
- mxShapeEipDatatypeChannel.prototype.background = function(c, x, y, w, h)
- {
- c.setGradient('#e6e6e6', '#808080', 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
- c.begin();
- c.moveTo(8, h * 0.5 + 10);
- c.arcTo(12, 12, 0, 0, 1, 8, h * 0.5 - 10);
- c.lineTo(w - 8, h * 0.5 - 10);
- c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 + 10);
- c.close();
- c.fillAndStroke();
- };
- mxShapeEipDatatypeChannel.prototype.foreground = function(c, x, y, w, h)
- {
- c.setFillColor('#e6e6e6');
- c.begin();
- c.moveTo(w - 8, h * 0.5 - 10);
- c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 + 10);
- c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 - 10);
- c.fillAndStroke();
-
- c.setFillColor("#fffbc0");
- c.setStrokeWidth("1");
-
- for(var i = 1; i * 20 + 10 < w - 14; i++)
- {
- c.rect(i * 20, h * 0.5 - 5, 10, 10);
- c.fillAndStroke();
- };
- };
- mxCellRenderer.registerShape(mxShapeEipDatatypeChannel.prototype.cst.SHAPE_DATATYPE_CHANNEL, mxShapeEipDatatypeChannel);
- mxShapeEipDatatypeChannel.prototype.getConstraints = function(style, w, h)
- {
- var constr = [];
- constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, 2.7, 0));
- constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false, null, -2.7, 0));
- var currW = 10;
-
- while (currW < w)
- {
- constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, currW, 0));
- constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false, null, currW, 0));
-
- currW = currW + 10;
- }
-
- return (constr);
- };
- //**********************************************************************************************************************************************************
- //Dead Letter Channel
- //**********************************************************************************************************************************************************
- /**
- * Extends mxShape.
- */
- function mxShapeEipDeadLetterChannel(bounds, fill, stroke, strokewidth)
- {
- mxShape.call(this);
- this.bounds = bounds;
- this.fill = fill;
- this.stroke = stroke;
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
- };
- /**
- * Extends mxShape.
- */
- mxUtils.extend(mxShapeEipDeadLetterChannel, mxShape);
- mxShapeEipDeadLetterChannel.prototype.cst = {
- SHAPE_DEAD_LETTER_CHANNEL : 'mxgraph.eip.deadLetterChannel'
- };
- /**
- * Function: paintVertexShape
- *
- * Paints the vertex shape.
- */
- mxShapeEipDeadLetterChannel.prototype.paintVertexShape = function(c, x, y, w, h)
- {
- c.translate(x, y);
- this.background(c, x, y, w, h);
- c.setShadow(false);
- this.foreground(c, x, y, w, h);
- };
- mxShapeEipDeadLetterChannel.prototype.background = function(c, x, y, w, h)
- {
- c.setGradient('#e6e6e6', '#808080', 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
- c.begin();
- c.moveTo(8, h * 0.5 + 10);
- c.arcTo(12, 12, 0, 0, 1, 8, h * 0.5 - 10);
- c.lineTo(w - 8, h * 0.5 - 10);
- c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 + 10);
- c.close();
- c.fillAndStroke();
- };
- mxShapeEipDeadLetterChannel.prototype.foreground = function(c, x, y, w, h)
- {
- c.setFillColor('#e6e6e6');
- c.begin();
- c.moveTo(w - 8, h * 0.5 - 10);
- c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 + 10);
- c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 - 10);
- c.fillAndStroke();
-
- c.setFillColor("#ff0000");
- c.setStrokeWidth("1");
- c.begin();
- c.moveTo(w * 0.5 - 6, h * 0.5 - 3);
- c.lineTo(w * 0.5 - 3, h * 0.5 - 6);
- c.lineTo(w * 0.5 + 3, h * 0.5 - 6);
- c.lineTo(w * 0.5 + 6, h * 0.5 - 3);
- c.lineTo(w * 0.5 + 6, h * 0.5 + 3);
- c.lineTo(w * 0.5 + 3, h * 0.5 + 6);
- c.lineTo(w * 0.5 - 3, h * 0.5 + 6);
- c.lineTo(w * 0.5 - 6, h * 0.5 + 3);
- c.close();
- c.fillAndStroke();
-
- c.setStrokeWidth("2");
- c.setStrokeColor("#ffffff");
- c.begin();
- c.moveTo(w * 0.5 - 4, h * 0.5);
- c.lineTo(w * 0.5 + 4, h * 0.5);
- c.stroke();
- };
- mxCellRenderer.registerShape(mxShapeEipDeadLetterChannel.prototype.cst.SHAPE_DEAD_LETTER_CHANNEL, mxShapeEipDeadLetterChannel);
- mxShapeEipDeadLetterChannel.prototype.getConstraints = function(style, w, h)
- {
- var constr = [];
- constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, 2.7, 0));
- constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false, null, -2.7, 0));
- var currW = 10;
-
- while (currW < w)
- {
- constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, currW, 0));
- constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false, null, currW, 0));
-
- currW = currW + 10;
- }
-
- return (constr);
- };
- //**********************************************************************************************************************************************************
- //Invalid Message Channel
- //**********************************************************************************************************************************************************
- /**
- * Extends mxShape.
- */
- function mxShapeEipInvalidMessageChannel(bounds, fill, stroke, strokewidth)
- {
- mxShape.call(this);
- this.bounds = bounds;
- this.fill = fill;
- this.stroke = stroke;
- this.strokewidth = (strokewidth != null) ? strokewidth : 1;
- };
- /**
- * Extends mxShape.
- */
- mxUtils.extend(mxShapeEipInvalidMessageChannel, mxShape);
- mxShapeEipInvalidMessageChannel.prototype.cst = {
- SHAPE_INVALID_MESSAGE_CHANNEL : 'mxgraph.eip.invalidMessageChannel'
- };
- /**
- * Function: paintVertexShape
- *
- * Paints the vertex shape.
- */
- mxShapeEipInvalidMessageChannel.prototype.paintVertexShape = function(c, x, y, w, h)
- {
- c.translate(x, y);
- this.background(c, x, y, w, h);
- c.setShadow(false);
- this.foreground(c, x, y, w, h);
- };
- mxShapeEipInvalidMessageChannel.prototype.background = function(c, x, y, w, h)
- {
- c.setGradient('#e6e6e6', '#808080', 0, 0, w, h, mxConstants.DIRECTION_SOUTH, 1, 1);
- c.begin();
- c.moveTo(8, h * 0.5 + 10);
- c.arcTo(12, 12, 0, 0, 1, 8, h * 0.5 - 10);
- c.lineTo(w - 8, h * 0.5 - 10);
- c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 + 10);
- c.close();
- c.fillAndStroke();
- };
- mxShapeEipInvalidMessageChannel.prototype.foreground = function(c, x, y, w, h)
- {
- c.setFillColor('#e6e6e6');
- c.begin();
- c.moveTo(w - 8, h * 0.5 - 10);
- c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 + 10);
- c.arcTo(12, 12, 0, 0, 1, w - 8, h * 0.5 - 10);
- c.fillAndStroke();
-
- c.setFillColor("#ffe040");
- c.setStrokeWidth("1");
- c.begin();
- c.moveTo(w * 0.5 - 6, h * 0.5 + 5);
- c.lineTo(w * 0.5, h * 0.5 - 5);
- c.lineTo(w * 0.5 + 6, h * 0.5 + 5);
- c.close();
- c.fillAndStroke();
-
- c.setStrokeWidth("1");
- c.begin();
- c.moveTo(w * 0.5, h * 0.5 - 2);
- c.lineTo(w * 0.5, h * 0.5 + 2);
- c.moveTo(w * 0.5, h * 0.5 + 3);
- c.lineTo(w * 0.5, h * 0.5 + 4);
- c.stroke();
- };
- mxCellRenderer.registerShape(mxShapeEipInvalidMessageChannel.prototype.cst.SHAPE_INVALID_MESSAGE_CHANNEL, mxShapeEipInvalidMessageChannel);
- mxShapeEipInvalidMessageChannel.prototype.getConstraints = function(style, w, h)
- {
- var constr = [];
- constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, 2.7, 0));
- constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false, null, -2.7, 0));
- var currW = 10;
-
- while (currW < w)
- {
- constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, currW, 0));
- constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false, null, currW, 0));
-
- currW = currW + 10;
- }
-
- return (constr);
- };
|