Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Reflexive arrows and Arrow Modifying (Read 3079 times)
koosala
Full Member
***
Offline


Java Happens

Posts: 136
Joined: May 13th, 2007
Reflexive arrows and Arrow Modifying
Apr 17th, 2008 at 6:12am
Print Post  
Hi,

I have the following initialization done on the canvas. I do a snaptoBorder on arrow creating event.

[code]


import java.awt.Color;

import javax.swing.JApplet;

import com.mindfusion.jdiagram.Arrow;
import com.mindfusion.jdiagram.ArrowStyle;
import com.mindfusion.jdiagram.AttachToNode;
import com.mindfusion.jdiagram.Box;
import com.mindfusion.jdiagram.FlowChart;
import com.mindfusion.jdiagram.FlowChartAdapter;
import com.mindfusion.jdiagram.Group;
import com.mindfusion.jdiagram.Item;
import com.mindfusion.jdiagram.ItemList;
import com.mindfusion.jdiagram.RerouteArrows;
import com.mindfusion.jdiagram.ShadowsStyle;
import com.mindfusion.jdiagram.SnapToAnchor;
import com.mindfusion.jdiagram.SolidBrush;
import com.mindfusion.jdiagram.ValidationEvent;

public class Goop extends JApplet {
private static final long serialVersionUID = 1L;

private FlowChart flowChart;

@Override
public void init() {
super.init();

flowChart = new FlowChart();
flowChart.setSelectionOnTop(false);
flowChart.setBackBrush(new SolidBrush(Color.WHITE));
flowChart.setShadowsStyle(ShadowsStyle.None);
this.getContentPane().add(flowChart);

flowChart.setArrowStyle(ArrowStyle.Cascading);
flowChart.setSnapToAnchor(SnapToAnchor.OnCreateOrModify);
flowChart.setRouteArrows(true);
flowChart.getRoutingOptions().setTriggerRerouting(
RerouteArrows.WhileCreating | RerouteArrows.WhenModified | RerouteArrows.WhenIntersectNode);

flowChart.addFlowChartListener(new FlowChartAdapter() {
@Override
public void itemCreating(ValidationEvent e) {
if (e.getItem() instanceof Arrow) {
((Arrow)e.getItem()).setSnapToNodeBorder(true);
}

super.itemCreating(e);
}

});
}

}

[/code]

There are two problems I see here:

1. Reflexive lines don't snap to border during creation. They only snap on modification

2. When creating the arrow the arrow routes properly as we drag it. But during modification, it doesn't route properly when dragging it. The arrow only routes when we release the mouse.

Is there anyway I can change this behavior?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Reflexive arrows and Arrow Modifying
Reply #1 - Apr 17th, 2008 at 1:20pm
Print Post  
Hi,

This is be design. We can change it after the 1.0.4 release.

Stoyan
  
Back to top
 
IP Logged
 
koosala
Full Member
***
Offline


Java Happens

Posts: 136
Joined: May 13th, 2007
Re: Reflexive arrows and Arrow Modifying
Reply #2 - Apr 22nd, 2008 at 3:17am
Print Post  
Hi,

I can understand 2nd point might be by design. But isn't the 1st point - reflexive lines not snapping to border when snaptoborder is enabled an issue?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Reflexive arrows and Arrow Modifying
Reply #3 - Apr 22nd, 2008 at 6:21am
Print Post  
Hi,

SnapToBorder wasn't considered at all during creation of new links, and we have just implemented it for the alignment features you needed. We are yet to integrate it with all kinds of arrows - reflexive, dynamic, retainForm, etc. but that won't happen before we finish with this release.

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