This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi Jason, Thanks for previous help. I have been able to make much progress. I used the code snippet below to add text to connection points on the left and right. However, in the case of multiple connection points on a given edge, the text for the connection points overlap (on top of each other). Is there a way to auto-place the text along the edge so that they are evenly distributed? Thanks
|
|
|
Hello Sorry for the late reply, I missed this forum post. There are 2 ways that you can separate out the connection points on the same edge. One way is to set their Index properties. When you are setting up the connection points in the constructor of the node, you can either pass in an index value to the constructor of each connection point, or set the Index property directly. Then in the node style, you can set the ConnectionPointPositions property which defines which connection point (based on the Index value) goes to which position. This property can be set using a mini language where you specify the edge (B, T, L, R) [Bottom, Top, Left, Right], followed by a list of coordinates separated by semi colons. The X/Y coordinates are generally values between 0 and 1 and represent the percentage of the width/height where the connection point is placed on the node. An example: "L 0,0.25; 0,0.75 R 1,0.25; 1 0.75". Which means, on the left edge, the connection point with index = 0 will be placed 25% from the top of the node, and the connection point with index = 1 will be placed 75% from the top of the node - and similarly for the right hand side. Another way to do this is to manually set the PositionCalculator of each connection point. This is the easiest solution if you have a variable number of connection points, or possibly even with connection points being dynamically added or removed. You'd want to use the OffsetPositionCalculator which expects X/Y coordinates as explained above. If however you want all the connection points to be in the same place, but have the labels evenly spread out, this is tricker and I haven't tried it before. The best way would be to set the Index properties as mentioned above, and the in the code you posted, create a converter that uses the index (and probably the height of the node) to set the position of the labels. Let me know if you have questions about any of this. -Jason Fauchelle |
|