/* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
/** * Creating a TestEnvironment for the interfaces to be tested. * Retrieves a collection of spreadsheets from a document * and takes one of them. Inserts some values into the cells of the same cell * range address. Adds and retrieves the chart that using the data from * the cells of this cell range address. Obtains the chart document which is * embedded into the retrieved chart using the interface * <code>XEmbeddedObjectSupplier</code>. Retrieves the diagram from * the obtained chart document. The retrieved diagram is the instance of * the service <code>com.sun.star.chart.Diagram</code>. * Obtains the data source of the chart from the chart document. * Creates a stock-diagram, a bar-diagram, a XY-diagram and line-diagram * that are the instances of the following services: * <ul> * <li> <code>com.sun.star.chart.StockDiagram</code> </li> * <li> <code>com.sun.star.chart.BarDiagram</code> </li> * <li> <code>com.sun.star.chart.LineDiagram</code> </li> * <li> <code>com.sun.star.chart.StackableDiagram</code> </li> * </ul>. * Object relations created : * <ul> * <li> <code>'CHARTDOC'</code> for * {@link ifc.chart._Dim3DDiagram}, {@link ifc.chart._StockDiagram}, * {@link ifc.chart._ChartAxisZSupplier}, {@link ifc.chart._LineDiagram}, * {@link ifc.chart._BarDiagram}, {@link ifc.chart._Diagram}, * {@link ifc.chart._ChartTwoAxisYSupplier}, * {@link ifc.chart._StackableDiagram}, {@link ifc.chart._Diagram}, * {@link ifc.chart._ChartAxisYSupplier}, * {@link ifc.chart._ChartTwoAxisXSupplier}, * {@link ifc.chart._ChartStatistics} (the obtained chart document)</li> * <li> <code>'ROWAMOUNT', 'COLAMOUNT'</code> for * {@link ifc.chart._XDiagram}(the number of chart columns and * the number of chart rows) </li> * <li> <code>'STOCK'</code> for * {@link ifc.chart._StockDiagram}(the created stock-diagram) </li> * <li> <code>'BAR'</code> for * {@link ifc.chart._BarDiagram}, {@link ifc.chart._ChartAxisZSupplier}, * {@link ifc.chart._ChartTwoAxisXSupplier}, * {@link ifc.chart._ChartTwoAxisYSupplier}(the created bar-diagram)</li> * <li> <code>'LINE'</code> for * {@link ifc.chart._LineDiagram}(the created XY-diagram) </li> * <li> <code>'STACK'</code> for * {@link ifc.chart._StackableDiagram}(the created Line-diagram) </li> * </ul> * @see com.sun.star.document.XEmbeddedObjectSupplier * @see com.sun.star.chart.Diagram * @see com.sun.star.chart.StockDiagram
*/
@Override protected TestEnvironment createTestEnvironment
(TestParameters Param, PrintWriter log) throws Exception {
if (!oCharts.hasByName("ChXDiagram")) {
oCharts.addNewByName("ChXDiagram", oRect, oAddr, true, true);
}
// get the TableChart
XTableChart oChart = (XTableChart) AnyConverter.toObject( new Type(XTableChart.class),UnoRuntime.queryInterface(
XNameAccess.class, oCharts).getByName("ChXDiagram"));
log.println( "creating a new environment for chartdocument object" );
TestEnvironment tEnv = new TestEnvironment( oObj );
log.println( "adding ChartDocument as mod relation to environment" );
tEnv.addObjRelation("CHARTDOC", xChartDoc);
XChartDataArray da = UnoRuntime.queryInterface(XChartDataArray.class, xChartDoc.getData()); int cols = da.getColumnDescriptions().length; int rows = da.getRowDescriptions().length;
/** * Inserts a value or a formula in the cell of the spreadsheet. * @param CellX is the column index of the cell * @param CellY is the row index of the cell * @param theValue string representation of the value * @param TT1 specify the spreadsheet, the interface * <code>com.sun.star.sheet.XSpreadsheet</code> * @param flag if it's equal to <code>'V'</code> then the method inserts * a double-value in the cell else it inserts a formula in the cell
*/ publicstaticvoid insertIntoCell( int CellX, int CellY, String theValue, XSpreadsheet TT1, String flag) throws com.sun.star.lang.IndexOutOfBoundsException {
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.