diff --git a/mindplot/src/main/javascript/MindmapDesigner.js b/mindplot/src/main/javascript/MindmapDesigner.js index e2960a46..309a9c52 100644 --- a/mindplot/src/main/javascript/MindmapDesigner.js +++ b/mindplot/src/main/javascript/MindmapDesigner.js @@ -652,7 +652,8 @@ mindplot.MindmapDesigner.prototype._buildRelationship = function (model) { relationLine.getLine().setDashed(3,2); - relationLine.getLine().setShowArrow(model.getEndArrow()); + relationLine.getLine().setShowEndArrow(model.getEndArrow()); + relationLine.getLine().setShowStartArrow(model.getStartArrow()); relationLine.setModel(model); //Add Listeners diff --git a/mindplot/src/main/javascript/RelationshipModel.js b/mindplot/src/main/javascript/RelationshipModel.js index 87af3d0d..c828935b 100644 --- a/mindplot/src/main/javascript/RelationshipModel.js +++ b/mindplot/src/main/javascript/RelationshipModel.js @@ -10,6 +10,7 @@ mindplot.RelationshipModel = function(fromNode, toNode) this._srcCtrlPoint=null; this._destCtrlPoint=null; this._endArrow=true; + this._startArrow=false; this._ctrlPointRelative=false; }; @@ -58,6 +59,14 @@ mindplot.RelationshipModel.prototype.setEndArrow= function(endArrow){ this._endArrow = endArrow; }; +mindplot.RelationshipModel.prototype.getStartArrow= function(){ + return this._startArrow; +}; + +mindplot.RelationshipModel.prototype.setStartArrow= function(startArrow){ + this._startArrow = startArrow; +}; + mindplot.RelationshipModel.prototype.clone = function(model){ var result = new mindplot.RelationshipModel(this._fromNode, this._toNode); result._id = this._id; @@ -65,6 +74,7 @@ mindplot.RelationshipModel.prototype.clone = function(model){ result._srcCtrlPoint = this._srcCtrlPoint; result._destCtrlPoint = this._destCtrlPoint; result._endArrow = this._endArrow; + result._startArrow = this._startArrow; return result; }; diff --git a/mindplot/src/main/javascript/XMLMindmapSerializer_Pela.js b/mindplot/src/main/javascript/XMLMindmapSerializer_Pela.js index c9698fca..fbf1bfd5 100644 --- a/mindplot/src/main/javascript/XMLMindmapSerializer_Pela.js +++ b/mindplot/src/main/javascript/XMLMindmapSerializer_Pela.js @@ -216,6 +216,7 @@ mindplot.XMLMindmapSerializer_Pela.prototype._relationshipToXML = function(docum } } relationDom.setAttribute("endArrow",relationship.getEndArrow()); + relationDom.setAttribute("startArrow",relationship.getStartArrow()); return relationDom; }; @@ -382,6 +383,7 @@ mindplot.XMLMindmapSerializer_Pela.prototype._deserializeRelationship = function var srcCtrlPoint = domElement.getAttribute("srcCtrlPoint"); var destCtrlPoint = domElement.getAttribute("destCtrlPoint"); var endArrow = domElement.getAttribute("endArrow"); + var startArrow = domElement.getAttribute("startArrow"); var model = mindmap.createRelationship(srcId, destId); model.setLineType(lineType); if(core.Utils.isDefined(srcCtrlPoint) && srcCtrlPoint!=""){ @@ -390,7 +392,8 @@ mindplot.XMLMindmapSerializer_Pela.prototype._deserializeRelationship = function if(core.Utils.isDefined(destCtrlPoint) && destCtrlPoint!=""){ model.setDestCtrlPoint(core.Point.fromString(destCtrlPoint)); } - model.setEndArrow(endArrow); + model.setEndArrow(endArrow=="true"); + model.setStartArrow(startArrow=="true"); return model; }; diff --git a/web2d/src/main/javascript/CurvedLine.js b/web2d/src/main/javascript/CurvedLine.js index 0111ce74..95eb868e 100644 --- a/web2d/src/main/javascript/CurvedLine.js +++ b/web2d/src/main/javascript/CurvedLine.js @@ -54,12 +54,20 @@ web2d.CurvedLine.prototype.getTo = function() return this._peer.getTo(); }; -web2d.CurvedLine.prototype.setShowArrow = function(visible){ - this._peer.setShowArrow(visible); +web2d.CurvedLine.prototype.setShowEndArrow = function(visible){ + this._peer.setShowEndArrow(visible); }; -web2d.CurvedLine.prototype.isShowArrow = function(){ - return this._peer.isShowArrow(); +web2d.CurvedLine.prototype.isShowEndArrow = function(){ + return this._peer.isShowEndArrow(); +}; + +web2d.CurvedLine.prototype.setShowStartArrow = function(visible){ + this._peer.setShowStartArrow(visible); +}; + +web2d.CurvedLine.prototype.isShowStartArrow = function(){ + return this._peer.isShowStartArrow(); }; web2d.CurvedLine.prototype.setSrcControlPoint = function(control){ diff --git a/web2d/src/main/javascript/peer/svg/CurvedLinePeer.js b/web2d/src/main/javascript/peer/svg/CurvedLinePeer.js index 7a0a16dc..40ccaf3a 100644 --- a/web2d/src/main/javascript/peer/svg/CurvedLinePeer.js +++ b/web2d/src/main/javascript/peer/svg/CurvedLinePeer.js @@ -132,13 +132,22 @@ web2d.peer.svg.CurvedLinePeer.prototype.getLineStyle = function (){ }; -web2d.peer.svg.CurvedLinePeer.prototype.setShowArrow = function(visible){ - this._showArrow =visible; +web2d.peer.svg.CurvedLinePeer.prototype.setShowEndArrow = function(visible){ + this._showEndArrow =visible; this.updateLine(); }; -web2d.peer.svg.CurvedLinePeer.prototype.isShowArrow = function(){ - return this._showArrow; +web2d.peer.svg.CurvedLinePeer.prototype.isShowEndArrow = function(){ + return this._showEndArrow; +}; + +web2d.peer.svg.CurvedLinePeer.prototype.setShowStartArrow = function(visible){ + this._showStartArrow =visible; + this.updateLine(); +}; + +web2d.peer.svg.CurvedLinePeer.prototype.isShowStartArrow = function(){ + return this._showStartArrow; }; @@ -146,7 +155,7 @@ web2d.peer.svg.CurvedLinePeer.prototype._updatePath = function(avoidControlPoint { this._calculateAutoControlPoints(avoidControlPointFix); var x,y, xp, yp; - if(this._showArrow){ + if(this._showEndArrow){ if(this._control2.y == 0) this._control2.y=1; var y0 = this._control2.y; @@ -166,8 +175,36 @@ web2d.peer.svg.CurvedLinePeer.prototype._updatePath = function(avoidControlPoint xp *=Math.sign(x3); yp = (x3==0?l*Math.sign(y3):mp*xp); } - var path = "M"+this._x1+","+this._y1 - +" C"+(this._control1.x+this._x1)+","+(this._control1.y+this._y1)+" " + var xs2,ys2, xp2, yp2; + if(this._showStartArrow){ + if(this._control1.y == 0) + this._control1.y=1; + var y02 = this._control1.y; + var x02 = this._control1.x; + var x22=x02+y02; + var y22 = y02-x02; + var x32 = x02-y02; + var y32 = y02+x02; + var m2 = y22/x22; + var mp2 = y32/x32; + var l2 = 6; + var pow2 = Math.pow; + xs2 = (x22==0?0:Math.sqrt(pow2(l2,2)/(1+pow2(m2,2)))); + xs2 *=Math.sign(x22); + ys2 = (x22==0?l2*Math.sign(y22):m2*xs2); + xp2 = (x32==0?0:Math.sqrt(pow2(l2,2)/(1+pow2(mp2,2)))); + xp2 *=Math.sign(x32); + yp2 = (x32==0?l2*Math.sign(y32):mp2*xp2); + } + + var path = (this._showStartArrow?" " + +"M"+this._x1+","+this._y1+" " + +"L"+(xs2+this._x1)+","+(ys2+this._y1) + +"M"+this._x1+","+this._y1+" " + +"L"+(xp2+this._x1)+","+(yp2+this._y1) + :"")+ + "M"+this._x1+","+this._y1 + +" C"+(this._control1.x+this._x1)+","+(this._control1.y+this._y1)+" " +(this._control2.x+this._x2)+","+(this._control2.y+this._y2)+" " +this._x2+","+this._y2+ (this._lineStyle?" " @@ -176,7 +213,7 @@ web2d.peer.svg.CurvedLinePeer.prototype._updatePath = function(avoidControlPoint +this._x1+","+(this._y1+3)+" Z" :"" )+ - (this._showArrow?" " + (this._showEndArrow?" " +"M"+this._x2+","+this._y2+" " +"L"+(x+this._x2)+","+(y+this._y2) +"M"+this._x2+","+this._y2+" " diff --git a/wise-webapp/src/main/java/com/wisemapping/exporter/freemind/FreemindExporter.java b/wise-webapp/src/main/java/com/wisemapping/exporter/freemind/FreemindExporter.java index 43c21bf8..8e2932cc 100755 --- a/wise-webapp/src/main/java/com/wisemapping/exporter/freemind/FreemindExporter.java +++ b/wise-webapp/src/main/java/com/wisemapping/exporter/freemind/FreemindExporter.java @@ -99,6 +99,8 @@ public class FreemindExporter arrowlink.setDESTINATION(dstNode.getID()); if(relationship.isEndArrow()) arrowlink.setENDARROW("Default"); + if(relationship.isStartArrow()) + arrowlink.setSTARTARROW("Default"); List cloudOrEdge = srcNode.getArrowlinkOrCloudOrEdge(); cloudOrEdge.add(arrowlink); } diff --git a/wise-webapp/src/main/java/com/wisemapping/importer/freemind/FreemindImporter.java b/wise-webapp/src/main/java/com/wisemapping/importer/freemind/FreemindImporter.java index f5d1047d..14601bed 100755 --- a/wise-webapp/src/main/java/com/wisemapping/importer/freemind/FreemindImporter.java +++ b/wise-webapp/src/main/java/com/wisemapping/importer/freemind/FreemindImporter.java @@ -323,7 +323,8 @@ public class FreemindImporter inclination = arrow.getSTARTINCLINATION().split(";"); relationship.setSrcCtrlPoint(inclination[0]+","+inclination[1]); //relationship.setCtrlPointRelative(true); - relationship.setEndArrow(!arrow.getENDARROW().equals("None")); + relationship.setEndArrow(!arrow.getENDARROW().toLowerCase().equals("none")); + relationship.setStartArrow(!arrow.getSTARTARROW().toLowerCase().equals("none")); relationship.setLineType("3"); relationships.add(relationship); } diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap.xsd b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap.xsd index 37d66613..8fb70df6 100755 --- a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap.xsd +++ b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap.xsd @@ -59,7 +59,7 @@ - + \ No newline at end of file diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Icon.java b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Icon.java index 835f6c66..bc53f2d3 100644 --- a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Icon.java +++ b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Icon.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.11 at 06:58:42 PM ART +// Generated on: 2011.01.16 at 11:06:29 AM ART // diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Link.java b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Link.java index df942f75..9c21d363 100644 --- a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Link.java +++ b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Link.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.11 at 06:58:42 PM ART +// Generated on: 2011.01.16 at 11:06:29 AM ART // diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Map.java b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Map.java index 9ea916c4..dd5389ec 100644 --- a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Map.java +++ b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Map.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.11 at 06:58:42 PM ART +// Generated on: 2011.01.16 at 11:06:29 AM ART // diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Note.java b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Note.java index f140a6b6..d141a706 100644 --- a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Note.java +++ b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/Note.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.11 at 06:58:42 PM ART +// Generated on: 2011.01.16 at 11:06:29 AM ART // diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/ObjectFactory.java b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/ObjectFactory.java index 8b3ea937..483b9e71 100644 --- a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/ObjectFactory.java +++ b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/ObjectFactory.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.11 at 06:58:42 PM ART +// Generated on: 2011.01.16 at 11:06:29 AM ART // @@ -50,19 +50,11 @@ public class ObjectFactory { } /** - * Create an instance of {@link Map } + * Create an instance of {@link Icon } * */ - public Map createMap() { - return new Map(); - } - - /** - * Create an instance of {@link Link } - * - */ - public Link createLink() { - return new Link(); + public Icon createIcon() { + return new Icon(); } /** @@ -73,6 +65,14 @@ public class ObjectFactory { return new TopicType(); } + /** + * Create an instance of {@link Map } + * + */ + public Map createMap() { + return new Map(); + } + /** * Create an instance of {@link RelationshipType } * @@ -82,11 +82,11 @@ public class ObjectFactory { } /** - * Create an instance of {@link Icon } + * Create an instance of {@link Link } * */ - public Icon createIcon() { - return new Icon(); + public Link createLink() { + return new Link(); } /** diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/RelationshipType.java b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/RelationshipType.java index 38d2ced5..88c0d1a2 100644 --- a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/RelationshipType.java +++ b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/RelationshipType.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.11 at 06:58:42 PM ART +// Generated on: 2011.01.16 at 11:06:29 AM ART // @@ -30,7 +30,7 @@ import javax.xml.bind.annotation.XmlType; * <attribute name="srcCtrlPoint" type="{http://www.w3.org/2001/XMLSchema}string" /> * <attribute name="destCtrlPoint" type="{http://www.w3.org/2001/XMLSchema}string" /> * <attribute name="endArrow" type="{http://www.w3.org/2001/XMLSchema}boolean" /> - * <attribute name="ctrlPointRelative" type="{http://www.w3.org/2001/XMLSchema}boolean" /> + * <attribute name="startArrow" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * </restriction> * </complexContent> * </complexType> @@ -57,7 +57,7 @@ public class RelationshipType { @XmlAttribute protected Boolean endArrow; @XmlAttribute - protected Boolean ctrlPointRelative; + protected Boolean startArrow; /** * Gets the value of the id property. @@ -228,27 +228,27 @@ public class RelationshipType { } /** - * Gets the value of the ctrlPointRelative property. + * Gets the value of the startArrow property. * * @return * possible object is * {@link Boolean } * */ - public Boolean isCtrlPointRelative() { - return ctrlPointRelative; + public Boolean isStartArrow() { + return startArrow; } /** - * Sets the value of the ctrlPointRelative property. + * Sets the value of the startArrow property. * * @param value * allowed object is * {@link Boolean } * */ - public void setCtrlPointRelative(Boolean value) { - this.ctrlPointRelative = value; + public void setStartArrow(Boolean value) { + this.startArrow = value; } } diff --git a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/TopicType.java b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/TopicType.java index 2e7f0632..62b38bbc 100644 --- a/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/TopicType.java +++ b/wise-webapp/src/main/java/com/wisemapping/xml/mindmap/TopicType.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2011.01.11 at 06:58:42 PM ART +// Generated on: 2011.01.16 at 11:06:29 AM ART //