// ------------
private XTitle setTitle( XTitled xTitleParent, String aTitle, String aId )
{
XTitle xTitle = null;
if( xTitleParent != null )
try
{
XMultiServiceFactory xFact = (XMultiServiceFactory)param.getMSF();
XMultiComponentFactory xCompFact = (XMultiComponentFactory) UnoRuntime.queryInterface(
XMultiComponentFactory.class, xFact );
XFormattedString[] aStrings = new XFormattedString[ 2 ];
aStrings[0] = (XFormattedString) UnoRuntime.queryInterface(
XFormattedString.class,
xFact.createInstance(
"com.sun.star.chart2.FormattedString" ));
aStrings[1] = (XFormattedString) UnoRuntime.queryInterface(
XFormattedString.class,
xFact.createInstance(
"com.sun.star.chart2.FormattedString" ));
aStrings[0].setString( aTitle );
aStrings[1].setString( " Title" );
Hashtable aParams = new Hashtable();
aParams.put( "Identifier", aId );
xTitle = (XTitle) UnoRuntime.queryInterface(
XTitle.class,
xCompFact.createInstanceWithContext(
"com.sun.star.chart2.Title",
new ComponentContext( aParams, getComponentContext( xFact ) )));
xTitle.setText( aStrings );
XPropertySet xTitleProp = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, xTitle );
xTitleProp.setPropertyValue( "FillColor", new Integer( 0xfff8dc )); // cornsilk1
xTitleParent.setTitle( xTitle );
}