Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Creating Custom Arrows internally (Read 2342 times)
koosala
Full Member
***
Offline


Java Happens

Posts: 136
Joined: May 13th, 2007
Creating Custom Arrows internally
Jul 3rd, 2007 at 3:25am
Print Post  
Hi,

We have recently purchased your source code.

I was interested in inheriting from arrow as a custom arrow - MyArrow.

Creating the arrow on a click and drag I found happened in CreateArrowBehavior.startDraw

I replaced the new Arrow(fc, obj)

with fc.getDefaultArrow(obj)

I have inherited from FlowChart to create MyCanvas

where I have overriden the method getDefaultArrow to return MyArrow.

So, what I have is whenever the in-built arrow creation feature kicks in, it will start creating my arrow.

I had to ask two questions here:

1. Do you foresee any problem if I continue this trespassing into your code, meaning can you think of any assumption you have in mind for arrow, because of which MyArrow goes wrong? (For now the method seems to work alright - creates a MyArrow object that shows up regularly)

2. Can something like this be provided out of the box so that I can set the default arrow I would like created?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Creating Custom Arrows internally
Reply #1 - Jul 3rd, 2007 at 5:53am
Print Post  
Hi,

1. There shouldn't be any problem using your custom Arrow class, if you only need to e.g. change the drawing code or add some new fields. There might be some problems if you change the interaction logic; for example you should be careful not to cause infinite recursion if modifying an arrow also moves other objects, and there are cycles in the graph.

2. In Flowchart.NET 5 you can simply set CustomNodeType and CustomLinkType properties, but I don't know when that will be available in the web/Java versions; could take several months until we port it.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint