I'm working on a graph editor for a student project.\nI've based my work on the GraphEditor example from the jgraph lib.


Now I want to set the maximum size of the graph. I've found these methods :


//X Y Width Height\ngraph.setMaximumGraphBounds(new mxRectangle(0, 0, 320, 240));\ngraph.setMinimumGraphSize(new mxRectangle(0, 0, 320, 240));


but I the view is larger than these dimensions. I can not place a vertex outside this area, but I want to make the view port not larger than a fixed resolution in pixel (for e.g. 1024x768), and be able to zoom if needed.


Thank you.\n/Q

asked 20 Mar '12, 00:20

qiou's gravatar image

accept rate: 0%

There is no built-in support for this.


answered 20 Mar '12, 00:33

Gaudenz's gravatar image

accept rate: 39%

Ok thx for the answer.


Maybe I can try to make a viewport, centered on this area and manually limit the position by checking if the coordinates are in bounds ?

(20 Mar '12, 00:39) qiou
Your answer
toggle preview

Follow this question

By Email:

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



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



Asked: 20 Mar '12, 00:20

Seen: 2,019 times

Last updated: 20 Mar '12, 00:39