Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Arrow - adding text to anchor and base ? (Read 6966 times)
DavidNL
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Apr 13th, 2006
Arrow - adding text to anchor and base ?
Apr 13th, 2006 at 6:34am
Print Post  
Hi,
I've downloaded the trial version and i'm testing some of the features to see if the product does all the things we would like to use it for.

I was wondering if its possible to:
- Create Box1
- Create Box2
- Create arrow from Box1 to Box2
- Set arrowAnchor and ArrowBase to 'ahArrow'
-> THEN i would like to add text to both sides of the arrow.

All i can find is 'Arrow.Text' to set some text.
So the question is if i can add text at the start and end of the arrow...

Thanks in advance for any help.

Regards,
David.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arrow - adding text to anchor and base ?
Reply #1 - Apr 13th, 2006 at 7:00am
Print Post  
You could do that using label boxes attached to the arrow. Setup a label box like this:

- box.Transparent = true; so olny the text is visible
- box.Locked = true; that's optional, so that users are prevented from moving the labels
- box.IgnoreLayout = true; if you need to use automatic layouts
- call fc.CreateGroup(arrow) to create a group for the label boxes
- call group.AttachToArrowPoint() to attach the labels to the first or last control point of the arrow

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


I love YaBB 1G - SP1!

Posts: 7
Joined: Apr 13th, 2006
Re: Arrow - adding text to anchor and base ?
Reply #2 - Apr 13th, 2006 at 7:47am
Print Post  
Stoyo wrote on Apr 13th, 2006 at 7:00am:
- call group.AttachToArrowPoint() to attach the labels to the first or last control point of the arrow


Hi,
Thanks for the quick reply.

I'm kinda new at this, i dont entirely understand the last step.
what parameters do i give ?
group.AttachToArrowPoint(MyGroup, ?)

how do i find the (two) correct arrow control point indexes ?


Thanks,
David.
  
Back to top
 
IP Logged
 
DavidNL
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Apr 13th, 2006
Re: Arrow - adding text to anchor and base ?
Reply #3 - Apr 13th, 2006 at 7:50am
Print Post  
ahh think i found it, Arrow.OrgnIndex and Arrow.DestIndex



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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arrow - adding text to anchor and base ?
Reply #4 - Apr 13th, 2006 at 8:03am
Print Post  
For the first label (at the source) it should look like

g.AttachToArrowPoint arrow, 0

and for the second label near the arrowhead):

g.AttachToArrowPoint arrow, arrow.CtrlPtCount - 1

OrgnIndex and DestIndex give you the index of a table row or an anchor point to which an arrow is attached.

Stoyan
  
Back to top
 
IP Logged
 
DavidNL
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Apr 13th, 2006
Re: Arrow - adding text to anchor and base ?
Reply #5 - Apr 13th, 2006 at 8:25am
Print Post  
Ok, thanks, that works.

My last 2 problems:

Problem #1:
- Created Box1
- Created Box2, Box3, Box4 and Box5
- Created arrows from Box1 to Box2, Box1 to Box3, Box1 to Box4 and Box1 to Box5.
- Created the 'label boxes' at all the 'sources' and 'destinations' of the arrows

Now some of the '4 label boxes' at the source of the arrows at Box1 are created 'upon' eachother instead of next  to eachother (so i can't properly read the text). Also some are created upun Box1 itself.

How do i create the label boxes so the text can be read properly and the boxes dont interfere with eachother ?

Problem #2:
I'm using a default layout specified in the help:

Dim layout As New SpringLayout
    layout.NumIterations = 500
    layout.NodeDistance = 100
    fcx.ArrangeDiagram layout

Sometimes the Boxes and Arrows cross eachother even if there's plenty space to create them somehwere else (to prevent crossing).
Is there any way to accomplisch this ?


Many thanks for the help,
David.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arrow - adding text to anchor and base ?
Reply #6 - Apr 13th, 2006 at 9:19am
Print Post  
You could handle the ObjectModified event for boxes and arrows, and sort the label boxes related to a modified arrow, or to all arrows connected to a modified box. The control cannot do that automatically at this time.

Try the MinimizeCrossings option of the SpringLayout, or use the LayeredLayout, which breaks the arrows into more segments to avoid them crossing nodes.

Stoyan
  
Back to top
 
IP Logged
 
DavidNL
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Apr 13th, 2006
Re: Arrow - adding text to anchor and base ?
Reply #7 - Apr 13th, 2006 at 12:44pm
Print Post  
Ok, the MinimizeCrossings does the job.

Quote:
You could handle the ObjectModified event for boxes and arrows, and sort the label boxes related to a modified arrow, or to all arrows connected to a modified box. The control cannot do that automatically at this time.


The part about the mixed up text labels, i'm not sure what you mean...

to clearify a bit: I've set 'StaticMode' to True so the user can't change anything.
What i would like to do is build some sort of 'family tree' and present the tree to the user - he can't change anything.

Basicly i dont want the labels at the arrow head and arrow base to cross with Textboxes and Arrorws..

If you/anyone could give me some more tips on how to accomplish this i'd be very grateful.


Regards,
David.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arrow - adding text to anchor and base ?
Reply #8 - Apr 13th, 2006 at 1:58pm
Print Post  
Ok, if the diagram is read only you can arrange the labels after running the layout.

I.e. after calling ArrangeDiagram, iterate all nodes and find the text labels near them through the OutgoingArrows and IncomingArrow collections. Then divide the labels in four groups depending on which side of the node they are located. Sort each group by X or Y and distribute the labels across the respective node side so they are at equal distances.

I can get a developer of ours create a sample that shows that, but it will take some time.

Stoyan
  
Back to top
 
IP Logged
 
DavidNL
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Apr 13th, 2006
Re: Arrow - adding text to anchor and base ?
Reply #9 - Apr 13th, 2006 at 3:22pm
Print Post  
Ok, thanks alot for all the help!

Quote:
I can get a developer of ours create a sample that shows that, but it will take some time.

Thats not necessary yet, i think i've found what i'm looking for.
If it doesnt work out I will let you know (and maybe remind you about your offer Wink )

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arrow - adding text to anchor and base ?
Reply #10 - Apr 13th, 2006 at 5:09pm
Print Post  
ok, that's great  8)
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint