Difference between revisions of "Documentation/DevGuide/Drawings/Moving and Scaling"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (FINAL VERSION FOR L10N)
m
 
Line 10: Line 10:
 
  {{DISPLAYTITLE:Moving and Scaling}}
 
  {{DISPLAYTITLE:Moving and Scaling}}
 
Moving and scaling of a shape can be done by using the corresponding methods <code>getPosition()</code>, <code>setPosition()</code>, <code>getSize()</code> and <code>setSize()</code> of the <idl>com.sun.star.drawing.XShape</idl> interface:
 
Moving and scaling of a shape can be done by using the corresponding methods <code>getPosition()</code>, <code>setPosition()</code>, <code>getSize()</code> and <code>setSize()</code> of the <idl>com.sun.star.drawing.XShape</idl> interface:
 
+
<syntaxhighlight lang="java">
 
   string getShapeType()
 
   string getShapeType()
 
   com::sun::star::awt::Point getPosition()
 
   com::sun::star::awt::Point getPosition()
 
   void setPosition( [in] com::sun::star::awt::Point aPosition)
 
   void setPosition( [in] com::sun::star::awt::Point aPosition)
 
   com::sun::star::awt::Size getSize()
 
   com::sun::star::awt::Size getSize()
   void setSize( [in] com::sun::star::awt::Size aSize)
+
   void setSize( [in] com::sun::star::awt::Size aSize)</syntaxhighlight>
  
 
<code>Point</code> and <code>Size</code> are IDL structs. In Java, these structs are mapped to classes with constructors that take values for the struct members. Therefore, when new is used to instantiate these classes, the coordinates and dimensions are passed to initialize the class members X, Y, Width and Height.
 
<code>Point</code> and <code>Size</code> are IDL structs. In Java, these structs are mapped to classes with constructors that take values for the struct members. Therefore, when new is used to instantiate these classes, the coordinates and dimensions are passed to initialize the class members X, Y, Width and Height.

Latest revision as of 14:25, 20 December 2020



Moving and scaling of a shape can be done by using the corresponding methods getPosition(), setPosition(), getSize() and setSize() of the com.sun.star.drawing.XShape interface:

  string getShapeType()
  com::sun::star::awt::Point getPosition()
  void setPosition( [in] com::sun::star::awt::Point aPosition)
  com::sun::star::awt::Size getSize()
  void setSize( [in] com::sun::star::awt::Size aSize)

Point and Size are IDL structs. In Java, these structs are mapped to classes with constructors that take values for the struct members. Therefore, when new is used to instantiate these classes, the coordinates and dimensions are passed to initialize the class members X, Y, Width and Height.

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages