OOoRunner test harness

util
Class DrawTools

java.lang.Object
  |
  +--util.DrawTools

public class DrawTools
extends Object

contains helper methods for draw documents


Constructor Summary
DrawTools()
           
 
Method Summary
 void addShape(XComponent oDoc, int height, int width, int x, int y, String kind)
          creates a XShape and adds it to the documents first drawpage
static XComponent createDrawDoc(XMultiServiceFactory xMSF)
          Opens a new draw document with arguments
 XShape createShape(XComponent oDoc, int height, int width, int x, int y, String kind)
          creates a XShape
static XDrawPage getDrawPage(XComponent aDoc, int nr)
          gets the specified XDrawPage of a draw document
static XDrawPages getDrawPages(XComponent aDoc)
          gets the XDrawPages container of a draw document
static XShapes getShapes(XDrawPage oDP)
          gets the XShapes container of a draw page
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawTools

public DrawTools()
Method Detail

createDrawDoc

public static XComponent createDrawDoc(XMultiServiceFactory xMSF)
Opens a new draw document with arguments
Parameters:
xMSF - the MultiServiceFactory
Returns:
the XComponent Interface of the document

getDrawPages

public static XDrawPages getDrawPages(XComponent aDoc)
gets the XDrawPages container of a draw document
Parameters:
aDoc - the draw document
Returns:
the XDrawpages container of the document

getDrawPage

public static XDrawPage getDrawPage(XComponent aDoc,
                                    int nr)
gets the specified XDrawPage of a draw document
Parameters:
aDoc - the draw document
nr - the index of the DrawPage
Returns:
the XDrawpage with index nr of the document

getShapes

public static XShapes getShapes(XDrawPage oDP)
gets the XShapes container of a draw page
Parameters:
oDP - the draw page
Returns:
the XDrawShape container of the drawpage

createShape

public XShape createShape(XComponent oDoc,
                          int height,
                          int width,
                          int x,
                          int y,
                          String kind)
creates a XShape
Parameters:
oDoc - the document
height - the height of the shape
width - the width of the shape
x - the x-position of the shape
y - the y-position of the shape
kind - the kind of the shape ('Ellipse', 'Line' or 'Rectangle')
Returns:
the created XShape

addShape

public void addShape(XComponent oDoc,
                     int height,
                     int width,
                     int x,
                     int y,
                     String kind)
creates a XShape and adds it to the documents first drawpage
Parameters:
oDoc - the document
height - the height of the shape
width - the width of the shape
x - the x-position of the shape
y - the y-position of the shape
kind - the kind of the shape ('Ellipse', 'Line' or 'Rectangle')
Returns:
the created XShape

OOoRunner test harness