Size of a component?

Hi,

how can i find out of a size of a component without using any vaadin addons?

When I tried via component.getWidth(). I get 100.0, I think this means for 100%.

So how to get it?

Thanks for help.

best regards,

p.walzer

That’s an interesting requirement. I guess you could always write yourself a client side widget or extension to report this.

Just out of curiosity, where do you need the width of a component?

I implement a diagram editor in eclipse with gef. this diagram should be transform to vaadin ui via button clicked. So I use Vaadin as a preview part. Maybe later it should generated full web application.

Now for the preview part e.g. I have a lot of rectangles and in the rectangles there are a lot of rectangles. For each one I want to preview it in Vaadin Fullscreen mode. I calculate the behavior of the big rect and small rect and want to get the factor for previewing it with this behavior factor.I calculate the width of the contained rectangle with this factor.

so the small rect width for vaadin full mode is:

gefWidthFactor = bigRect.width / smallRect.width
smallRectWidth= vaadin-fullscreen-Width / gefFactor

Hope it isn’t so complicated explained.

Thanks for helping.

Best regards,

p.walzer

Sorry I really don’t know anything about the GEF so I don’t really know how I can help here. You should still be able to use custom add-ons in the project - they are just the same as normal vaadin widgets.

Hi Jens Jansson,

my issue is, I reuse the vaadin visual editor plug-in. That means, when I tried to add Vaadin-Add-Ons, I have to compile the widgetsets.

The compiled files will generate in the folder

project
L-- WebContent
L-- VAADIN
L-- widgetsets

But for the plug-in I have to use it in

project
L-- VAADIN

I tried to copy the compiled files into the project–VAADIN folder, but at runtime of this application, the add-on can’t not resolved.

What is to do, if I want to add a Vaadin-Add-On to your Vaadin Visual-Editor?

Thanks alot,

best reagrds

p.walzer

hi Jens Jansson,

can u tell which addon I have to use, to find out the real size of a component?
when the size is setting programmatically and not via css?

There are Resizer-Addon but this only works with Vaadin 7.

And CSSTools is for getting the size in the css.

Thanks alot,

cheers,

p.walzer

SizeReporter is another one, but that is also for Vaadin 7. You can build your own if you really have to use Vaadin 6. In SizeReporter, the relevant piece of code is
this

About add-ons not being solved, have you taken the
widgetset into use in your web.xml
? (Code example in the middle of the page.)

I don’t think that you can visually use add-ons with the visual editor. You have to place them in code.

Excuse me, but how can I built this for Vaadin 6.8.5 Version. I look into the *.iml file, there are a lot of dependencies that aren’t in the visual editor. Should I copied this into this project?

cheers,

p.walzer