XWindowPeer the_win = null;
XToolkit the_kit = null;
XDevice aDevice = null;
XGraphics aGraphic = null;
XControl butControl = null;
XControl butControl1 = null;
XControl butControl2 = null;
XTabController tabControl1 = null;
XTabController tabControl2 = null;
XControlContainer ctrlCont = null;
if (xWinDlg != null) {
xWinDlg.dispose();
}
try {
dlgModel = (XControlModel) UnoRuntime.queryInterface(
XControlModel.class,
xMSF.createInstance(
"com.sun.star.awt.UnoControlDialogModel"));
XControl dlgControl = (XControl) UnoRuntime.queryInterface(
XControl.class,
xMSF.createInstance(
"com.sun.star.awt.UnoControlDialog"));
dlgControl.setModel(dlgModel);
XControlModel butModel = (XControlModel) UnoRuntime.queryInterface(
XControlModel.class,
xMSF.createInstance(
"com.sun.star.awt.UnoControlButtonModel"));
butControl = (XControl) UnoRuntime.queryInterface(XControl.class,
xMSF.createInstance(
"com.sun.star.awt.UnoControlButton"));
butControl.setModel(butModel);
// creating additional controls for XUnoControlContainer
tabControl1 = (XTabController) UnoRuntime.queryInterface(
XTabController.class,
xMSF.createInstance(
"com.sun.star.awt.TabController"));
tabControl2 = (XTabController) UnoRuntime.queryInterface(
XTabController.class,
xMSF.createInstance(
"com.sun.star.awt.TabController"));
// creating additional controls for XControlContainer
butModel = (XControlModel) UnoRuntime.queryInterface(
XControlModel.class,
xMSF.createInstance(
"com.sun.star.awt.UnoControlButtonModel"));
butControl1 = (XControl) UnoRuntime.queryInterface(XControl.class,
xMSF.createInstance(
"com.sun.star.awt.UnoControlButton"));
butControl1.setModel(butModel);
butModel = (XControlModel) UnoRuntime.queryInterface(
XControlModel.class,
xMSF.createInstance(
"com.sun.star.awt.UnoControlButtonModel"));
butControl2 = (XControl) UnoRuntime.queryInterface(XControl.class,
xMSF.createInstance(
"com.sun.star.awt.UnoControlButton"));
butControl2.setModel(butModel);
ctrlCont = (XControlContainer) UnoRuntime.queryInterface(
XControlContainer.class, dlgControl);
xWinDlg = (XWindow) UnoRuntime.queryInterface(XWindow.class,
dlgControl);
xWinDlg.setVisible(true);
xWinDlg.setPosSize(10, 10, 220, 110, PosSize.SIZE);
the_win = dlgControl.getPeer();
the_kit = the_win.getToolkit();
aDevice = the_kit.createScreenCompatibleDevice(220, 220);
aGraphic = aDevice.createGraphics();
oObj = dlgControl;