Difference between revisions of "Documentation/DevGuide/Drawings/Ordering"
From Apache OpenOffice Wiki
< Documentation | DevGuide
OOoWikiBot (Talk | contribs) m (Robot: Changing Category:Drawing Documents and Presentation Documents) |
OOoWikiBot (Talk | contribs) m (FINAL VERSION FOR L10N) |
||
Line 7: | Line 7: | ||
|NextPage=Documentation/DevGuide/Drawings/Grouping, Combining and Binding | |NextPage=Documentation/DevGuide/Drawings/Grouping, Combining and Binding | ||
}} | }} | ||
− | {{DISPLAYTITLE:Ordering}} | + | {{Documentation/DevGuideLanguages|Documentation/DevGuide/Drawings/{{SUBPAGENAME}}}} |
+ | {{DISPLAYTITLE:Ordering}} | ||
The property <code>ZOrder</code> of the <idl>com.sun.star.drawing.Shape</idl> service defines the order a shape is drawn. That is, if there are many shapes on a page, the shape that has the lowest <code>ZOrder</code> value is drawn first, and the shape that has the highest <code>ZOrder</code> is drawn last. By using this property it is possible to bring an object to the back or front of a page. It is also possible to switch the order of two shapes as demonstrated in the following example: | The property <code>ZOrder</code> of the <idl>com.sun.star.drawing.Shape</idl> service defines the order a shape is drawn. That is, if there are many shapes on a page, the shape that has the lowest <code>ZOrder</code> value is drawn first, and the shape that has the highest <code>ZOrder</code> is drawn last. By using this property it is possible to bring an object to the back or front of a page. It is also possible to switch the order of two shapes as demonstrated in the following example: | ||
<!--[SOURCE:Drawing/ChangeOrderDemo.java]--> | <!--[SOURCE:Drawing/ChangeOrderDemo.java]--> |
Revision as of 12:14, 15 May 2009
The property ZOrder
of the com.sun.star.drawing.Shape service defines the order a shape is drawn. That is, if there are many shapes on a page, the shape that has the lowest ZOrder
value is drawn first, and the shape that has the highest ZOrder
is drawn last. By using this property it is possible to bring an object to the back or front of a page. It is also possible to switch the order of two shapes as demonstrated in the following example:
XPropertySet xPropSet1 = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xShape1); XPropertySet xPropSet2 = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xShape2); // get current positions int nOrderOfShape1 = ((Integer)xPropSet1.getPropertyValue("ZOrder")).intValue(); int nOrderOfShape2 = ((Integer)xPropSet2.getPropertyValue("ZOrder")).intValue(); // set new positions xPropSet1.setPropertyValue("ZOrder", new Integer(nOrderOfShape2)); xPropSet2.setPropertyValue("ZOrder", new Integer(nOrderOfShape1));
Content on this page is licensed under the Public Documentation License (PDL). |