Hi,

Thanks for ur answer.

I verified the shape of the item in the diagramconfigurator, and it was 
already a roundedRectangle, so the problem does not seem to be there. I 
tried to change it to "Figure" or something else, but nothing different.

Also I checked the XXXFigure.java of my item, it is a roundedRectangle as 
well, like in the diagramconfigurator.

In my createEditPolicies() function I see nothing wrong I think:

        protected void createEditPolicies() {
                super.createEditPolicies();

                installEditPolicy(ModelerEditPolicyConstants.
RESTORE_EDITPOLICY,
                                new RestoreEditPolicy() {
                                        protected Command 
getRestoreConnectionsCommand(
 RestoreConnectionsRequest request) {
                                                return new 
ADLSystemModelRestoreConnectionCommand(
 getHost());
                                        }
                                });

                installEditPolicy(ModelerEditPolicyConstants.
RESIZABLE_EDITPOLICY,
                                new ResizableEditPolicy());

                installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE,
                                new LabelDirectEditPolicy());
        }

All is generated.
ADLSystemModel is the name of my item.

And when I set some breakpoints in this function, before the 
installEditPolicy(ModelerEditPolicyConstants.RESIZABLE_EDITPOLICY, new 
ResibleEditPolicy()), I get through all these without any caught error. 
And I cannot see clearly where the default size is set. The policy seems 
to be present, but maybe something appears to be strange in the policies 
array items:

policies        Object[18]  (id=127) 
        [0]     "DecorationPolicy" (id=129) 
        [1]     DecorationEditPolicy  (id=7948) 
        [2]     "Resizable EditPolicy" (id=7949) 
        [3]     NonResizableEditPolicy  (id=7950) 
        [4]     "ComponentEditPolicy" (id=7951) 
        [5]     RemovableComponentEditPolicy  (id=7952) 
        [6]     "Change Background Color EditPolicy" (id=7953) 
        [7]     ChangeBackgroundColorEditPolicy  (id=7954) 
        [8]     "Change Foreground Color EditPolicy" (id=7971) 
        [9]     ChangeForegroundColorEditPolicy  (id=7972) 
        [10]    "Change Font EditPolicy" (id=7973) 
        [11]    ChangeFontEditPolicy  (id=7974) 
        [12]    "Move Plans" (id=7975) 
        [13]    MovePlansEditPolicy  (id=7976) 
        [14]    "Delete Model Object EditPolicy" (id=7977) 
        [15]    DeleteModelObjectEditPolicy  (id=7978) 
        [16]    "Restore objects EditPolicy" (id=7979) 
        [17]    ADLSystemModelEditPart$1  (id=7980)

My Resizable EditPolicy is the item 2, but if we take the item 3 into 
account, it is designed as a NonResizableEditPolicy, whereas for the 
background and foreground colors, I get the same name for both the items 
6/7 and 8/9. It is very strange because I do not know how to configure 
this NonResizableEditPolicy, except from the CreateEditPolicies() 
function;  and another point is that in my CreateEditPolicies(), it calls 
a "new ResizableEditPolicy".


Clement Debret







[email protected] 
Envoyé par : [email protected]
02/04/2009 16:43
Veuillez répondre à
[email protected]


A
[email protected]
cc

Objet
Re: [Topcased-users] Cannot modifiy the default size of an item






Hi,

this can be due to your figure. It is maybe a square ?

I think you should have a look on your XXXFigure.java and on the policy 
set for the constant "ModelerEditPolicyConstants.RESIZABLE_EDITPOLICY" 
in the method createEditPolicies() of your XXXEditPart.java

This policy manages the resize.

With breakpoints you should be able to trace the dimension of your figure.

Regards,

Thibault

[email protected] a écrit :
> 
> Hi Thibault,
> 
> Thanks for your answer,
> 
> Yes I configured the minima and maxima of my node in the 
> diagramconfigurator.
> The configuration that I set was:
> 
> DefaultWidth : 150
> DefaultHeight : 100
> MinimumWidth : 20
> MinimumHeight : 20
> MaximumWidth : 200
> MaximumHeight : 200
> 
> LineWidth : 1
> LineStyle : SOLID
> 
> And the Resizing was set to ALL
> 
> With these parameters, technically there cannot be a problem to get a 
> 150 by 100 rectangle while I just click on the diagram to generate the 
> default sized shape. But what I get is always a 100 by 100 square box, 
> no matter the DefaultWidth or DefaultHeight are. And I verified the 
> graphconf, in case it was not overwritten, but it is,
> I can retrieve my 150 by 100 parameters for the shape.
> 
> so I do not get it. Where are these 100 by 100 parameters coming from ?
> 
> Clement Debret
> 
> 
> 
> 
> 
> *[email protected]*
> Envoyé par : [email protected]
> 
> 02/04/2009 11:33
> Veuillez répondre à
> [email protected]
> 
> 
> 
> A
>                [email protected]
> cc
> 
> Objet
>                Re: [Topcased-users] Cannot modifiy the default size of 
an item
> 
> 
> 
> 
> 
> 
> 
> 
> Hi Clément,
> 
> on your diagramconfigurator, have you well defined the minimal
> size/height, default size/height and maximum size/height of your node ?
> You should have something like this :
> 
> Minimum Height                 -1
> Minimum Width                 -1
> 
> Default Height                 40
> Default Width                 130
> 
> Maximum Height                 0
> Maximum Width                 0
> 
> 
> Also have you in the tab Policies of your node in the
> diagramconfigurator set the resizing to the value "ALL" ?
> 
> You can find more informations here on how to configure your
> diagramconfigurator :
> 
http://topcased-mm.gforge.enseeiht.fr/website/modeling/tutorials/generateEditor.html

> 
> 
> Best Regards,
> 
> Thibault
> 
> [email protected] a écrit :
>  >
>  > Hi everyone,
>  >
>  > I am a little bit disappointed, I cannot succeed in changing the 
default
>  > size of my items in a diagram, while adding them.
>  >
>  > I am developping a plugin with separate projects. i created the
>  > editorconfigurator and a first diagramconfigurator, with only a 
single
>  > item for tests purpose.
>  >
>  > I managed to generate the new plug in, and created a new diagram to 
test
>  > it. Everything worked well, except from the default size of the 
shapes,
>  > which was 100x100.
>  >
>  > So I tried to change some parameters to test them : background color,
>  > foreground color, font, line width... and size (both width and 
height)
>  > to change this not-so-beautiful square shaped box, and give them a 
more
>  > rectangular look.
>  >
>  > I regenerated the plug in, and while testing it again, I were 
surprised
>  > not to get the resized parameters working. The background/foreground
>  > color and font were different, but neither the size nor the line 
width
>  > changed.
>  >
>  > I verified the .graphconf file, and the values are correctly written.
>  > I noticed that there is a preferences package that configure the 
default
>  > Background / foreground / font values, but nothing for the size.
>  > In an old project, I was able to change the size directly from the
>  > .graphconf file (even it is not recommended), but as i tried to 
modify
>  > directly the .graphconf values of my new project, nothing changed.
>  >
>  > I maybe get something wrong, like a function that refreshs with 
default
>  > values, but I did not see any of these things, and with quite the 
same
>  > code, the old project allows to change the size. there is maybe some
>  > code that I missed.
>  >
>  >
>  > Sincerely,
>  >
>  > Clement Debret
>  >
>  >
>  >
>  >
>  > 
------------------------------------------------------------------------
>  >
>  > _______________________________________________
>  > Topcased-users mailing list
>  > [email protected]
>  > http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users
> _______________________________________________
> Topcased-users mailing list
> [email protected]
> http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Topcased-users mailing list
> [email protected]
> http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users
_______________________________________________
Topcased-users mailing list
[email protected]
http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users

Attachment: thibault.landre.vcf
Description: Binary data

_______________________________________________
Topcased-users mailing list
[email protected]
http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users

Reply via email to