Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic origin and destination points with nodes (Read 2500 times)
jay
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 59
Joined: Feb 4th, 2009
origin and destination points with nodes
Feb 4th, 2009 at 9:09am
Print Post  
Hi,
   
   I have created shape nodes like Decision, Rectangle etc.
Whenever i place mouse over these nodes it shows two anchors or points on that node, one at top and other at bottom of node. When i link these nodes the origin point remains the bottom point and at the destination the top point act destination point.
   I want that when ever i link any two nodes the source point and destination points should be the closer points in the root, not those fixed one.
  My sample code is like...
// here is property initialization
diagView.setAllowInplaceEdit(true);
diagView.setBehavior(Behavior.DrawLinks);
diag.setAllowLinksRepeat(false); // 
diag.setAllowSelfLoops(false);
diag.setLinkBrush(new SolidBrush(Color.white));
diag.setLinkHeadShape(ArrowHead.BowArrow);
diag.setLinkHeadShapeSize(2);
diag.setLinkTextStyle(com.mindfusion.diagramming.LinkTextStyle.Rotate);
diag.setLinkStyle(LinkStyle.Cascading);
diag.setLinkEndsMovable(true);
flowChart.setFont(new Font("Tahoma", Font.BOLD ,3));
diag.setLinkSegments((short)3);
diag.setBackBrush(new SolidBrush(new Color(245, 245, 255)));
diag.setBackgroundImageAlign(ImageAlign.Tile);
diag.setCellFrameStyle(CellFrameStyle.None);
diag.setDisabledHandlesColor(Color.white);
diag.setShadowOffsetX(4);
diag.setShadowOffsetY(4);
diag.setShadowsStyle(ShadowsStyle.None);
diag.setRouteLinks(rootPaneCheckingEnabled);

// node creation
ShapeNode nd = flowChart.getFactory().createShapeNode(10,10,18,10);
nd.setText("Node1");
nd.setBrush(new SolidBrush(Color.decode("#8eb9f2")) );
nd.setAnchorPattern(AnchorPattern.fromId("TopInBottomOut"));
nd.setEnabledHandles(AdjustmentHandles.Move);
nd.setShape(com.mindfusion.diagramming.Shape.fromId("Rectangle"));

these nodes I am creating after the application load on button click.
But I am creating two nodes in constructor, which do not have the above problem. They do not show any anchor point on mouseover and can be linked from any side.

What could be the problem?

Thank you
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: origin and destination points with nodes
Reply #1 - Feb 4th, 2009 at 9:17am
Print Post  
nd.setAnchorPattern(AnchorPattern.fromId("TopInBottomOut"));

The top AnchorPoint from that pattern object allows only incoming links, and the bottom one allows only outgoing links. You could change the AllowIncomingLinks and AllowOutgoingLinks properties of AnchorPoints of that AnchorPattern object, or create a new one whose points allow links in both directions.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
jay
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 59
Joined: Feb 4th, 2009
Re: origin and destination points with nodes
Reply #2 - Feb 4th, 2009 at 9:31am
Print Post  
Thank you, it worked.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint