Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » IFigure client area
IFigure client area [message #197825] Thu, 17 July 2008 17:32 Go to next message
Eclipse UserFriend
Originally posted by: kelvinng.db.gmail.com

Ifigure has a method called getClientArea(), lbut does not have a
setClientArea method.

Is there a method that's equivalent to setClientArea(int width, int height)?

~Kelvin Ng
Re: IFigure client area [message #197832 is a reply to message #197825] Thu, 17 July 2008 17:48 Go to previous messageGo to next message
Simon Bernard is currently offline Simon BernardFriend
Messages: 345
Registered: July 2009
Senior Member
hi,

The clientArea is calculated depending on the bounds and the inset of
the border. So you must modify one to change the size of clientArea.

public Rectangle getClientArea(Rectangle rect) {
rect.setBounds(getBounds());
rect.crop(getInsets());
if (useLocalCoordinates())
rect.setLocation(0, 0);
return rect;
}

public Insets getInsets() {
if (getBorder() != null)
return getBorder().getInsets(this);
return NO_INSETS;
}

Simon



Kelvin Ng a écrit :
> Ifigure has a method called getClientArea(), lbut does not have a
> setClientArea method.
>
> Is there a method that's equivalent to setClientArea(int width, int
> height)?
>
> ~Kelvin Ng
>
Re: IFigure client area [message #197846 is a reply to message #197832] Thu, 17 July 2008 18:31 Go to previous message
Eclipse UserFriend
Originally posted by: kelvinng.db.gmail.com

I want the client area to expand (while maintaining the aspect ratio)
while I type.

How do I do this?
Do I need my own layout manager for this?
It seems that I need to do this within my layout manager's
layout(IFigure figure) method,

~Kelvin Ng

On 2008-07-17 13:48:29 -0400, Simon Bernard
<simon.bernard@anyware-tech.com> said:

> hi,
>
> The clientArea is calculated depending on the bounds and the inset of
> the border. So you must modify one to change the size of clientArea.
>
> public Rectangle getClientArea(Rectangle rect) {
> rect.setBounds(getBounds());
> rect.crop(getInsets());
> if (useLocalCoordinates())
> rect.setLocation(0, 0);
> return rect;
> }
>
> public Insets getInsets() {
> if (getBorder() != null)
> return getBorder().getInsets(this);
> return NO_INSETS;
> }
>
> Simon
>
>
>
> Kelvin Ng a écrit :
>> Ifigure has a method called getClientArea(), lbut does not have a
>> setClientArea method.
>>
>> Is there a method that's equivalent to setClientArea(int width, int height)?
>>
>> ~Kelvin Ng
Previous Topic:[Announce] GMF 2.1.1 M200807171205 is available
Next Topic:counting rows for text wrap in layoutmanager
Goto Forum:
  


Current Time: Thu Dec 26 20:13:03 GMT 2024

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

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

Back to the top