pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Bartlett <cbartlet...@gmail.com>
Subject Re: TablePane
Date Wed, 08 Dec 2010 07:57:06 GMT
Jamal,

It sounds like you are referring to this tutorial, but if not, have a look
at it and play around with the applet at the bottom of the page.  It will
probably be easier if you set the following values.  Horizontal spacing = 0,

http://pivot.apache.org/tutorials/table-panes.html


There is some special syntax that can be used when you are setting the width
of a TablePane.Column or the height of a TablePane.Row.


Specifying the column width or row height as -1, means that the column will
be as wide as the widest component in that column, or a row would be as tall
as the tallest component in that row.  This is referred to as the 'default'
size.


If you just specify a number that is > -1, that number will be the width in
pixels for a column, or the height in pixels for a row.  In the tutorial
above, the second column is set to a width of 50 pixels, and the second row
is set to a height of 50 pixels.

This is referred to as an 'absolute' width/height and is used when you want
complete control over the size of a column or row.

You can also specify 'relative' sizes by using the n* syntax. It is probably
easiest to explain with a simple example, so imagine you have a TablePane
with a width of 100 and a height of 100.
- If it has a single column with width of 1*, that column will be 100 pixels
wide.
- If the table had two columns, both with widths of 1* and 1*, the two
columns would each be 50 pixels wide.
- If the table has 3 columns whose sizes are set to '25', '1*' & '2*, the
first column will be 25 pixels wide (using absolute sizing mentioned above).
The 2nd column would also be 25 pixels wide, but the 3rd column would be 50
pixels wide.

Relative sizings allocate the remaining available width/height in a
TablePane proportionally.
In the example above, the first column will always be 25 pixels wide, so
that leaves 75 pixels available for the other 2 columns.  One column
specifies a width of 1*, while the other is 2*.  This means that the 2*
column will be twice as wide as the 1* column.
1* = 25 = ((75 / (1 + 2)) * 1)
2* = 50 = ((75 / (1 + 2)) * 2)

However if the 2 columns had widths of '1*' and '4*', the first would be 15
pixels wide and the second would be 60 pixels wide.
1* = 15 = ((75 / (1 + 4)) * 1)
4* = 60 = ((75 / (1 + 4)) * 4)

Chris

On 8 December 2010 10:51, Jamal BERRICH <jberrich@gmail.com> wrote:

> Hello,
>         I don't undesting what is meaning 50, -1, 1* and 2* in the
> TablePane.
> thinks,
> Jamal
>

Mime
View raw message