so after putting the ability to pan my graph, I have run into a bit of a problem. if i pan so much that my cursor exits the graph viewport it starts to scroll the opposite way. this is caused by a built in functionality to the jscrollpane. look on this page where they talk about how it works:

\n

http://download.oracle.com/javase/tutorial/uiswing/components/scrollpane.html

\n

"Move the cursor over the image and press the cursor. Continuing to press the cursor, drag to a point outside the image and pause. The visible area of the image moves toward the cursor. This scroll-by-dragging functionality is enabled by the scroll pane, and with the JComponent API, but it is implemented by the custom component that displays the image."

\n

how would i disable this?

asked 03 Nov '11, 07:20

bubshinkle's gravatar image

bubshinkle
40110
accept rate: 20%


This will be fixed in the next release by changing the top of mxGraphHandler.mouseDragged as follows:

\n
public void mouseDragged(MouseEvent e)\n{\n  if (graphComponent.isAutoScroll())\n  {\n    graphComponent.getGraphControl().scrollRectToVisible(\n      new Rectangle(e.getPoint()));\n  }\n  //...\n
\n

Thanks

\n

Gaudenz

link

answered 04 Nov '11, 04:43

Gaudenz's gravatar image

Gaudenz
80.1k1310
accept rate: 39%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×45
×37
×11
×6

Asked: 03 Nov '11, 07:20

Seen: 2,665 times

Last updated: 04 Nov '11, 04:43