Skip to main content



      Home
Home » Eclipse Projects » GEF » Editor dimensions and center point
Editor dimensions and center point [message #94580] Tue, 16 September 2003 12:36 Go to next message
Eclipse UserFriend
Originally posted by: rsudra.hotmail.com

Dear all,

I need to work out the dimensions of a gef editor to center an editpart as
the focus of the diagram. I can get the width and height of the platform
shell using (i think thats what it is as it only seems to change when I
resize the top level window and not the editor windows):

getEditorSite().getShell().getSize()

How do I get the size of an editor? While we are here, how do I get the
dimensions of an view? I am hoping that it is more or less the same
process/calls.

Finally, I need the editor to respond to a resize event by repositioning
the elements. What listener/events should I use? as long as I can
recalculate and reposition the model elements, the event fired their will
redraw the editparts so that side is ok.

Thanks in advance!
Raj
Re: Editor dimensions and center point [message #94730 is a reply to message #94580] Wed, 17 September 2003 09:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rsudra.hotmail.com

Hi all,

I think I have worked out how to do this. I defined a method in my Gef
Editor to do it:

protected Point getEditorDimensions() {
return ((FigureCanvas) getGraphicalViewer().getControl()).getSize();
}

If anyone has anymore thoughts on this, please let me know as I am
interested to see if there are other ways of getting this information.

Thanks
Raj
Re: Editor dimensions and center point [message #97308 is a reply to message #94730] Sun, 05 October 2003 17:43 Go to previous message
Eclipse UserFriend
Originally posted by: ThisisFake.Fakeness.xyz

On Wed, 17 Sep 2003 13:48:33 +0000, Rajeev Sudra wrote:

> Hi all,
>
> I think I have worked out how to do this. I defined a method in my Gef
> Editor to do it:
>
> protected Point getEditorDimensions() {
> return ((FigureCanvas) getGraphicalViewer().getControl()).getSize();
> }
>
> If anyone has anymore thoughts on this, please let me know as I am
> interested to see if there are other ways of getting this information.
>
> Thanks
> Raj

I am trying to do this now. Looks like what you need is to make your own
Layout Manager that centers its contents. That is the path I am taking.
But while I think the layout manager is a key, also I need a new figure it
would seem because when the layout manager centers the figure, it causes
the parent figure to appearently resize itself, and we get a loop. So I
gotta figure out a new Pane or Layered figure or something.


Any help is appreciated.

CL
Previous Topic:Figure size?
Next Topic:please help me!!! How to add serval connection creation tools?
Goto Forum:
  


Current Time: Fri May 09 22:49:00 EDT 2025

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

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

Back to the top