OpenOffice.org BASIC Guide - OpenOffice.org wiki
OpenOffice.org BASIC Guide - OpenOffice.org wiki
OpenOffice.org BASIC Guide - OpenOffice.org wiki
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
The Structure of Drawings<br />
com.sun.star.drawing.CircleKind.SECTION<br />
circle slice<br />
com.sun.star.drawing.CircleKind.ARC<br />
angle (not including circle line)<br />
The following example creates a circular slice with a 70 degree angle (produced from difference between start<br />
angle of 20 degrees and end angle of 90 degrees)<br />
Dim Doc As Object<br />
Dim Page As Object<br />
Dim EllipseShape 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 = ThisComponent<br />
Page = Doc.DrawPages(0)<br />
EllipseShape = Doc.createInstance("com.sun.star.drawing.EllipseShape")<br />
EllipseShape.Size = Size<br />
EllipseShape.Position = Point<br />
EllipseShape.CircleStartAngle = 2000<br />
EllipseShape.CircleEndAngle = 9000<br />
EllipseShape.CircleKind = com.sun.star.drawing.CircleKind.SECTION<br />
Page.add(EllipseShape)<br />
Lines<br />
<strong>OpenOffice</strong>.<strong>org</strong> provides the com.sun.star.drawing.LineShape service for line objects. Line objects support all of<br />
the general formatting services with the exception of areas. The following are all of the properties that are<br />
associated with the LineShape service:<br />
Line properties<br />
com.sun.star.drawing.LineProperties<br />
Text properties<br />
com.sun.star.drawing.Text (with com.sun.star.style.CharacterProperties and<br />
com.sun.star.style.ParagraphProperties)<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. The origin of the line is<br />
specified in the Location property, whereas the coordinates listed in the Size property specify the end point of<br />
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 = ThisComponent<br />
Page = Doc.DrawPages(0)<br />
LineShape = Doc.createInstance("com.sun.star.drawing.LineShape")<br />
LineShape.Size = Size<br />
LineShape.Position = Point<br />
122 <strong>OpenOffice</strong>.<strong>org</strong> 3.2 <strong>BASIC</strong> <strong>Guide</strong> · March 2010