You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Garcia Jeremie <je...@sopragroup.com> on 2007/10/10 16:40:57 UTC

HSLF - Pb Adding text to a shape (chevron)

Hi user list,
 
I am having a problem performing my powerpoint with hslf,
I would like to add a text into a chevron AutoShape.
I tried several things without success.
 
Does someone can help me ? Any sample code is welcome..
 
I also have a minor second issue : how to add 3D effect to the shape?
 
 thanks for any suggestion.
 
 
/*--------------------------------------------------------------------------------------------------*/
SlideShow powerPointFile = new SlideShow();

Slide slide = powerPointFile.createSlide();

// draw chevron with text

AutoShape sh2 = new AutoShape(ShapeTypes.Chevron);

sh2.setAnchor(new java.awt.Rectangle(60, 350, 90, 70));

// modify the chevron geometry

EscherOptRecord opt = (EscherOptRecord)Shape.getEscherChild(sh2.getSpContainer(), EscherOptRecord.RECORD_ID);

opt.addEscherProperty(new EscherSimpleProperty(EscherProperties.GEOMETRY__ADJUSTVALUE, 19000) ); 

opt.sortProperties();

//modify shape parameters

sh2.setLineWidth(2.0);

sh2.setFillColor(Color.white);

// ============>>>>>> ADD TEXT

slide.addShape(sh2);

 


RE: HSLF - Pb Adding text to a shape (chevron)

Posted by Garcia Jeremie <je...@sopragroup.com>.
Ok thanks, 

by the way, I made a little program to be able to read what is 
the achitecture of a such shape, and I saw something dealing with
EscherTextboxRecord
and some options (128:TEXT_TEXT_ID) but I didn't achived to reproduce
it.
So...
Thanks to let me now about any possibility, I will use a shapegroup for
the moment 
to group the shape and the textbox...

greetings



-----Message d'origine-----
De : Yegor Kozlov [mailto:yegor@dinom.ru]
Envoye : jeudi 11 octobre 2007 18:44
A : POI Users List
Objet : Re: HSLF - Pb Adding text to a shape (chevron)


Hi,

Adding text to autoshapes is not yet supported. You only can add text
to the TextBox shape. In theory it should be simple to extend
AutoShape this way. I will investigate when I have time.

Regards,
Yegor

> Hi user list,
>  
> I am having a problem performing my powerpoint with hslf,
> I would like to add a text into a chevron AutoShape.
> I tried several things without success.
>  
> Does someone can help me ? Any sample code is welcome..
>  
> I also have a minor second issue : how to add 3D effect to the shape?
>  
>  thanks for any suggestion.
>  
>  
>
/*----------------------------------------------------------------------
----------------------------*/
> SlideShow powerPointFile = new SlideShow();

> Slide slide = powerPointFile.createSlide();

> // draw chevron with text

> AutoShape sh2 = new AutoShape(ShapeTypes.Chevron);

> sh2.setAnchor(new java.awt.Rectangle(60, 350, 90, 70));

> // modify the chevron geometry

> EscherOptRecord opt =
> (EscherOptRecord)Shape.getEscherChild(sh2.getSpContainer(),
EscherOptRecord.RECORD_ID);

> opt.addEscherProperty(new
> EscherSimpleProperty(EscherProperties.GEOMETRY__ADJUSTVALUE, 19000) );

> opt.sortProperties();

> //modify shape parameters

> sh2.setLineWidth(2.0);

> sh2.setFillColor(Color.white);

// ============>>>>>>> ADD TEXT

> slide.addShape(sh2);

>  



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: HSLF - Pb Adding text to a shape (chevron)

Posted by Yegor Kozlov <ye...@dinom.ru>.
Hi,

Adding text to autoshapes is not yet supported. You only can add text
to the TextBox shape. In theory it should be simple to extend
AutoShape this way. I will investigate when I have time.

Regards,
Yegor

> Hi user list,
>  
> I am having a problem performing my powerpoint with hslf,
> I would like to add a text into a chevron AutoShape.
> I tried several things without success.
>  
> Does someone can help me ? Any sample code is welcome..
>  
> I also have a minor second issue : how to add 3D effect to the shape?
>  
>  thanks for any suggestion.
>  
>  
> /*--------------------------------------------------------------------------------------------------*/
> SlideShow powerPointFile = new SlideShow();

> Slide slide = powerPointFile.createSlide();

> // draw chevron with text

> AutoShape sh2 = new AutoShape(ShapeTypes.Chevron);

> sh2.setAnchor(new java.awt.Rectangle(60, 350, 90, 70));

> // modify the chevron geometry

> EscherOptRecord opt =
> (EscherOptRecord)Shape.getEscherChild(sh2.getSpContainer(), EscherOptRecord.RECORD_ID);

> opt.addEscherProperty(new
> EscherSimpleProperty(EscherProperties.GEOMETRY__ADJUSTVALUE, 19000) );

> opt.sortProperties();

> //modify shape parameters

> sh2.setLineWidth(2.0);

> sh2.setFillColor(Color.white);

// ============>>>>>>> ADD TEXT

> slide.addShape(sh2);

>  



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org