Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » GraphicalEditorWithFlyoutPalette without scroll bars
GraphicalEditorWithFlyoutPalette without scroll bars [message #510970] Fri, 29 January 2010 11:19 Go to next message
Ben Wecker is currently offline Ben WeckerFriend
Messages: 2
Registered: January 2010
Junior Member
The title pretty much says it. I have a (custom subclass of) GraphicalEditorWithFlyoutPalette that has scroll bars, because the figure inside it is too large. How can I remove the scrollbars. Obviously the default graphical viewer for GraphicalEditorWithFlyoutPalette is always a ScrollingGraphicalViewer, overwriting this leads to exceptions.
Re: GraphicalEditorWithFlyoutPalette without scroll bars [message #511254 is a reply to message #510970] Sun, 31 January 2010 21:42 Go to previous messageGo to next message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
On 29/01/2010 11:19, Ben Wecker wrote:
> The title pretty much says it. I have a (custom subclass of)
> GraphicalEditorWithFlyoutPalette that has scroll bars, because the
> figure inside it is too large. How can I remove the scrollbars.
> Obviously the default graphical viewer for
> GraphicalEditorWithFlyoutPalette is always a ScrollingGraphicalViewer,
> overwriting this leads to exceptions.

Presumably you tried over-riding the following method in your editor?:

protected void createGraphicalViewer(Composite parent);
Re: GraphicalEditorWithFlyoutPalette without scroll bars [message #513232 is a reply to message #511254] Tue, 09 February 2010 13:02 Go to previous messageGo to next message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
But if your figure is big then removing the scrollbar will make you figure visible partially or not visible at all...

The best way would be...

((ScalableRootEditPart*) getGraphicalViewer().getRootEditPart()).getZoomManager().setZoomAsText(ZoomManager.FIT_ALL)


*What ever is your rooteditpart.

still if your figure is too large the result will not be viewable...


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: GraphicalEditorWithFlyoutPalette without scroll bars [message #513300 is a reply to message #513232] Tue, 09 February 2010 17:02 Go to previous messageGo to next message
Ben Wecker is currently offline Ben WeckerFriend
Messages: 6
Registered: February 2010
Junior Member
In fact, I tried to override configureGraphicalViewer(). I don't quite get the difference between create..., initialize... and configureGraphicalViewer(). I added the line suggested by Philipp, however my figure is not shown at all any more. It is indeed big, but is ok, if it is shown only partially. By the way, I have a ScalableFreeformRootEditPart
Any idea how to remove the scroll bars, but with having the Figure (containing a large image) still been drawn?
Re: GraphicalEditorWithFlyoutPalette without scroll bars [message #513311 is a reply to message #513300] Tue, 09 February 2010 18:03 Go to previous messageGo to next message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
On 09/02/2010 17:02, Ben Wecker wrote:
> In fact, I tried to override configureGraphicalViewer(). I don't quite
> get the difference between create..., initialize... and
> configureGraphicalViewer(). I added the line suggested by Philipp,
> however my figure is not shown at all any more. It is indeed big, but is
> ok, if it is shown only partially. By the way, I have a
> ScalableFreeformRootEditPart
> Any idea how to remove the scroll bars, but with having the Figure
> (containing a large image) still been drawn?

When I said to over-ride createGraphicalViewer(Composite parent) in your
editor I meant like this:

protected void createGraphicalViewer(Composite parent) {
GraphicalViewer viewer = new GraphicalViewerImpl();
viewer.createControl(parent);
setGraphicalViewer(viewer);
configureGraphicalViewer();
hookGraphicalViewer();
initializeGraphicalViewer();
}

When I add that to my Editor I get no scroll bars.

P.
Re: GraphicalEditorWithFlyoutPalette without scroll bars [message #513403 is a reply to message #513311] Wed, 10 February 2010 04:03 Go to previous messageGo to next message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
Quote:
When I said to over-ride createGraphicalViewer(Composite parent) in your
editor I meant like this:

protected void createGraphicalViewer(Composite parent) {
GraphicalViewer viewer = new GraphicalViewerImpl();
viewer.createControl(parent);
setGraphicalViewer(viewer);
configureGraphicalViewer();
hookGraphicalViewer();
initializeGraphicalViewer();
}

When I add that to my Editor I get no scroll bars.



Does it also enshure that the figure will be scaled down to fit the visible area...??

@Ben Wecker
Did you try the zoom manager part...

((ScalableFreeformRootEditPart
) getGraphicalViewer().getRootEditPart()).getZoomManager().setZoomAsText(ZoomManager.FIT_ALL)


ScalableFreeformRootEditPart also has a getZoomManager method...


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: GraphicalEditorWithFlyoutPalette without scroll bars [message #513504 is a reply to message #513403] Wed, 10 February 2010 12:31 Go to previous messageGo to next message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
On 10/02/2010 04:03, vijay wrote:
> Quote:
>> When I said to over-ride createGraphicalViewer(Composite parent) in
>> your editor I meant like this:
>>
>> protected void createGraphicalViewer(Composite parent) {
>> GraphicalViewer viewer = new GraphicalViewerImpl();
>> viewer.createControl(parent);
>> setGraphicalViewer(viewer);
>> configureGraphicalViewer();
>> hookGraphicalViewer();
>> initializeGraphicalViewer();
>> }
>>
>> When I add that to my Editor I get no scroll bars.
>
>
> Does it also enshure that the figure will be scaled down to fit the
> visible area...??
>

No. But the original poster said "...but is ok, if it is shown only
partially."
Re: GraphicalEditorWithFlyoutPalette without scroll bars [message #513532 is a reply to message #513504] Wed, 10 February 2010 14:08 Go to previous messageGo to next message
Ben Wecker is currently offline Ben WeckerFriend
Messages: 6
Registered: February 2010
Junior Member
Philipp, thanks a lot! Overriding the createGraphicalViewer() method in the way that you suggested worked perfectly for me! I do not need the image to be scaled.
Re: GraphicalEditorWithFlyoutPalette without scroll bars [message #513620 is a reply to message #513532] Wed, 10 February 2010 17:27 Go to previous message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
Quote:
In fact, I tried to override configureGraphicalViewer(). I don't quite get the difference between create..., initialize... and configureGraphicalViewer(). I added the line suggested by Philipp, however my figure is not shown at all any more. It is indeed big, but is ok, if it is shown only partially. By the way, I have a ScalableFreeformRootEditPart
Any idea how to remove the scroll bars, but with having the Figure (containing a large image) still been drawn?


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Previous Topic:[Announce] GEF 3.5.2RC3 is available
Next Topic:GEF incubator proposal discussion
Goto Forum:
  


Current Time: Tue Mar 19 11:43:35 GMT 2024

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

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

Back to the top