Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic SnapToBorder (Read 3653 times)
koosala
Full Member
***
Offline


Java Happens

Posts: 136
Joined: May 13th, 2007
SnapToBorder
Jul 4th, 2007 at 12:21am
Print Post  
Hi Stoyan,


The arrows have a setter called setSnapToBorder.

I turn this on when creating my arrow, but the snapping action is not present when the arrow is being created, only after it is created.

Can this behavior be enforced when the arrow is getting created itself? This will give a proper visual indication of what the arrow's path is going to be after creation.

I have the autoroute enabled on the flowchart.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SnapToBorder
Reply #1 - Jul 4th, 2007 at 6:46am
Print Post  
Hi Praveen,

Try setting the RoutingOptions.TriggerRerouting property to a value that has the RerouteArrows.WhileCreating bit enabled.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
koosala
Full Member
***
Offline


Java Happens

Posts: 136
Joined: May 13th, 2007
Re: SnapToBorder
Reply #2 - Jul 5th, 2007 at 1:22am
Print Post  
Hi Stoyan,

I tried this and it seems to give me some problem. So, I have included a trimmed down version of the code where the problem is present:

flowchart = new FlowChart();
this.getContentPane().add(flowchart);

flowchart.setArrowStyle(ArrowStyle.Cascading);
flowchart.setRouteArrows(true);
flowchart.setSnapToAnchor(SnapToAnchor.OnCreateOrModify);
flowchart.getRoutingOptions().setTriggerRerouting(RerouteArrows.WhileCreating);

So, I have the above lines in the code, and on running it, I get this exception:


Exception in thread "AWT-EventQueue-1" java.lang.ArrayStoreException: java.awt.geom.Point2D$Double
at com.mindfusion.jdiagram.Utilities.a(Unknown Source)
at com.mindfusion.jdiagram.Arrow.a(Unknown Source)
at com.mindfusion.jdiagram.Arrow.c(Unknown Source)
at com.mindfusion.jdiagram.InteractionState.b(Unknown Source)
at com.mindfusion.jdiagram.FlowChart$MouseMonitor.mouseDragged(Unknown Source)
at java.awt.AWTEventMulticaster.mouseDragged(Unknown Source)
at java.awt.Component.processMouseMotionEvent(Unknown Source)
at javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

On dragging from inside a box, the arrow end automatically attaches to the same box and dragging the mouse out of the box throws the above exception.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SnapToBorder
Reply #3 - Jul 5th, 2007 at 8:39am
Print Post  
I've sent you a private message with a link to the updated license jar. Use the link from the top of the forum page to access it. The new jar should fix that problem.

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