cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Krystian Nowak <>
Subject Cocoon-POI question
Date Thu, 16 Dec 2004 15:15:25 GMT
Hi There!

I saw Victor's modification to Cocoon-POI:
relased in Cocoon 2.1.6

Can you tell me what is the level of activity of block POI right now?
(commits or functional points per month ;)). I am interested in
gmr:Style's Orient attibute ("The text orientation" - accoring to which defaults to "1".
It is a kind of weird attribute:

1) There is a class that represents the attribute:
having following methods:

public boolean isHoriz()
public boolean isVertHorizText()
public boolean isVertVertText()
public boolean isVertVertText2()

2) It is used by:

having methods calling representants in StyleOrientation:
public boolean isStyleOrientationHoriz() throws IOException
         return getStyleOrientation().isHoriz();

public boolean isStyleOrientationVertHorizText() throws IOException
         return getStyleOrientation().isVertHorizText();

public boolean isStyleOrientationVertVertText() throws IOException
         return getStyleOrientation().isVertVertText();

public boolean isStyleOrientationVertVertText2() throws IOException 	{
        return getStyleOrientation().isVertVertText2();

3) It could have been used on org.apache.poi.hssf.usermodel.HSSFCellStyle
calling its setRotation(short rotation) method

4) BUT no one calls those methods!!!

So what the !@?%^*# is going on?

Recent Gnumeric still seems not to implement text rotation:

and it was a problem since a while:

so I couldn't find good explanation for "Orient" attibute values.
Also the only value written by Gnumeric in Orient attribute is of course
"1", since there is no option in Gnumeric's menu to rotate cell's text.

According to

class it seems to be a 4-bit number:

"Style orientation is written as an integer, and each bit in the
integer specifies a particular boolean attribute. This class deals
with all that information in an easily digested form"

So there are the bits:
0-bit is horiz - default value ( == 1 )
1-bit is vert_horiz_text
2-bit is vert_vert_text
3-bit is vert_vert_text2

What do the three upper bits mean?

Those bits are also mentioned in
     <xsd:simpleType name="style_orientation">
         <xsd:restriction base="xsd:integer">
             <!-- this is a bit map as follows:
                  1 = HORIZ
                  2 = VERT_HORIZ_TEXT
                  4 = VERT_VERT_TEXT
                  8 = VERT_VERT_TEXT2
             <xsd:minInclusive value="0"/>
             <xsd:maxInclusive value="15"/>

I guess that to set cell text orientation/rotation there is enough to
code it like that:

public abstract class EPStyle
     public void initialize(Attribute[] attributes, ElementProcessor parent)
         throws IOException
         super.initialize(attributes, parent);

         EPStyleRegion sregion = (EPStyleRegion)parent;

         if (sregion.isValid()) {
             HSSFCellStyle style = sregion.getStyle();

             boolean horiz = isStyleOrientationHoriz();
             boolean vert_horiz_text = isStyleOrientationVertHorizText();
             boolean vert_vert_text = isStyleOrientationVertVertText();
             boolean vert_vert_text2 = isStyleOrientationVertVertText2();

             short rotation = magicallMetodCreatingRotationValue(
                     horiz, vert_horiz_text, vert_vert_text,

     public abstract short magicallMetodCreatingRotationValue(
         boolean horiz, boolean vert_horiz_text, boolean vert_vert_text,
         boolean vert_vert_text2);

But I need to know how to write magicallMetodCreatingRotationValue!!!
Do you know what can help me?

BTW - what is repository
points to? There are no blocks - especially my beloved poi one ;)


Krystian Nowak
Poznan Supercomputing and Networking Center
Poland, 60-814 Poznan, Zwierzyniecka 20
tel. (+48 61) 8582164 fax. (+48 61) 8582151
BlueEyes - Human-Operator Monitoring System

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message