Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Control the Arrow-Position and Arrow-Direction (Read 4116 times)
zhang
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 14
Joined: May 28th, 2014
Control the Arrow-Position and Arrow-Direction
Jun 24th, 2014 at 3:17pm
Print Post  
Hello, my question is, how can I control the LinkHead(Arrow), I explain this with the following code and 2 pictures. The Arrow-position seems to can not be always in the middle of the NodeRecht, and the Arrow-direction is wrong. could you tell me,is it possible to change that? thank you very much!

DiagramLink dl=diagram2.getFactory().createDiagramLink(origin, target);
                  dl.setHeadShape(Shape.fromId("Arrow3"));
dl.setHeadShapeSize(3);
  

ArrowProblem.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Control the Arrow-Position and Arrow-Direction
Reply #1 - Jun 24th, 2014 at 5:32pm
Print Post  
Hi,

You should use shapes from the ArrowHeads enumeration:
http://www.mindfusion.eu/onlinehelp/droiddiagram/index.htm?T_com_mindfusion_diag...

If you want one looking like the Arrow3 box shape, use a custom definition:

Code
Select All
new Shape(
            new ElementTemplate[]
            {
                new LineTemplate(0, 40, 50, 0),
                new LineTemplate(50, 0, 100, 40),
                new LineTemplate(100, 40, 70, 40),
                new LineTemplate(70, 40, 70, 100),
                new LineTemplate(70, 100, 30, 100),
                new LineTemplate(30, 100, 30, 40),
                new LineTemplate(30, 40, 0, 40)
            },
            Path.FillType.WINDING, "MyArrow"); 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
zhang
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 14
Joined: May 28th, 2014
Re: Control the Arrow-Position and Arrow-Direction
Reply #2 - Jun 24th, 2014 at 7:07pm
Print Post  
Thanks, but I still can not change the position of the Arrow, as the following picture, when the diagram be created, the LinkHead's (Arrow's) position is automatically be set, it looks not very correct. could you tell me may I change the position to the left-middle of Rechtangle? Is it possible? Thank you very much indeed!
  

Arrow3.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Control the Arrow-Position and Arrow-Direction
Reply #3 - Jun 25th, 2014 at 7:56am
Print Post  
Hi,

Set nodes' AnchorPattern property, and set Anchoring property of layout classes to either Keep or Reassign before calling Arrange. You might also check the AnchorPoints sample project to see how to define custom connection points.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
zhang
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 14
Joined: May 28th, 2014
Re: Control the Arrow-Position and Arrow-Direction
Reply #4 - Jun 25th, 2014 at 4:22pm
Print Post  
thanks a lot.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint