Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Panning the diagram vs. creating a new node (Read 4449 times)
Rennie
Full Member
***
Offline


I Love MindFusion!

Posts: 108
Location: Copenhagen, Denmark
Joined: Jul 17th, 2012
Panning the diagram vs. creating a new node
Oct 27th, 2013 at 1:31am
Print Post  
I'm just starting to test the beta version of this module. Looks good.

Maybe I'm missing something obvious, but how do you pan a diagram that is larger than the display? The usual pan or swipe gesture with the finger results in a new node being created.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Panning the diagram vs. creating a new node
Reply #1 - Oct 27th, 2013 at 7:01am
Print Post  
With two fingers, or set DiagramView.Behavior = Pan to enable single-finger panning.

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


I Love MindFusion!

Posts: 108
Location: Copenhagen, Denmark
Joined: Jul 17th, 2012
Re: Panning the diagram vs. creating a new node
Reply #2 - Oct 29th, 2013 at 2:53am
Print Post  
Thanks.

Edit: Um, that should actually be
            DiagramView.setBehavior(Behavior.Pan);
right?
« Last Edit: Oct 30th, 2013 at 1:16am by Rennie »  
Back to top
 
IP Logged
 
Rennie
Full Member
***
Offline


I Love MindFusion!

Posts: 108
Location: Copenhagen, Denmark
Joined: Jul 17th, 2012
Re: Panning the diagram vs. creating a new node
Reply #3 - Nov 6th, 2013 at 2:16pm
Print Post  
My simple little app based on the beta version of your Android product is almost done. As I said before, I think it is great that MindFusion has created a diagramming product that is multi-platform in a very compatible way.

But I have one comment about this Behavior=Pan thing. I don't think it should be a "behavior", because that means that you can't specify one of the other behaviors. For example, I'd like to specify Behavior=SelectOnly, and for another app I might want to use one of the other behaviors.

So I think the one-finger panning should be a separate option, and not considered a behavior.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Panning the diagram vs. creating a new node
Reply #4 - Nov 7th, 2013 at 9:43am
Print Post  
We can't see how to implement it as a simple bit-wise combination, there will be too many ambiguities. If you want to combine another type of behavior with single finger panning, you could derive from that behavior class (LinkShapesBehavior let's say), and start panning when you find it appropriate (e.g. there are no nodes at touch location). All the PanBehavior class does is the following, it shouldn't be hard to integrate into a custom class:

Code
Select All
protected void pointerDown(Point pointerPosition, MotionEvent e)
{
	panPoint = new PointF(getDiagramView().getDocScrollX(), getDiagramView().getDocScrollY());
	ptStartDragDev = pointerPosition;
}

protected void pointerMove(Point pointerPosition, MotionEvent e)
{
	Rect visibleRect = getDiagramView().getVisibleRect();
	RectF rcPage = getDiagramView().canvasToDoc(visibleRect);

	float sx = panPoint.x - getDiagramView().componentToDocLength(pointerPosition.x - ptStartDragDev.x);
	float sy = panPoint.y - getDiagramView().componentToDocLength(pointerPosition.y - ptStartDragDev.y);
    getDiagramView().scrollStayInDoc(sx, sy, rcPage);
}

private PointF panPoint;
private Point ptStartDragDev; 



Placing index and middle fingers close together and panning with both shouldn't be that hard for your users anyways.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint