Fixed size diagram [message #218251] |
Wed, 21 June 2006 12:27 |
Eclipse User |
|
|
|
Originally posted by: Ilya.Boyandin.fh-joanneum.at
Hello all!
I want to make a GEF editor allowing the user to lay out graphical
objects on a display, so the diagram area of the editor must be of a
fixed size. The bounds of the diagram in pixels are set upon the editor
creation, when the user chooses the screen resolution, and later they
probably never change.
Can somebody tell me how to accomplish this?
The problem is that by default the sizes are practically unlimited -
they grow when figures are resized or new ones are added so that they
don't fit within the bounds anymore. This behaviour is inappropriate for me.
Thanks in advance,
Ilya
|
|
|
Re: Fixed size diagram [message #218260 is a reply to message #218251] |
Wed, 21 June 2006 13:33 |
Eclipse User |
|
|
|
Originally posted by: lamont_gilbert.rigidsoftware.com
Ilya Boyandin wrote:
> Hello all!
>
> I want to make a GEF editor allowing the user to lay out graphical
> objects on a display, so the diagram area of the editor must be of a
> fixed size. The bounds of the diagram in pixels are set upon the editor
> creation, when the user chooses the screen resolution, and later they
> probably never change.
>
> Can somebody tell me how to accomplish this?
>
> The problem is that by default the sizes are practically unlimited -
> they grow when figures are resized or new ones are added so that they
> don't fit within the bounds anymore. This behaviour is inappropriate for
> me.
>
> Thanks in advance,
> Ilya
IIRC this is because of the FreeFormLayout of the root editpart. You want
to use a different layout. FreeForm expands to fit the bounds of the
contents.
--
Respectfully,
CL Gilbert
"Verily, verily, I say unto you, He that entereth not by the door() into the
sheepfold{}, but climbeth up some other *way, the same is a thief and a
robber."
|
|
|
Re: Fixed size diagram [message #218267 is a reply to message #218260] |
Wed, 21 June 2006 13:58 |
Eclipse User |
|
|
|
Originally posted by: Ilya.Boyandin.fh-joanneum.at
CL [dnoyeb] Gilbert wrote:
> Ilya Boyandin wrote:
>
> IIRC this is because of the FreeFormLayout of the root editpart. You want
> to use a different layout. FreeForm expands to fit the bounds of the
> contents.
I tried to use some other layouts and edit parts instead of
FreeFormLayout and FreeformGraphicalRootEditPart. The only meaningful
difference was that the diagram could grow only to the positive X and Y
values, and not to the positive and negative ones as with Freeform.
Still the sizes of the diagram were practically unlimited :(
|
|
|
|
Re: Fixed size diagram [message #218298 is a reply to message #218289] |
Thu, 22 June 2006 07:40 |
Eclipse User |
|
|
|
Originally posted by: Ilya.Boyandin.fh-joanneum.at
As I wrote in the previous answer I tried some other layers and layouts,
for instance, the combination of
ScalableLayeredPane, XYLayout, and ScalableRootEditPart instead of
FreeformLayer, FreeformLayout, and FreeformGraphicalRootEditPart
and still the diagram sizes were unlimited, though they could grow into
only two directions instead of four.
Setting the maximumSize property of the diagram Figure didn't help either.
> I think the problem is that maybe you used FreeFormLayer as the figure for
> the rooteditpart, which expands to hold all its figures.
> So I think you should try another Layer for your rooteditpart :-)
>> I want to make a GEF editor allowing the user to lay out graphical
>> objects on a display, so the diagram area of the editor must be of a
>> fixed size.
|
|
|
Re: Fixed size diagram [message #218845 is a reply to message #218251] |
Mon, 03 July 2006 18:47 |
Eclipse User |
|
|
|
Originally posted by: Ilya.Boyandin.fh-joanneum.at
In case if somebody needs to make something similar, I solved the
problem this way:
First, I created a layout manager for the main container figure which
lays out all of its children inside a fixed rectangle. Then I overloaded
two of the getConstraintFor() methods of the layout EditPolicy of the
main container edit part, so that the location and size of the objects
being moved or resized and the request parameters sizeDelta and
moveDelta are adjusted, so that the objects stay in the bounds of the
parent container rectangle. This way even the feedback figures cannot be
dragged out of the parent rectangle area.
Ilya
Ilya Boyandin wrote:
> I want to make a GEF editor allowing the user to lay out graphical
> objects on a display, so the diagram area of the editor must be of a
> fixed size. The bounds of the diagram in pixels are set upon the editor
> creation, when the user chooses the screen resolution, and later they
> probably never change.
>
> Can somebody tell me how to accomplish this?
>
> The problem is that by default the sizes are practically unlimited -
> they grow when figures are resized or new ones are added so that they
> don't fit within the bounds anymore. This behaviour is inappropriate for
> me.
|
|
|
Re: Fixed size diagram [message #218958 is a reply to message #218845] |
Wed, 05 July 2006 13:31 |
Eclipse User |
|
|
|
Originally posted by: reinalt.gmail.com
can u lemme know wot kinda figure u finally used for the root conatiner
and wot editpolicies were required to drag&drop children figures into the
parent figure.
thnx
|
|
|
Re: Fixed size diagram [message #218991 is a reply to message #218958] |
Wed, 05 July 2006 17:02 |
Eclipse User |
|
|
|
Originally posted by: Ilya.Boyandin.fh-joanneum.at
For the root container I used a custom figure simply extending the
Figure class and overriding the paintFigure method to draw a symbolic
monitor.
The edit policies were the same as in the Shapes example. The only
important difference was in the getConstraintFor methods of the
XYLayoutEditPolicy which I overrode to restrict the bounds of the
children figures.
Ilya
reinalt wrote:
> can u lemme know wot kinda figure u finally used for the root conatiner
> and wot editpolicies were required to drag&drop children figures into
> the parent figure.
|
|
|
Re: Fixed size diagram [message #219921 is a reply to message #218991] |
Mon, 24 July 2006 10:13 |
Eclipse User |
|
|
|
Originally posted by: reinalt.gmail.com
Hi Ilya ,need some help on this topic.
In my Container EditPart createFigure returns a Draw2d Panel with
bounds(500,500) n sm background color(gray ). I hv overridden
getConstraintFor(request,editPart) method.The children are added to it but
are not visible....Cant figure out where is the problem...
thnx
|
|
|
|
Powered by
FUDForum. Page generated in 0.04322 seconds