XDevice aDevice = null;
XGraphics aGraphic = null;
XControl aControl = null;
//Insert a ControlShape and get the ControlModel
XControlShape aShape = FormTools.createUnoControlShape(xTextDoc, 3000,
4500, 15000,
10000,
"DatabaseImageControl",
"UnoControlImageControl");
WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);
XControlModel the_Model = aShape.getControl();
XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, the_Model);
XControlShape aShape2 = FormTools.createControlShape(xTextDoc, 3000,
4500, 5000, 10000,
"TextField");
WriterTools.getDrawPage(xTextDoc).add((XShape) aShape2);
XControlModel the_Model2 = aShape2.getControl();
//Try to query XControlAccess
XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
XControlAccess.class,
xTextDoc.getCurrentController());