Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Make FigureCanvas Larger
Make FigureCanvas Larger [message #848851] Wed, 18 April 2012 16:30 Go to next message
Craig Petre is currently offline Craig Petre
Messages: 32
Registered: April 2011
Hi. In my editor I'm looking to make the editing area (the FigureCanvas within the GraphitiScrollingGraphicalViewer) larger by x units or maybe by x% instead of the default minimum area to contain all pictogram elements so there is a buffer around the diagram where users can scroll. This would give users more room to work. I think a lot of users of my editor (myself included) will drag out a random pictogram element and place it some far distance from where they are editing just to make the diagram larger so there isn't the feeling the diagram is closing in on the work area and it also makes it easier to drag and organize elements within the space.

The only way I can see of doing this would be to do something similar to what was done in GFFigureCanvas and GFScrollingGraphicalViewer where I would have to make my own class of both and override createGraphicalViewer (at least) in my editor and then do some magic in my extended Canvas which would provide a buffer around the editing area. Anybody have any better ideas, or maybe this warrants a feature request? I would go ahead and use GFScrollingGraphicalViewer (by setting scroll bars to always visible through my ToolBehaviorProvider) since it has an infinite space, but the comments and depricated functions along that path seem to indicate this would not be a future-proof plan.

Re: Make FigureCanvas Larger [message #850722 is a reply to message #848851] Fri, 20 April 2012 09:07 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1618
Registered: July 2009
Location: Walldorf, Germany
Senior Member
That's a difficult spot... :-(

There have already been extensive discussion (already starting in the time
Graphiti was an SAP-internal framework). As it seems there's no really good
solution from the framework side to replace the current behavior. The stuff
you found around infinite canvas (scrollbars always visible) is more or less
a workaround to enable certain tooling scenarios we have today (used heavily
within SAP). But it's rather a hack than a clean solution and changes in GEF
might easily break this. That's why all the warnings are there...

Any ideas on this topic are highly welcome, so if you or anybody else in the
community has ideas how to improve this, please either post it here or open
an enhancement bugzilla.

Re: Make FigureCanvas Larger [message #857170 is a reply to message #850722] Thu, 26 April 2012 09:54 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal Karaca
Messages: 750
Registered: July 2009
Senior Member
(If I did understand the problem:) Maybe an (invisible) Rectangle that dynamically changes its size could help: calculate the bounding box of the "real" pictogram elements, then add the amount of additional margin (additional space around the pictogram elements) and set it as its size.
Re: Make FigureCanvas Larger [message #857417 is a reply to message #857170] Thu, 26 April 2012 14:13 Go to previous message
Craig Petre is currently offline Craig Petre
Messages: 32
Registered: April 2011
Ohh yes, maybe a large inactive rectangle.. hmm maybe I will give that a try. Thanks!
Previous Topic:getContextButtonPad is not running feature
Next Topic:Using getDiagramFromFiles Error
Goto Forum:

Current Time: Sat Oct 25 07:20:25 GMT 2014

Powered by FUDForum. Page generated in 0.04127 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software