21.08.2013 Views

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The Structure of Drawings 170<br />

com.sun.star.style.ParagraphProperties<br />

)<br />

Shadow properties<br />

com.sun.star.drawing.ShadowProperties<br />

The following example creates and formats a line with the help of the named properties.<br />

The origin of the line is specified in the Location property, whereas the coordinates listed in<br />

the Size property specify the end point of the line.<br />

Dim Doc As Object<br />

Dim Page As Object<br />

Dim LineShape As Object<br />

Dim Point As New com.sun.star.awt.Point<br />

Dim Size As New com.sun.star.awt.Size<br />

Point.x = 1000<br />

Point.y = 1000<br />

Size.Width = 10000<br />

Size.Height = 10000<br />

Doc = StarDesktop.CurrentComponent<br />

Page = Doc.drawPages(0)<br />

LineShape = Doc.createInstance("com.sun.star.drawing.LineShape")<br />

LineShape.Size = Size<br />

LineShape.Position = Point<br />

Page.add(LineShape)<br />

Polypolygon Shapes<br />

<strong>OpenOffice</strong>.<strong>org</strong> also supports complex polygonal shapes through the<br />

com.sun.star.drawing.PolyPolygonShape<br />

service. Strictly speaking, a PolyPolygon is not a simple polygon but a multiple polygon.<br />

Several independent lists containing corner points can therefore be specified and combined<br />

to form a complete object.<br />

As with rectangle shapes, all the formatting properties of drawing objects are also provided<br />

for polypolygons:<br />

Fill properties<br />

com.sun.star.drawing.FillProperties<br />

Line properties

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!