| FlowLayout questions [message #247127] |
Thu, 05 February 2009 03:01  |
Sebastian Bota Messages: 8 Registered: July 2009 |
Junior Member |
|
|
Hello every one. I have a nice graphical editor used to edit C/c++ source
code in a nassy schniderman diagram way. ok, my problem is as follows.
i will try to draw a simple scenario and explain what my problems are:
supose we have :
+----------------------------+
| label here |
|if i enter a long label here|
|----------+-----------------|
| | |
| | | <= this wont resize
| | |
+----------+-----------------+
I hope you understand what i mean. So all children from the same level
will be resized but inner children of another figure wont be resized. Why
?
Can anyone help me please on this issue ?
Thank you very much.
|
|
|
|
| Re: FlowLayout questions [message #247140 is a reply to message #247127] |
Thu, 05 February 2009 04:06   |
|
Originally posted by: lifesting.gmail.com
Sebastian Bota wrote:
> Hello every one. I have a nice graphical editor used to edit C/c++
> source code in a nassy schniderman diagram way. ok, my problem is as
> follows.
> i will try to draw a simple scenario and explain what my problems are:
>
> supose we have :
>
> +----------------------------+
> | label here | |if i enter a long label here|
> |----------+-----------------|
> | | | | | | <= this wont resize
> | | |
> +----------+-----------------+
> I hope you understand what i mean. So all children from the same level
> will be resized but inner children of another figure wont be resized.
> Why ?
> Can anyone help me please on this issue ?
> Thank you very much.
>
Hi, Sebastian.
Every Figure(label is derived from Figure) can register FigureListener
to notify other figure(here, your if/else part) that its bound has been
changed. Code demo:
class WholeEditPart
{
Figure labelFigure;
Figure ifelseFigure;
public FigureListener resize = new FigureListener()
{
pubic void figureMoved(Figure label)
{
resizeIfElsePart(label.getBounds());
}
}
private resizeIfElsePart(Rectangle r)
{
..... resize here
}
protected void createFigure()
{
labelFigure = ...;
ifelseFigure = ...;
labelFigure.addFigurListener(resize);
}
protected void deactivate()
{
labelFigure.removeListener(resize);
}
}
|
|
|
|
| Re: FlowLayout questions [message #247164 is a reply to message #247145] |
Fri, 06 February 2009 03:00  |
Sebastian Bota Messages: 8 Registered: July 2009 |
Junior Member |
|
|
Hello i have tryed your ideea but i does not work. I forgot to mention that
i use flow layout ..
Mabye this helps ....
"Sebastian Bota" <sebastian.bota@hotmail.com> wrote in message
news:gmebj5$mq7$1@build.eclipse.org...
> Thank you i will try this and come back to you.
>
> "David BY Chan" <lifesting@gmail.com> wrote in message
> news:gmea62$5ce$1@build.eclipse.org...
>> Sebastian Bota wrote:
>>> Hello every one. I have a nice graphical editor used to edit C/c++
>>> source code in a nassy schniderman diagram way. ok, my problem is as
>>> follows.
>>> i will try to draw a simple scenario and explain what my problems are:
>>>
>>> supose we have :
>>>
>>> +----------------------------+
>>> | label here | |if i enter a long label here|
>>> |----------+-----------------|
>>> | | | | | | <= this wont resize
>>> | | |
>>> +----------+-----------------+
>>> I hope you understand what i mean. So all children from the same level
>>> will be resized but inner children of another figure wont be resized.
>>> Why ?
>>> Can anyone help me please on this issue ?
>>> Thank you very much.
>>>
>> Hi, Sebastian.
>>
>> Every Figure(label is derived from Figure) can register FigureListener to
>> notify other figure(here, your if/else part) that its bound has been
>> changed. Code demo:
>>
>> class WholeEditPart
>> {
>> Figure labelFigure;
>> Figure ifelseFigure;
>>
>> public FigureListener resize = new FigureListener()
>> {
>> pubic void figureMoved(Figure label)
>> {
>> resizeIfElsePart(label.getBounds());
>> }
>> }
>> private resizeIfElsePart(Rectangle r)
>> {
>> ..... resize here
>> }
>> protected void createFigure()
>> {
>> labelFigure = ...;
>> ifelseFigure = ...;
>> labelFigure.addFigurListener(resize);
>> }
>> protected void deactivate()
>> {
>> labelFigure.removeListener(resize);
>> }
>> }
>
|
|
|
Powered by
FUDForum. Page generated in 0.02438 seconds