java: remove dead code
found by UCDetector Change-Id: I6b0f49529379072da566e927b86815f173e7a90b
This commit is contained in:
@@ -61,10 +61,6 @@ class ScreenComparer
|
||||
m_imgDiff = null;
|
||||
}
|
||||
|
||||
public Rectangle getLocation()
|
||||
{
|
||||
return m_rect;
|
||||
}
|
||||
public void grabOne() throws Exception
|
||||
{
|
||||
grabOne(m_rect);
|
||||
|
||||
@@ -41,7 +41,6 @@ $(eval $(call gb_JunitTest_add_sourcefiles,connectivity_complex,\
|
||||
connectivity/qa/complex/connectivity/dbase/DBaseNumericFunctions \
|
||||
connectivity/qa/complex/connectivity/dbase/DBaseSqlTests \
|
||||
connectivity/qa/complex/connectivity/dbase/DBaseStringFunctions \
|
||||
connectivity/qa/complex/connectivity/hsqldb/DatabaseMetaData \
|
||||
connectivity/qa/complex/connectivity/hsqldb/TestCacheSize \
|
||||
connectivity/qa/connectivity/tools/AbstractDatabase \
|
||||
connectivity/qa/connectivity/tools/CRMDatabase \
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package com.sun.star.sdbcx.comp.hsqldb;
|
||||
|
||||
@SuppressWarnings("ucd")
|
||||
public class StorageAccess implements org.hsqldb.lib.Storage {
|
||||
String key;
|
||||
String name;
|
||||
|
||||
@@ -20,6 +20,7 @@ package com.sun.star.sdbcx.comp.hsqldb;
|
||||
import org.hsqldb.lib.FileAccess;
|
||||
import org.hsqldb.lib.FileSystemRuntimeException;
|
||||
|
||||
@SuppressWarnings("ucd")
|
||||
public class StorageFileAccess implements org.hsqldb.lib.FileAccess{
|
||||
static { NativeLibraries.load(); }
|
||||
|
||||
|
||||
@@ -34,29 +34,8 @@ public class FileSystemRuntimeException extends java.lang.RuntimeException {
|
||||
public static final int fileAccessRemoveElementFailed = 1;
|
||||
public static final int fileAccessRenameElementFailed = 2;
|
||||
|
||||
private final int errorCode;
|
||||
|
||||
public FileSystemRuntimeException(int _errorCode) {
|
||||
super();
|
||||
errorCode = _errorCode;
|
||||
}
|
||||
|
||||
public FileSystemRuntimeException(String _message, int _errorCode) {
|
||||
super(_message);
|
||||
errorCode = _errorCode;
|
||||
}
|
||||
|
||||
public FileSystemRuntimeException(String _message, java.lang.Throwable _cause, int _errorCode) {
|
||||
super(_message, _cause);
|
||||
errorCode = _errorCode;
|
||||
}
|
||||
|
||||
public FileSystemRuntimeException(java.lang.Throwable _cause, int _errorCode) {
|
||||
super(_cause);
|
||||
errorCode = _errorCode;
|
||||
}
|
||||
|
||||
public final int getErrorCode() {
|
||||
return errorCode;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
* 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 .
|
||||
*/
|
||||
package complex.connectivity.hsqldb;
|
||||
|
||||
import complex.connectivity.HsqlDriverTest;
|
||||
import java.sql.*;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
|
||||
public class DatabaseMetaData {
|
||||
|
||||
private final java.sql.DatabaseMetaData m_xMD;
|
||||
private final HsqlDriverTest m_TestCase;
|
||||
|
||||
/** Creates a new instance of DatabaseMetaData */
|
||||
public DatabaseMetaData(HsqlDriverTest _testCase,java.sql.DatabaseMetaData _xmd) {
|
||||
m_TestCase = _testCase;
|
||||
m_xMD = _xmd;
|
||||
}
|
||||
|
||||
protected void assure(String _sText,boolean btest){
|
||||
m_TestCase.assurePublic(_sText,btest);
|
||||
}
|
||||
|
||||
protected void testMethod(String sName,Class<?>[] params,Object[] objParams,int nCount){
|
||||
try {
|
||||
System.out.println("test method " + sName);
|
||||
|
||||
Method aGet = ((Object)m_xMD).getClass().getDeclaredMethod(sName, params);
|
||||
if ( aGet != null ){
|
||||
ResultSet rs = (ResultSet)aGet.invoke(m_xMD, objParams);
|
||||
ResultSetMetaData rsMD = rs.getMetaData();
|
||||
|
||||
assure( sName + " returns wrong column count" , rsMD.getColumnCount() == nCount);
|
||||
rs.close();
|
||||
}
|
||||
else
|
||||
assure( sName + " returns wrong column count" , false);
|
||||
} catch( java.lang.NoSuchMethodException ex ) {
|
||||
assure("Method " + sName + " could not be found!",false);
|
||||
} catch( java.lang.IllegalAccessException ex ) {
|
||||
assure("IllegalAccessException!",false);
|
||||
} catch( SQLException ex ) {
|
||||
assure("SQLException occurred: " + ex.getMessage() ,false);
|
||||
} catch( java.lang.reflect.InvocationTargetException ex ) {
|
||||
assure("IllegalAccessException!",false);
|
||||
}
|
||||
}
|
||||
|
||||
public void test() {
|
||||
|
||||
try {
|
||||
ResultSet rs = m_xMD.getTables(null, null, "TESTCASE", null);
|
||||
while (rs.next()) {
|
||||
String catalog = rs.getString(1);
|
||||
if (rs.wasNull())
|
||||
catalog = null;
|
||||
|
||||
String schema = rs.getString(2);
|
||||
if (rs.wasNull())
|
||||
schema = null;
|
||||
|
||||
String table = rs.getString(3);
|
||||
String type = rs.getString(4);
|
||||
System.out.println("Catalog: " + catalog + " Schema: " + schema
|
||||
+ " Table: " + table + " Type: " + type);
|
||||
System.out
|
||||
.println("------------------ Columns ------------------");
|
||||
ResultSet rsColumns = m_xMD.getColumns(catalog, schema, table,
|
||||
"%");
|
||||
while (rsColumns.next()) {
|
||||
System.out.println("Column: " + rsColumns.getString(4)
|
||||
+ " Type: " + rsColumns.getInt(5) + " TypeName: "
|
||||
+ rsColumns.getString(6));
|
||||
}
|
||||
|
||||
}
|
||||
rs.close();
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,6 @@ public class TestCacheSize {
|
||||
// type of the big table {MEMORY | CACHED | TEXT}
|
||||
private String tableType = "CACHED";
|
||||
private int cacheScale = 17;
|
||||
int cacheSizeScale = 8;
|
||||
|
||||
// script format {TEXT, BINARY, COMPRESSED}
|
||||
private String logType = "TEXT";
|
||||
@@ -109,7 +108,6 @@ public class TestCacheSize {
|
||||
|
||||
private XStatement sStatement;
|
||||
private XConnection cConnection;
|
||||
XDataSource ds;
|
||||
private XDriver drv;
|
||||
private com.sun.star.beans.PropertyValue[] info;
|
||||
|
||||
|
||||
@@ -28,9 +28,4 @@ public class CsvDatabase extends FlatFileDatabase
|
||||
super( i_orb, "flat" );
|
||||
}
|
||||
|
||||
|
||||
protected CsvDatabase( final XMultiServiceFactory i_orb, final String i_existingDocumentURL ) throws Exception
|
||||
{
|
||||
super( i_orb, i_existingDocumentURL, "flat" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,8 +29,4 @@ public class DbaseDatabase extends FlatFileDatabase
|
||||
}
|
||||
|
||||
|
||||
protected DbaseDatabase( final XMultiServiceFactory i_orb, final String i_existingDocumentURL ) throws Exception
|
||||
{
|
||||
super( i_orb, i_existingDocumentURL, "dbase" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,11 +18,9 @@
|
||||
|
||||
package connectivity.tools;
|
||||
|
||||
import com.sun.star.beans.PropertyVetoException;
|
||||
import com.sun.star.beans.UnknownPropertyException;
|
||||
import com.sun.star.beans.XPropertySet;
|
||||
import com.sun.star.lang.WrappedTargetException;
|
||||
import com.sun.star.lang.IllegalArgumentException;
|
||||
|
||||
public class QueryDefinition
|
||||
{
|
||||
@@ -48,18 +46,4 @@ public class QueryDefinition
|
||||
return command;
|
||||
}
|
||||
|
||||
/** retrieves the command underlying the query definition
|
||||
*
|
||||
* This method is a mere wrapped around the <code>getPropertyValue( "Command" )</code> call
|
||||
*/
|
||||
public void setCommand( String _command ) throws WrappedTargetException
|
||||
{
|
||||
try
|
||||
{
|
||||
m_queryDef.setPropertyValue( "Command", _command );
|
||||
}
|
||||
catch (UnknownPropertyException e) { }
|
||||
catch (PropertyVetoException e) { }
|
||||
catch (IllegalArgumentException e) { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import com.sun.star.lang.XMultiServiceFactory;
|
||||
import com.sun.star.sdb.XSingleSelectQueryComposer;
|
||||
import com.sun.star.sdbc.SQLException;
|
||||
import com.sun.star.sdbc.XConnection;
|
||||
import com.sun.star.sdbc.XDatabaseMetaData;
|
||||
import com.sun.star.sdbc.XPreparedStatement;
|
||||
import com.sun.star.sdbc.XStatement;
|
||||
import com.sun.star.sdbcx.XTablesSupplier;
|
||||
@@ -73,12 +72,6 @@ public class Connection
|
||||
return m_connection.prepareStatement( _sql );
|
||||
}
|
||||
|
||||
public
|
||||
XDatabaseMetaData getMetaData() throws SQLException
|
||||
{
|
||||
return m_connection.getMetaData();
|
||||
}
|
||||
|
||||
public
|
||||
void close() throws SQLException
|
||||
{
|
||||
|
||||
@@ -52,21 +52,11 @@ public class DatabaseApplication
|
||||
documentUI.connect();
|
||||
}
|
||||
|
||||
public XOfficeDatabaseDocument getDatabaseDocument()
|
||||
{
|
||||
return databaseDocument;
|
||||
}
|
||||
|
||||
public XDatabaseDocumentUI getDocumentUI()
|
||||
{
|
||||
return documentUI;
|
||||
}
|
||||
|
||||
public DatabaseAccess getDb()
|
||||
{
|
||||
return db;
|
||||
}
|
||||
|
||||
public void store()
|
||||
{
|
||||
// store the doc in a new location
|
||||
|
||||
@@ -24,15 +24,12 @@ import com.sun.star.container.XIndexAccess;
|
||||
import com.sun.star.container.XChild;
|
||||
import com.sun.star.container.XNamed;
|
||||
import com.sun.star.drawing.XDrawPage;
|
||||
import com.sun.star.lang.XServiceInfo;
|
||||
|
||||
public class FormComponent
|
||||
{
|
||||
private final Object m_component;
|
||||
private final XNameAccess m_nameAccess;
|
||||
private final XIndexAccess m_indexAccess;
|
||||
private final XChild m_child;
|
||||
private final XNamed m_named;
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
private FormComponent()
|
||||
@@ -40,8 +37,6 @@ public class FormComponent
|
||||
m_component = null;
|
||||
m_nameAccess = null;
|
||||
m_indexAccess = null;
|
||||
m_child = null;
|
||||
m_named = null;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
@@ -54,9 +49,9 @@ public class FormComponent
|
||||
m_nameAccess = (XNameAccess)m_component;
|
||||
m_indexAccess = UnoRuntime.queryInterface(
|
||||
XIndexAccess.class, m_component );
|
||||
m_child = UnoRuntime.queryInterface(
|
||||
UnoRuntime.queryInterface(
|
||||
XChild.class, m_component );
|
||||
m_named = UnoRuntime.queryInterface(
|
||||
UnoRuntime.queryInterface(
|
||||
XNamed.class, m_component );
|
||||
}
|
||||
|
||||
@@ -68,9 +63,9 @@ public class FormComponent
|
||||
XNameAccess.class, m_component );
|
||||
m_indexAccess = UnoRuntime.queryInterface(
|
||||
XIndexAccess.class, m_component );
|
||||
m_child = UnoRuntime.queryInterface(
|
||||
UnoRuntime.queryInterface(
|
||||
XChild.class, m_component );
|
||||
m_named = UnoRuntime.queryInterface(
|
||||
UnoRuntime.queryInterface(
|
||||
XNamed.class, m_component );
|
||||
}
|
||||
|
||||
@@ -100,20 +95,6 @@ public class FormComponent
|
||||
return new FormComponent();
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
public String[] getElementNames()
|
||||
{
|
||||
return ( m_nameAccess != null ) ? m_nameAccess.getElementNames() : new String[]{};
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
public int getCount()
|
||||
{
|
||||
return ( m_indexAccess != null ) ? m_indexAccess.getCount() : 0;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
public FormComponent getByIndex( int index )
|
||||
{
|
||||
@@ -130,35 +111,4 @@ public class FormComponent
|
||||
return new FormComponent();
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
public com.sun.star.uno.Type getElementType( )
|
||||
{
|
||||
if ( m_indexAccess != null )
|
||||
return m_indexAccess.getElementType();
|
||||
else if ( m_nameAccess != null )
|
||||
return m_nameAccess.getElementType();
|
||||
return new com.sun.star.uno.Type( String.class );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
public FormComponent getParent()
|
||||
{
|
||||
return ( m_child != null ) ? new FormComponent( m_child.getParent() ) : new FormComponent();
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
public String getName()
|
||||
{
|
||||
return ( m_named != null ) ? m_named.getName() : "";
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
public String getImplementationName()
|
||||
{
|
||||
XServiceInfo si = UnoRuntime.queryInterface(
|
||||
XServiceInfo.class, m_component );
|
||||
return ( si != null ) ? si.getImplementationName() : "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,12 +22,9 @@ import com.sun.star.uno.*;
|
||||
import com.sun.star.lang.XMultiServiceFactory;
|
||||
import com.sun.star.lang.XComponent;
|
||||
import com.sun.star.table.XCellRange;
|
||||
import com.sun.star.table.CellAddress;
|
||||
import com.sun.star.table.CellRangeAddress;
|
||||
import com.sun.star.container.XIndexAccess;
|
||||
import com.sun.star.sheet.XSpreadsheetDocument;
|
||||
import com.sun.star.sheet.XSpreadsheets;
|
||||
import com.sun.star.beans.NamedValue;
|
||||
|
||||
public class SpreadsheetDocument extends DocumentHelper
|
||||
{
|
||||
@@ -68,71 +65,4 @@ public class SpreadsheetDocument extends DocumentHelper
|
||||
);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/** creates a value binding for a given cell
|
||||
*/
|
||||
public com.sun.star.form.binding.XValueBinding createCellBinding( short sheet, short column, short row )
|
||||
{
|
||||
return createCellBinding( sheet, column, row, false );
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/** creates a value binding which can be used to exchange a list box selection <em>index</em> with a cell
|
||||
*/
|
||||
public com.sun.star.form.binding.XValueBinding createListIndexBinding( short sheet, short column, short row )
|
||||
{
|
||||
return createCellBinding( sheet, column, row, true );
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/** creates a value binding for a given cell, with or without support for integer value exchange
|
||||
*/
|
||||
private com.sun.star.form.binding.XValueBinding createCellBinding( short sheet, short column, short row, boolean supportIntegerValues )
|
||||
{
|
||||
com.sun.star.form.binding.XValueBinding cellBinding = null;
|
||||
try
|
||||
{
|
||||
CellAddress address = new CellAddress( sheet, column, row );
|
||||
Object[] initParam = new Object[] { new NamedValue( "BoundCell", address ) };
|
||||
cellBinding = UnoRuntime.queryInterface(
|
||||
com.sun.star.form.binding.XValueBinding.class,
|
||||
createInstanceWithArguments(
|
||||
supportIntegerValues ? "com.sun.star.table.ListPositionCellBinding"
|
||||
: "com.sun.star.table.CellValueBinding",
|
||||
initParam
|
||||
)
|
||||
);
|
||||
}
|
||||
catch( com.sun.star.uno.Exception e )
|
||||
{
|
||||
System.err.println( e );
|
||||
e.printStackTrace( System.err );
|
||||
}
|
||||
return cellBinding;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/** creates a source of list entries associated with a (one-column) cell range
|
||||
*/
|
||||
public com.sun.star.form.binding.XListEntrySource createListEntrySource( short sheet, short column,
|
||||
short topRow, short bottomRow )
|
||||
{
|
||||
com.sun.star.form.binding.XListEntrySource entrySource = null;
|
||||
try
|
||||
{
|
||||
CellRangeAddress rangeAddress = new CellRangeAddress( sheet, column,
|
||||
topRow, column, bottomRow );
|
||||
Object[] initParam = new Object[] { new NamedValue( "CellRange", rangeAddress ) };
|
||||
entrySource = UnoRuntime.queryInterface(
|
||||
com.sun.star.form.binding.XListEntrySource.class,
|
||||
createInstanceWithArguments(
|
||||
"com.sun.star.table.CellRangeListSource", initParam ) );
|
||||
}
|
||||
catch( com.sun.star.uno.Exception e )
|
||||
{
|
||||
System.err.println( e );
|
||||
e.printStackTrace( System.err );
|
||||
}
|
||||
return entrySource;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,13 +41,6 @@ public class XMLDocument extends integration.forms.DocumentHelper
|
||||
impl_initialize( getDocument() );
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
public XMLDocument( XMultiServiceFactory _orb, XComponent _document )
|
||||
{
|
||||
super( _orb, _document );
|
||||
impl_initialize( _document );
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
private void impl_initialize( XComponent _document )
|
||||
{
|
||||
|
||||
@@ -36,8 +36,6 @@ $(eval $(call gb_JunitTest_add_sourcefiles,framework_complex,\
|
||||
framework/qa/complex/disposing/GetServiceWhileDisposingOffice \
|
||||
framework/qa/complex/path_substitution/PathSubstitutionTest \
|
||||
framework/qa/complex/loadAllDocuments/InteractionHandler \
|
||||
framework/qa/complex/loadAllDocuments/StreamSimulator \
|
||||
framework/qa/complex/loadAllDocuments/TestDocument \
|
||||
framework/qa/complex/loadAllDocuments/CheckXComponentLoader \
|
||||
framework/qa/complex/loadAllDocuments/StatusIndicator \
|
||||
framework/qa/complex/broken_document/TestDocument \
|
||||
@@ -46,7 +44,6 @@ $(eval $(call gb_JunitTest_add_sourcefiles,framework_complex,\
|
||||
framework/qa/complex/framework/autosave/AutoSave \
|
||||
framework/qa/complex/framework/autosave/Protocol \
|
||||
framework/qa/complex/framework/autosave/ConfigHelper \
|
||||
framework/qa/complex/framework/recovery/TimeoutThread \
|
||||
framework/qa/complex/framework/recovery/KlickButtonThread \
|
||||
framework/qa/complex/framework/recovery/RecoveryTools \
|
||||
framework/qa/complex/framework/recovery/RecoveryTest \
|
||||
|
||||
@@ -240,18 +240,6 @@ public class Interceptor implements XDispatch,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** set a new list of URL's, which should be used on registration time
|
||||
(that's why it's necessary to call this impl-method before the interceptor
|
||||
is used at the OOo API!) to optimize the interception chain.
|
||||
*/
|
||||
public synchronized void setURLs4InterceptionInfo(String[] lURLs)
|
||||
{
|
||||
m_lURLs4InterceptionInfo = lURLs;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** set a new list of URL's, which should be blocked by this interceptor.
|
||||
(that's why it's necessary to call this impl-method before the interceptor
|
||||
is used at the OOo API!)
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* 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 .
|
||||
*/
|
||||
|
||||
package complex.framework.recovery;
|
||||
|
||||
public class TimeoutThread extends Thread{
|
||||
public int timeOut = 0;
|
||||
/** Creates a new instance of TimeoutThread */
|
||||
public TimeoutThread(int timeOut) {
|
||||
this.timeOut = timeOut;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(){
|
||||
util.utils.shortWait(timeOut);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,433 +0,0 @@
|
||||
/*
|
||||
* 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 .
|
||||
*/
|
||||
package complex.loadAllDocuments;
|
||||
|
||||
import com.sun.star.uno.UnoRuntime;
|
||||
import com.sun.star.ucb.XSimpleFileAccess;
|
||||
import com.sun.star.lang.XMultiServiceFactory;
|
||||
|
||||
/**
|
||||
* Simulates an input and output stream and
|
||||
* implements the interfaces XInputStream, XOutputStream.
|
||||
* So it can be used for testing loading/saving of documents
|
||||
* using streams instead of URLs.
|
||||
*/
|
||||
public class StreamSimulator implements com.sun.star.io.XInputStream ,
|
||||
com.sun.star.io.XOutputStream ,
|
||||
com.sun.star.io.XSeekable
|
||||
{
|
||||
|
||||
/**
|
||||
* the internal input stream for reading
|
||||
*/
|
||||
private com.sun.star.io.XInputStream m_xInStream ;
|
||||
/**
|
||||
* the internal input stream for writing
|
||||
*/
|
||||
private com.sun.star.io.XOutputStream m_xOutStream ;
|
||||
/**
|
||||
* points at runtime to m_xInStream or m_xOutStream and make it seekable
|
||||
*/
|
||||
private com.sun.star.io.XSeekable m_xSeek ;
|
||||
/**
|
||||
* indicates, that the input stream interface was used
|
||||
*/
|
||||
public boolean m_bInWasUsed ;
|
||||
/**
|
||||
* indicates, that the output stream interface was used
|
||||
*/
|
||||
public boolean m_bOutWasUsed ;
|
||||
|
||||
/**
|
||||
* construct a new instance of this class
|
||||
* It set the name of the correspojnding file on disk, which
|
||||
* should be source or target for the following operations on
|
||||
* this object. And it regulate if it should function as
|
||||
* input or output stream.
|
||||
*
|
||||
* @param sFileName
|
||||
* name of the file on disk
|
||||
* Will be used as source (if param bInput==true)
|
||||
* or as target (if param bInput==false).
|
||||
*
|
||||
* @param bInput
|
||||
* it specify, which interface should work at this object.
|
||||
* <TRUE/> => we simulate an input stream
|
||||
* <FALSE/> => we simulate an output stream
|
||||
*
|
||||
* @throw com.sun.star.io.NotConnectedException
|
||||
* in case the internal streams to the file on disk couldn't
|
||||
* be established.
|
||||
* They are necessary. Otherwhise this simulator can't
|
||||
* really work.
|
||||
*/
|
||||
public StreamSimulator(XMultiServiceFactory xMSF,
|
||||
String sFileName, boolean bInput)
|
||||
throws com.sun.star.io.NotConnectedException
|
||||
{
|
||||
m_bInWasUsed = false ;
|
||||
m_bOutWasUsed = false ;
|
||||
|
||||
try
|
||||
{
|
||||
XSimpleFileAccess xHelper = UnoRuntime.queryInterface(XSimpleFileAccess.class,
|
||||
xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"));
|
||||
|
||||
if (xHelper == null)
|
||||
throw new com.sun.star.io.NotConnectedException(
|
||||
"ucb helper not available. Can't create streams.");
|
||||
|
||||
if (bInput)
|
||||
{
|
||||
m_xInStream = xHelper.openFileRead(sFileName);
|
||||
m_xSeek = UnoRuntime.queryInterface(
|
||||
com.sun.star.io.XSeekable.class,
|
||||
m_xInStream);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_xOutStream = xHelper.openFileWrite(sFileName);
|
||||
m_xSeek = UnoRuntime.queryInterface(
|
||||
com.sun.star.io.XSeekable.class,
|
||||
m_xOutStream);
|
||||
}
|
||||
}
|
||||
catch(com.sun.star.uno.Exception exUno)
|
||||
{
|
||||
throw new com.sun.star.io.NotConnectedException(exUno);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* following methods simulates the XInputStream.
|
||||
* The notice all actions inside the internal protocol
|
||||
* and try to map all necessary functions to the internal
|
||||
* open in-stream.
|
||||
*/
|
||||
public int readBytes(byte[][] lData, int nBytesToRead )
|
||||
throws com.sun.star.io.NotConnectedException,
|
||||
com.sun.star.io.BufferSizeExceededException,
|
||||
com.sun.star.io.IOException
|
||||
{
|
||||
m_bInWasUsed = true;
|
||||
|
||||
if (m_xInStream == null)
|
||||
{
|
||||
throw new com.sun.star.io.NotConnectedException("stream not open");
|
||||
}
|
||||
|
||||
int nRead = 0;
|
||||
try
|
||||
{
|
||||
nRead = m_xInStream.readBytes(lData,nBytesToRead);
|
||||
}
|
||||
catch (com.sun.star.io.NotConnectedException exConnect) {
|
||||
}
|
||||
catch (com.sun.star.io.BufferSizeExceededException exBuffer ) {
|
||||
}
|
||||
catch (com.sun.star.io.IOException exIO ) {
|
||||
}
|
||||
catch (com.sun.star.uno.RuntimeException exRuntime) {
|
||||
}
|
||||
|
||||
|
||||
return nRead;
|
||||
}
|
||||
|
||||
public int readSomeBytes(byte[][] lData, int nMaxBytesToRead)
|
||||
throws com.sun.star.io.NotConnectedException,
|
||||
com.sun.star.io.BufferSizeExceededException ,
|
||||
com.sun.star.io.IOException
|
||||
{
|
||||
m_bInWasUsed = true;
|
||||
|
||||
if (m_xInStream == null)
|
||||
{
|
||||
throw new com.sun.star.io.NotConnectedException("stream not open");
|
||||
}
|
||||
|
||||
int nRead = 0;
|
||||
try
|
||||
{
|
||||
nRead = m_xInStream.readSomeBytes(lData,nMaxBytesToRead);
|
||||
}
|
||||
catch (com.sun.star.io.NotConnectedException exConnect) {
|
||||
}
|
||||
catch (com.sun.star.io.BufferSizeExceededException exBuffer ) {
|
||||
}
|
||||
catch (com.sun.star.io.IOException exIO ) {
|
||||
}
|
||||
catch (com.sun.star.uno.RuntimeException exRuntime) {
|
||||
}
|
||||
|
||||
return nRead;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void skipBytes(int nBytesToSkip)
|
||||
throws com.sun.star.io.NotConnectedException,
|
||||
com.sun.star.io.BufferSizeExceededException ,
|
||||
com.sun.star.io.IOException
|
||||
{
|
||||
m_bInWasUsed = true;
|
||||
|
||||
if (m_xInStream == null)
|
||||
{
|
||||
throw new com.sun.star.io.NotConnectedException("stream not open");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
m_xInStream.skipBytes(nBytesToSkip);
|
||||
}
|
||||
catch (com.sun.star.io.NotConnectedException exConnect) {
|
||||
}
|
||||
catch (com.sun.star.io.BufferSizeExceededException exBuffer ) {
|
||||
}
|
||||
catch (com.sun.star.io.IOException exIO ) {
|
||||
}
|
||||
catch (com.sun.star.uno.RuntimeException exRuntime) {
|
||||
}
|
||||
}
|
||||
|
||||
public int available() throws com.sun.star.io.NotConnectedException,
|
||||
com.sun.star.io.IOException
|
||||
{
|
||||
m_bInWasUsed = true;
|
||||
|
||||
if (m_xInStream == null)
|
||||
{
|
||||
throw new com.sun.star.io.NotConnectedException("stream not open");
|
||||
}
|
||||
|
||||
int nAvailable = 0;
|
||||
try
|
||||
{
|
||||
nAvailable = m_xInStream.available();
|
||||
}
|
||||
catch (com.sun.star.io.NotConnectedException exConnect) {
|
||||
}
|
||||
catch (com.sun.star.io.IOException exIO ) {
|
||||
}
|
||||
catch (com.sun.star.uno.RuntimeException exRuntime) {
|
||||
}
|
||||
|
||||
return nAvailable;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void closeInput() throws com.sun.star.io.NotConnectedException,
|
||||
com.sun.star.io.IOException
|
||||
{
|
||||
m_bInWasUsed = true;
|
||||
|
||||
if (m_xInStream == null)
|
||||
{
|
||||
throw new com.sun.star.io.NotConnectedException("stream not open");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
m_xInStream.closeInput();
|
||||
}
|
||||
catch (com.sun.star.io.NotConnectedException exConnect) {
|
||||
}
|
||||
catch (com.sun.star.io.IOException exIO ) {
|
||||
}
|
||||
catch (com.sun.star.uno.RuntimeException exRuntime) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* following methods simulates the XOutputStream.
|
||||
* The notice all actions inside the internal protocol
|
||||
* and try to map all necessary functions to the internal
|
||||
* open out-stream.
|
||||
*/
|
||||
public void writeBytes(byte[] lData)
|
||||
throws com.sun.star.io.NotConnectedException,
|
||||
com.sun.star.io.BufferSizeExceededException ,
|
||||
com.sun.star.io.IOException
|
||||
{
|
||||
m_bOutWasUsed = true;
|
||||
|
||||
if (m_xOutStream == null)
|
||||
{
|
||||
throw new com.sun.star.io.NotConnectedException("stream not open");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
m_xOutStream.writeBytes(lData);
|
||||
}
|
||||
catch (com.sun.star.io.NotConnectedException exConnect) {
|
||||
}
|
||||
catch (com.sun.star.io.BufferSizeExceededException exBuffer ) {
|
||||
}
|
||||
catch (com.sun.star.io.IOException exIO ) {
|
||||
}
|
||||
catch (com.sun.star.uno.RuntimeException exRuntime) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void flush() throws com.sun.star.io.NotConnectedException ,
|
||||
com.sun.star.io.BufferSizeExceededException ,
|
||||
com.sun.star.io.IOException
|
||||
{
|
||||
m_bOutWasUsed = true;
|
||||
|
||||
if (m_xOutStream == null)
|
||||
{
|
||||
throw new com.sun.star.io.NotConnectedException("stream not open");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
m_xOutStream.flush();
|
||||
}
|
||||
catch (com.sun.star.io.NotConnectedException exConnect) {
|
||||
}
|
||||
catch (com.sun.star.io.BufferSizeExceededException exBuffer ) {
|
||||
}
|
||||
catch (com.sun.star.io.IOException exIO ) {
|
||||
}
|
||||
catch (com.sun.star.uno.RuntimeException exRuntime) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void closeOutput() throws com.sun.star.io.NotConnectedException ,
|
||||
com.sun.star.io.BufferSizeExceededException,
|
||||
com.sun.star.io.IOException
|
||||
{
|
||||
m_bOutWasUsed = true;
|
||||
|
||||
if (m_xOutStream == null)
|
||||
{
|
||||
throw new com.sun.star.io.NotConnectedException("stream not open");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
m_xOutStream.closeOutput();
|
||||
}
|
||||
catch (com.sun.star.io.NotConnectedException exConnect) {
|
||||
}
|
||||
catch (com.sun.star.io.BufferSizeExceededException exBuffer ) {
|
||||
}
|
||||
catch (com.sun.star.io.IOException exIO ) {
|
||||
}
|
||||
catch (com.sun.star.uno.RuntimeException exRuntime) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* following methods simulates the XSeekable.
|
||||
* The notice all actions inside the internal protocol
|
||||
* and try to map all necessary functions to the internal
|
||||
* open stream.
|
||||
*/
|
||||
public void seek(long nLocation )
|
||||
throws com.sun.star.lang.IllegalArgumentException,
|
||||
com.sun.star.io.IOException
|
||||
{
|
||||
if (m_xInStream != null)
|
||||
m_bInWasUsed = true;
|
||||
else
|
||||
if (m_xOutStream != null)
|
||||
m_bOutWasUsed = true;
|
||||
|
||||
if (m_xSeek == null)
|
||||
{
|
||||
throw new com.sun.star.io.IOException("stream not seekable");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
m_xSeek.seek(nLocation);
|
||||
}
|
||||
catch (com.sun.star.lang.IllegalArgumentException exArg ) {
|
||||
}
|
||||
catch (com.sun.star.io.IOException exIO ) {
|
||||
}
|
||||
catch (com.sun.star.uno.RuntimeException exRuntime) {
|
||||
}
|
||||
}
|
||||
|
||||
public long getPosition() throws com.sun.star.io.IOException
|
||||
{
|
||||
|
||||
if (m_xInStream != null)
|
||||
m_bInWasUsed = true;
|
||||
else
|
||||
if (m_xOutStream != null)
|
||||
m_bOutWasUsed = true;
|
||||
|
||||
if (m_xSeek == null)
|
||||
{
|
||||
throw new com.sun.star.io.IOException("stream not seekable");
|
||||
}
|
||||
|
||||
long nPos = 0;
|
||||
try
|
||||
{
|
||||
nPos = m_xSeek.getPosition();
|
||||
}
|
||||
catch (com.sun.star.io.IOException exIO ) {
|
||||
}
|
||||
catch (com.sun.star.uno.RuntimeException exRuntime) {
|
||||
}
|
||||
|
||||
return nPos;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public long getLength() throws com.sun.star.io.IOException
|
||||
{
|
||||
|
||||
if (m_xInStream != null)
|
||||
m_bInWasUsed = true;
|
||||
else
|
||||
if (m_xOutStream != null)
|
||||
m_bOutWasUsed = true;
|
||||
|
||||
if (m_xSeek == null)
|
||||
{
|
||||
throw new com.sun.star.io.IOException("stream not seekable");
|
||||
}
|
||||
|
||||
long nLen = 0;
|
||||
try
|
||||
{
|
||||
nLen = m_xSeek.getLength();
|
||||
}
|
||||
catch (com.sun.star.io.IOException exIO ) {
|
||||
}
|
||||
catch (com.sun.star.uno.RuntimeException exRuntime) {
|
||||
}
|
||||
|
||||
return nLen;
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* 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 .
|
||||
*/
|
||||
|
||||
package complex.loadAllDocuments;
|
||||
|
||||
import java.io.File;
|
||||
import org.openoffice.test.OfficeFileUrl;
|
||||
|
||||
final class TestDocument
|
||||
{
|
||||
public static String getUrl(String name)
|
||||
{
|
||||
return OfficeFileUrl.getAbsolute(new File("testdocuments", name));
|
||||
}
|
||||
|
||||
private TestDocument() {}
|
||||
}
|
||||
@@ -24,9 +24,6 @@ public class AWeakBase extends WeakBase implements XEventListener
|
||||
{
|
||||
public int nDisposingCalled= 0;
|
||||
|
||||
public AWeakBase(int i)
|
||||
{
|
||||
}
|
||||
public AWeakBase()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1624,7 +1624,6 @@ XPropertiesChangeListener
|
||||
int nChangeCalled;
|
||||
int nPropertiesChange;
|
||||
int nVetoCalled;
|
||||
private int nDisposingCalled;
|
||||
boolean bVeto= false;
|
||||
PropertyChangeEvent evt;
|
||||
PropertyChangeEvent[] arEvt;
|
||||
@@ -1646,7 +1645,6 @@ XPropertiesChangeListener
|
||||
|
||||
public void disposing( /*IN*/EventObject Source )
|
||||
{
|
||||
nDisposingCalled++;
|
||||
}
|
||||
|
||||
public void reset()
|
||||
@@ -1654,7 +1652,6 @@ XPropertiesChangeListener
|
||||
nChangeCalled= 0;
|
||||
nPropertiesChange= 0;
|
||||
nVetoCalled= 0;
|
||||
nDisposingCalled= 0;
|
||||
evt= null;
|
||||
arEvt= null;
|
||||
bVeto= false;
|
||||
|
||||
@@ -62,10 +62,8 @@ public class ProxyProvider
|
||||
class Proxy implements IQueryInterface, XEventListener
|
||||
{
|
||||
private String oid;
|
||||
Type type;
|
||||
Proxy(String oid, Type t) {
|
||||
this.oid = oid;
|
||||
this.type = t;
|
||||
}
|
||||
|
||||
public String getOid() {
|
||||
|
||||
@@ -99,8 +99,6 @@ class TestBridge implements IBridge {
|
||||
|
||||
public void release() {}
|
||||
|
||||
public void reset() throws IOException {}
|
||||
|
||||
public void dispose() throws InterruptedException, IOException {}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,21 +24,12 @@ $(eval $(call gb_Jar_set_packageroot,EvolutionarySolver,net/adaptivebox))
|
||||
$(eval $(call gb_Jar_set_manifest,EvolutionarySolver,$(SRCDIR)/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/Manifest.mf))
|
||||
|
||||
$(eval $(call gb_Jar_add_sourcefiles,EvolutionarySolver,\
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/SRComparator \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/ACRComparator \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/BCHComparator \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/IGoodnessCompareEngine \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/goodness/PenaltyComparator \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/CompareValue \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalString \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/BasicArray \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalCompare \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/BasicBound \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/OutputMethods \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/RandomGenerator \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/GlobalFile \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/IUpdateCycleEngine \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/global/BasicTag \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/EvalStruct \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/EvalElement \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/encode/IEncodeEngine \
|
||||
@@ -46,7 +37,6 @@ $(eval $(call gb_Jar_add_sourcefiles,EvolutionarySolver,\
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/BasicPoint \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignSpace \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/space/DesignDim \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/problem/UnconstrainedProblemEncoder \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/problem/ProblemEncoder \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/Library \
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/knowledge/ILibEngine \
|
||||
|
||||
@@ -40,7 +40,6 @@ $(eval $(call gb_Jar_add_sourcefiles,nlpsolver,\
|
||||
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/Button \
|
||||
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/LabeledControl \
|
||||
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/Label \
|
||||
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/ModalState \
|
||||
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/DummyEvolutionarySolverStatusDialog \
|
||||
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/IEvolutionarySolverStatusDialog \
|
||||
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno \
|
||||
|
||||
-3
@@ -32,9 +32,6 @@ public class EvalStruct {
|
||||
public EvalStruct(int elemsNum) {
|
||||
evalElems = new EvalElement[elemsNum];
|
||||
}
|
||||
public int getSize() {
|
||||
return evalElems.length;
|
||||
}
|
||||
|
||||
public void setElemAt(EvalElement dim, int index) {
|
||||
evalElems[index] = dim;
|
||||
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
/**
|
||||
* Description: basic operations on Arrays
|
||||
*
|
||||
* Author Create/Modi Note
|
||||
* Xiaofeng Xie Oct. 9, 2002
|
||||
*
|
||||
*/
|
||||
|
||||
package net.adaptivebox.global;
|
||||
|
||||
public class BasicArray {
|
||||
public static double getMinValue(double[] v) {
|
||||
double mv = Double.MAX_VALUE;
|
||||
for (int i=0; i<v.length; i++) {
|
||||
if (v[i]<mv) {
|
||||
mv=v[i];
|
||||
}
|
||||
}
|
||||
return mv;
|
||||
}
|
||||
public static double getMaxValue(double[] v) {
|
||||
double mv = -Double.MAX_VALUE;
|
||||
for (int i=0; i<v.length; i++) {
|
||||
if (v[i]>mv) {
|
||||
mv=v[i];
|
||||
}
|
||||
}
|
||||
return mv;
|
||||
}
|
||||
|
||||
}
|
||||
-14
@@ -37,13 +37,6 @@ public class BasicBound {
|
||||
return Math.abs(maxValue-minValue);
|
||||
}
|
||||
|
||||
public boolean isSatisfyCondition(double child){
|
||||
if(child > maxValue || child < minValue) {
|
||||
return(false);
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
|
||||
public double boundAdjust(double value){
|
||||
if(value > maxValue) {
|
||||
value = maxValue;
|
||||
@@ -66,13 +59,6 @@ public class BasicBound {
|
||||
|
||||
|
||||
|
||||
public double randomAdjust (double value){
|
||||
if(value > maxValue || value < minValue) {
|
||||
value = getRandomValue();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public double getRandomValue(){
|
||||
return RandomGenerator.doubleRangeRandom(minValue, maxValue);
|
||||
}
|
||||
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
/**
|
||||
* Description: defines some static constant values.
|
||||
*
|
||||
* Author Create/Modi Note
|
||||
* Xiaofeng Xie Sep 22, 2000 xiaofengxie@tsinghua.org.cn
|
||||
*
|
||||
* @version 1.0
|
||||
* @Since MAOS1.0
|
||||
*/
|
||||
|
||||
package net.adaptivebox.global;
|
||||
|
||||
|
||||
public class BasicTag {
|
||||
|
||||
public static final String DOT_TAG = ".";
|
||||
|
||||
public static final String FILE_SEP_TAG = System.getProperty("file.separator");
|
||||
|
||||
}
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
/**
|
||||
* Description: Global value for comparison.
|
||||
*
|
||||
* Author Create/Modi Note
|
||||
* Xiaofeng Xie Jun 15, 2002
|
||||
* Xiaofeng Xie Feb 18, 2004
|
||||
*
|
||||
* @version 1.0
|
||||
* @Since MAOS1.0
|
||||
*/
|
||||
|
||||
|
||||
package net.adaptivebox.global;
|
||||
|
||||
public class CompareValue {
|
||||
public static final int LARGER_THAN = 2;
|
||||
public static final int EQUAL_TO = 1;
|
||||
public static final int LESS_THAN = 0;
|
||||
}
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
/**
|
||||
* Description: Global package for comparison.
|
||||
*
|
||||
* Author Create/Modi Note
|
||||
* Xiaofeng Xie Jun 15, 2002 xiaofengxie@tsinghua.org.cn
|
||||
*
|
||||
*
|
||||
* @version 1.0
|
||||
* @Since MAOS1.0
|
||||
*/
|
||||
|
||||
|
||||
package net.adaptivebox.global;
|
||||
|
||||
public class GlobalCompare {
|
||||
|
||||
/* compare the data1 and data2, if data1=data2, return 0
|
||||
* if data1 < data2, return LESS_THAN, else if data1 > data2, LARGER_THAN
|
||||
**/
|
||||
static public int compare(double data1, double data2) {
|
||||
if (data1 < data2)
|
||||
return CompareValue.LESS_THAN;
|
||||
else if (data1 > data2)
|
||||
return CompareValue.LARGER_THAN;
|
||||
else
|
||||
return CompareValue.EQUAL_TO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
-277
@@ -1,277 +0,0 @@
|
||||
/**
|
||||
* Description: Global package for file operations.
|
||||
*
|
||||
* Author Create/Modi Note
|
||||
* Xiaofeng Xie Jun 15, 2002
|
||||
*
|
||||
* @version 1.0
|
||||
* @Since MAOS1.0
|
||||
*/
|
||||
|
||||
|
||||
package net.adaptivebox.global;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
public class GlobalFile {
|
||||
|
||||
// used by the createTempDir to give an index of temp number.
|
||||
private static int counter = -1;
|
||||
|
||||
/**
|
||||
* Create a temp directory in the given directory.
|
||||
* @param prefix the prefix for the directory.
|
||||
* @param directory the directory that the temp dirctory placed.
|
||||
* @return If a temp directory is created, return a File Object, else
|
||||
* return null.
|
||||
*/
|
||||
public static File createTempDir(String prefix, String directory)
|
||||
{
|
||||
File f = null;
|
||||
String tempDir;
|
||||
boolean isCreated = false;
|
||||
do {
|
||||
if (counter == -1) {
|
||||
counter = new Random().nextInt() & 0xffff;
|
||||
}
|
||||
counter++;
|
||||
if (prefix == null)
|
||||
throw new NullPointerException();
|
||||
if (prefix.length() < 3)
|
||||
throw new IllegalArgumentException("Prefix string too short");
|
||||
if (directory == null) {
|
||||
tempDir = prefix + counter;
|
||||
} else {
|
||||
tempDir = getFileLocation(directory, prefix + counter);
|
||||
}
|
||||
f = new File(tempDir);
|
||||
isCreated = f.mkdir();
|
||||
} while (!isCreated);
|
||||
return f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the given text string to the end of a given file.
|
||||
* @param inStr The string to be added.
|
||||
* @param fileStr the name of the file to be added.
|
||||
*/
|
||||
public static void addStringToFile(String inStr, String fileStr) throws Exception {
|
||||
|
||||
RandomAccessFile raFile = new RandomAccessFile(fileStr,"rw");
|
||||
raFile.seek(raFile.length());
|
||||
raFile.writeBytes(inStr);
|
||||
raFile.close();
|
||||
}
|
||||
|
||||
public static Object loadObjectFromFile(String fileName) throws Exception {
|
||||
FileInputStream fis = new FileInputStream(fileName);
|
||||
ObjectInputStream ois = new ObjectInputStream(fis);
|
||||
Object obj = ois.readObject();
|
||||
ois.close();
|
||||
return obj;
|
||||
}
|
||||
|
||||
public static void saveObjectToFile(String fileName, Object obj) throws Exception {
|
||||
FileOutputStream ostream = new FileOutputStream(fileName);
|
||||
ObjectOutputStream p = new ObjectOutputStream(ostream);
|
||||
p.writeObject(obj);
|
||||
p.flush();
|
||||
ostream.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the given text string to a given file.
|
||||
* @param inStr The string to be saved.
|
||||
* @param fileStr the name of the file to be saved.
|
||||
*/
|
||||
public static void saveStringToFile(String inStr, String fileStr) throws Exception{
|
||||
new File(new File(fileStr).getParent()).mkdirs();
|
||||
FileOutputStream pspOutputStream = null;
|
||||
try {
|
||||
pspOutputStream = new FileOutputStream(new File(fileStr));
|
||||
pspOutputStream.write(inStr.getBytes());
|
||||
} finally {
|
||||
if (pspOutputStream != null)
|
||||
pspOutputStream.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load text string from a given file.
|
||||
* @param fileStr the name of the file to be loaded.
|
||||
* @return A text string that is the content of the file. if the given file is
|
||||
* not exist, then return null.
|
||||
*/
|
||||
public static String getStringFromFile(String fileStr) throws Exception {
|
||||
String getStr = null;
|
||||
FileInputStream pspInputStream = null;
|
||||
try {
|
||||
pspInputStream = new FileInputStream(fileStr);
|
||||
byte[] pspFileBuffer = new byte[pspInputStream.available()];
|
||||
pspInputStream.read(pspFileBuffer);
|
||||
|
||||
getStr = new String(pspFileBuffer);
|
||||
} finally {
|
||||
if (pspInputStream != null)
|
||||
pspInputStream.close();
|
||||
}
|
||||
return getStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load curve data from a specified file.
|
||||
* @param fileName the name of the file to be loaded.
|
||||
* @return An ArrayList that include the curve data.
|
||||
*/
|
||||
public static ArrayList<ArrayList<Double>> getCurveDataFromFile(String fileName) {
|
||||
File file = new File(fileName);
|
||||
if(!file.exists()){
|
||||
return null;
|
||||
}
|
||||
//open data file
|
||||
FileInputStream inStream = null;
|
||||
BufferedReader inReader = null;
|
||||
try{
|
||||
inStream = new FileInputStream(file);
|
||||
inReader = new BufferedReader(new InputStreamReader(inStream));
|
||||
}catch(Exception e){
|
||||
return null;//Data file open error.
|
||||
}
|
||||
ArrayList<Double> xaxes = new ArrayList<Double>(1);
|
||||
ArrayList<Double> yaxes = new ArrayList<Double>(1);
|
||||
try{
|
||||
StringTokenizer st;
|
||||
String s;
|
||||
boolean start = false;
|
||||
while(inReader.ready()){
|
||||
st = new StringTokenizer(inReader.readLine());
|
||||
over:{
|
||||
while(!st.hasMoreTokens()){//Justify blank lines.
|
||||
if(inReader.ready()){
|
||||
st = new StringTokenizer(inReader.readLine());
|
||||
}else
|
||||
break over;
|
||||
}
|
||||
s = st.nextToken();
|
||||
if((!start)&&(!s.startsWith("@")))
|
||||
break over;
|
||||
if(!start){
|
||||
start = true;
|
||||
break over;
|
||||
}
|
||||
if(s.startsWith("#")||s.startsWith("$")||s.startsWith("/")) break over;//Justify comment line.
|
||||
Double xaxis = null;
|
||||
Double yaxis = null;
|
||||
try{
|
||||
xaxis = Double.valueOf(s);
|
||||
xaxes.add(xaxis);
|
||||
}catch(NumberFormatException e){
|
||||
inReader.close();
|
||||
inStream.close();
|
||||
return null;//Data file data format error.
|
||||
}
|
||||
s = st.nextToken();
|
||||
try{
|
||||
yaxis = Double.valueOf(s);
|
||||
yaxes.add(yaxis);
|
||||
}catch(NumberFormatException e){
|
||||
inReader.close();
|
||||
inStream.close();
|
||||
return null;//Data file data format error.
|
||||
}
|
||||
}
|
||||
}
|
||||
inReader.close();
|
||||
}catch(Exception e){
|
||||
return null;//Uncertain data file error.
|
||||
}
|
||||
ArrayList<ArrayList<Double>> curveData = new ArrayList<ArrayList<Double>>(2);
|
||||
curveData.add(xaxes);
|
||||
curveData.add(yaxes);
|
||||
return curveData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a full path of a given file name and a directory name.
|
||||
* @param fileName the name of the file.
|
||||
* @param dir the name of directory.
|
||||
* @return The full path.
|
||||
*/
|
||||
public static String getFileLocation(String dir, String fileName) {
|
||||
String realDir = dir;
|
||||
while (realDir.length()>0 && (realDir.endsWith("/")||realDir.endsWith("\\"))) {
|
||||
realDir = dir.substring(0, dir.length()-1);
|
||||
}
|
||||
return realDir+BasicTag.FILE_SEP_TAG+fileName;
|
||||
}
|
||||
|
||||
public static String getFileName(String nameBody, String suffix) {
|
||||
if (suffix==null || suffix.trim().length()==0) {
|
||||
return nameBody;
|
||||
}
|
||||
String fileName = nameBody;
|
||||
if(nameBody.endsWith(".")) {
|
||||
return fileName+suffix;
|
||||
} else {
|
||||
return nameBody+"."+suffix;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getFileLocation(String dir, String fileNameBody, String fileNameSuffix) {
|
||||
String filename = getFileName(fileNameBody, fileNameSuffix);
|
||||
return getFileLocation(dir, filename);
|
||||
}
|
||||
|
||||
public static void clear(String fileStr) throws Exception {
|
||||
File file = new File(fileStr);
|
||||
if(file.isFile()) {
|
||||
file.delete();
|
||||
return;
|
||||
}
|
||||
String[] fileNames = file.list();
|
||||
if (fileNames==null) {
|
||||
return;
|
||||
}
|
||||
for (int i=0; i<fileNames.length; i++) {
|
||||
String newFileName = GlobalFile.getFileLocation(fileStr,fileNames[i]);
|
||||
clear(newFileName);
|
||||
}
|
||||
file.delete();
|
||||
}
|
||||
|
||||
public static String getFilePrefix(String fileStr) {
|
||||
int index = fileStr.lastIndexOf(BasicTag.DOT_TAG);
|
||||
if(index==-1) index = fileStr.length();
|
||||
return fileStr.substring(0, index);
|
||||
}
|
||||
|
||||
public static String getFileSuffix(String fileStr) {
|
||||
String[] subNames = GlobalString.tokenize(fileStr, BasicTag.DOT_TAG);
|
||||
int subNameLen = subNames.length;
|
||||
if(subNameLen==1) return "";
|
||||
else return subNames[subNameLen-1];
|
||||
}
|
||||
|
||||
public static String createTempImageFile(String origFile) throws Exception {
|
||||
return createTempImageFile(origFile, "img", ".inf");
|
||||
}
|
||||
|
||||
public static String createTempImageFile(String origFile, String prefix, String suffix) throws Exception {
|
||||
File outputFile = createTempFile(prefix, suffix);
|
||||
outputFile.deleteOnExit();
|
||||
copyFile(outputFile.getAbsolutePath(), origFile);
|
||||
return outputFile.getAbsolutePath();
|
||||
}
|
||||
|
||||
public static void copyFile(String imgFile, String origFile) throws Exception {
|
||||
String fileContent = GlobalFile.getStringFromFile(origFile);
|
||||
GlobalFile.saveStringToFile(fileContent, imgFile);
|
||||
}
|
||||
|
||||
public static File createTempFile(String prefix, String suffix) throws Exception {
|
||||
String realSuffix = suffix;
|
||||
if (!realSuffix.startsWith(".")) realSuffix = "."+suffix;
|
||||
return File.createTempFile(prefix, realSuffix);
|
||||
}
|
||||
}
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
/**
|
||||
* Description: operations for the a text string.
|
||||
*
|
||||
* Author Create/Modi Note
|
||||
* Xiaofeng Xie Feb 22, 2001
|
||||
* Xiaofeng Xie May 12, 2004
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* Please acknowledge the author(s) if you use this code in any way.
|
||||
*
|
||||
* @version 1.0
|
||||
* @Since MAOS1.0
|
||||
*/
|
||||
|
||||
package net.adaptivebox.global;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class GlobalString {
|
||||
|
||||
/**
|
||||
* Tokenize a String with given key.
|
||||
*
|
||||
* @param input the String to be tokenized.
|
||||
* @param tokenKey the delimiters.
|
||||
* @return a String array that include the elements of input string that
|
||||
* divided by the tokenKey.
|
||||
*/
|
||||
public static String[] tokenize(String input, String tokenKey) {
|
||||
ArrayList<String> v = new ArrayList<String>();
|
||||
StringTokenizer t = new StringTokenizer(input, tokenKey);
|
||||
while (t.hasMoreTokens()) {
|
||||
v.add(t.nextToken());
|
||||
}
|
||||
return v.toArray(new String[v.size()]);
|
||||
}
|
||||
|
||||
}
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
/**
|
||||
* Description: Output methods for Array
|
||||
*
|
||||
* Author Create/Modi Note
|
||||
* Xiaofeng Xie Feb 22, 2001
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* Please acknowledge the author(s) if you use this code in any way.
|
||||
*
|
||||
* @version 1.0
|
||||
* @Since MAOS1.0
|
||||
*/
|
||||
|
||||
package net.adaptivebox.global;
|
||||
|
||||
|
||||
public class OutputMethods {
|
||||
|
||||
public static void outputVector(double[] vector){
|
||||
for(int i=0;i<vector.length;i++){
|
||||
System.out.print(vector[i]+" \t");
|
||||
}
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
||||
Vendored
-41
@@ -1,41 +0,0 @@
|
||||
/**
|
||||
* Description: For comparison of goodness in landscape with penalty method.
|
||||
*
|
||||
* @Applied domain: efficiently for ridge class feasible space (SF), such as
|
||||
* the problem with equality constraints
|
||||
*
|
||||
* Author Create/Modi Note
|
||||
* Xiaofeng Xie May 29, 2004
|
||||
*
|
||||
* @version 1.0
|
||||
*
|
||||
* [1] Runarsson T P, Yao X. Stochastic ranking for constrained evolutionary
|
||||
* optimization. IEEE Trans. on Evolutionary Computation. 2000, 4 (3): 284-294
|
||||
*
|
||||
*/
|
||||
|
||||
package net.adaptivebox.goodness;
|
||||
|
||||
import net.adaptivebox.global.*;
|
||||
|
||||
public class PenaltyComparator implements IGoodnessCompareEngine {
|
||||
public double Rg = 0;
|
||||
|
||||
public PenaltyComparator() {}
|
||||
|
||||
public PenaltyComparator(double rg) {
|
||||
this.Rg = rg;
|
||||
}
|
||||
|
||||
public double calcPenaltyValue(double fit1, double fit2) {
|
||||
return fit1+Rg*fit2;
|
||||
}
|
||||
/**
|
||||
* check the magnitude of two array, the frontial is more important
|
||||
* Stoch ranking: array size = 2
|
||||
**/
|
||||
public int compare(double[] fit1, double[] fit2) {
|
||||
return GlobalCompare.compare(calcPenaltyValue(fit1[1], fit1[0]), calcPenaltyValue(fit2[1], fit2[0]));
|
||||
}
|
||||
|
||||
}
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
/**
|
||||
* Description: For comparison of goodness in landscape with stoch. ranking.
|
||||
*
|
||||
* Author Create/Modi Note
|
||||
* Xiaofeng Xie May 29, 2004
|
||||
*
|
||||
* [1] Runarsson T P, Yao X. Stochastic ranking for constrained evolutionary
|
||||
* optimization. IEEE Trans. on Evolutionary Computation. 2000, 4 (3): 284-294
|
||||
*
|
||||
*/
|
||||
|
||||
package net.adaptivebox.goodness;
|
||||
|
||||
import net.adaptivebox.global.*;
|
||||
|
||||
public class SRComparator implements IGoodnessCompareEngine, IUpdateCycleEngine {
|
||||
public double Pf = 0.5;
|
||||
|
||||
public SRComparator() {}
|
||||
|
||||
public SRComparator(double pf) {
|
||||
this.Pf = pf;
|
||||
}
|
||||
|
||||
public void updateCycle(int t) {
|
||||
Pf *=0.995;
|
||||
}
|
||||
|
||||
/**
|
||||
* check the magnitude of two array, the frontial is more important
|
||||
* Stoch ranking: array size = 2
|
||||
**/
|
||||
public int compare(double[] fit1, double[] fit2) {
|
||||
if((fit1[0]==fit2[0])||Pf>Math.random()) {
|
||||
return GlobalCompare.compare(fit1[1], fit2[1]);
|
||||
} else {
|
||||
return GlobalCompare.compare(fit1[0], fit2[0]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
-4
@@ -32,10 +32,6 @@ public class Library {
|
||||
private final SearchPoint[] libPoints;
|
||||
private int gIndex = -1;
|
||||
|
||||
public Library(SearchPoint[] points){
|
||||
this.libPoints = points;
|
||||
}
|
||||
|
||||
public Library(int number, ProblemEncoder problemEncoder){
|
||||
libPoints = new SearchPoint[number];
|
||||
for (int i=0; i<number; i++) {
|
||||
|
||||
-4
@@ -53,10 +53,6 @@ public abstract class ProblemEncoder {
|
||||
return designSpace;
|
||||
}
|
||||
|
||||
public EvalStruct getEvalStruct() {
|
||||
return evalStruct;
|
||||
}
|
||||
|
||||
//set the default information for each dimension of search space (S)
|
||||
protected void setDefaultXAt(int i, double min, double max, double grain) {
|
||||
DesignDim dd = new DesignDim();
|
||||
|
||||
nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/problem/UnconstrainedProblemEncoder.java
Vendored
-40
@@ -1,40 +0,0 @@
|
||||
/**
|
||||
* Description: For unconstrained function
|
||||
*
|
||||
* Author Create/Modi Note
|
||||
* Xiaofeng Xie Dec 28, 2001
|
||||
* Xiaofeng Xie Mar 02, 2003
|
||||
* Xiaofeng Xie May 11, 2004
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* Please acknowledge the author(s) if you use this code in any way.
|
||||
*
|
||||
* @version 1.0
|
||||
* @Since MAOS1.0
|
||||
*/
|
||||
|
||||
package net.adaptivebox.problem;
|
||||
|
||||
import net.adaptivebox.global.*;
|
||||
|
||||
public abstract class UnconstrainedProblemEncoder extends ProblemEncoder {
|
||||
protected UnconstrainedProblemEncoder(int NX) throws Exception {
|
||||
super(NX, 1);
|
||||
setDefaultYAt(0, BasicBound.MINDOUBLE, BasicBound.MINDOUBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double calcTargetAt(int index, double[] VX) {
|
||||
return calcTarget(VX);
|
||||
}
|
||||
abstract public double calcTarget(double[] VX);
|
||||
}
|
||||
-5
@@ -72,11 +72,6 @@ public class DesignSpace {
|
||||
for(int i=0;i<tempX.length;i++) tempX[i] = dimProps[i].paramBound.getRandomValue(); //Global.RandomGenerator.doubleRangeRandom(9.8, 10);
|
||||
}
|
||||
|
||||
public double[] getFreshGene() {
|
||||
double[] tempX = new double[this.getDimension()];
|
||||
initializeGene(tempX);
|
||||
return tempX;
|
||||
}
|
||||
public void getMappingPoint(double[] point) {
|
||||
for(int i=0; i<getDimension(); i++) {
|
||||
point[i] = dimProps[i].paramBound.annulusAdjust(point[i]);
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/*************************************************************************
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* Copyright 2009 by Sun Microsystems, Inc.
|
||||
*
|
||||
* OpenOffice.org - a multi-platform office productivity suite
|
||||
*
|
||||
* This file is part of OpenOffice.org.
|
||||
*
|
||||
* OpenOffice.org is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License version 3
|
||||
* only, as published by the Free Software Foundation.
|
||||
*
|
||||
* OpenOffice.org is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License version 3 for more details
|
||||
* (a copy is included in the LICENSE file that accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* version 3 along with OpenOffice.org. If not, see
|
||||
* <http://www.openoffice.org/license.html>
|
||||
* for a copy of the LGPLv3 License.
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
package com.sun.star.comp.Calc.NLPSolver.dialogs;
|
||||
|
||||
/**
|
||||
* The ModalState is used to represent the state of the dialog when it closes.
|
||||
* "Exit" indicates no significant change (for example when the user presses
|
||||
* Cancel or simply closes the dialog). "OK" indicates for example, that the
|
||||
* user pressed the OK button.
|
||||
*/
|
||||
public enum ModalState {
|
||||
Exit
|
||||
}
|
||||
@@ -65,10 +65,6 @@ public abstract class BaseControl {
|
||||
properties = UnoRuntime.queryInterface(XPropertySet.class, unoModel);
|
||||
}
|
||||
|
||||
public Object getUnoControl() {
|
||||
return unoControl;
|
||||
}
|
||||
|
||||
public void setParentControl(BaseControl parentControl) {
|
||||
//TODO : remove from existing parentControl
|
||||
try {
|
||||
|
||||
@@ -315,54 +315,3 @@ public class RunnerService implements XJob, XServiceInfo,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -37,11 +37,9 @@ public class Job {
|
||||
Object oDoc = null;
|
||||
String actionType = null;
|
||||
String actionParm = null;
|
||||
private XMultiServiceFactory oMSF = null;
|
||||
|
||||
|
||||
public _Implementation(XMultiServiceFactory xMSF) {
|
||||
oMSF = xMSF;
|
||||
}
|
||||
|
||||
// XServiceInfo
|
||||
|
||||
@@ -53,7 +53,6 @@ $(eval $(call gb_Jar_add_sourcefiles,reportbuilder,\
|
||||
reportbuilder/java/org/libreoffice/report/ReportEngineMetaData \
|
||||
reportbuilder/java/org/libreoffice/report/ReportEngineParameterNames \
|
||||
reportbuilder/java/org/libreoffice/report/ReportExecutionException \
|
||||
reportbuilder/java/org/libreoffice/report/ReportExpressionMetaData \
|
||||
reportbuilder/java/org/libreoffice/report/ReportJob \
|
||||
reportbuilder/java/org/libreoffice/report/ReportJobDefinition \
|
||||
reportbuilder/java/org/libreoffice/report/ReportJobFactory \
|
||||
@@ -69,7 +68,6 @@ $(eval $(call gb_Jar_add_sourcefiles,reportbuilder,\
|
||||
reportbuilder/java/org/libreoffice/report/pentaho/DefaultNameGenerator \
|
||||
reportbuilder/java/org/libreoffice/report/pentaho/OfficeNamespaces \
|
||||
reportbuilder/java/org/libreoffice/report/pentaho/PentahoFormulaContext \
|
||||
reportbuilder/java/org/libreoffice/report/pentaho/PentahoReportAddIn \
|
||||
reportbuilder/java/org/libreoffice/report/pentaho/PentahoReportEngine \
|
||||
reportbuilder/java/org/libreoffice/report/pentaho/PentahoReportEngineMetaData \
|
||||
reportbuilder/java/org/libreoffice/report/pentaho/PentahoReportJob \
|
||||
@@ -83,7 +81,6 @@ $(eval $(call gb_Jar_add_sourcefiles,reportbuilder,\
|
||||
reportbuilder/java/org/libreoffice/report/pentaho/StarReportDataFactory \
|
||||
reportbuilder/java/org/libreoffice/report/pentaho/StarReportModule \
|
||||
reportbuilder/java/org/libreoffice/report/pentaho/expressions/SumExpression \
|
||||
reportbuilder/java/org/libreoffice/report/pentaho/expressions/SumExpressionMetaData \
|
||||
reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/AbstractReportElementLayoutController \
|
||||
reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FixedTextLayoutController \
|
||||
reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility \
|
||||
@@ -226,7 +223,6 @@ $(eval $(call gb_Jar_add_sourcefiles,reportbuilder,\
|
||||
reportbuilder/java/org/libreoffice/report/util/DefaultJobProperties \
|
||||
reportbuilder/java/org/libreoffice/report/util/DefaultParameterMap \
|
||||
reportbuilder/java/org/libreoffice/report/util/DefaultReportJobDefinition \
|
||||
reportbuilder/java/org/libreoffice/report/util/ManifestWriter \
|
||||
))
|
||||
|
||||
$(eval $(call gb_Jar_add_packagefiles,reportbuilder,,\
|
||||
|
||||
@@ -35,19 +35,6 @@ public class DataSourceException extends Exception
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new exception with the specified detail message. The cause is
|
||||
* not initialized, and may subsequently be initialized by a call to {@link
|
||||
* #initCause}.
|
||||
*
|
||||
* @param message the detail message. The detail message is saved for later
|
||||
* retrieval by the {@link #getMessage()} method.
|
||||
*/
|
||||
public DataSourceException(String message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new exception with the specified detail message and cause.
|
||||
* <p>Note that the detail message associated with <code>cause</code> is
|
||||
@@ -65,20 +52,4 @@ public class DataSourceException extends Exception
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new exception with the specified cause and a detail message of
|
||||
* <tt>(cause==null ? null : cause.toString())</tt> (which typically contains
|
||||
* the class and detail message of <tt>cause</tt>). This constructor is useful
|
||||
* for exceptions that are little more than wrappers for other throwables (for
|
||||
* example, {@link java.security.PrivilegedActionException}).
|
||||
*
|
||||
* @param cause the cause (which is saved for later retrieval by the {@link
|
||||
* #getCause()} method). (A <tt>null</tt> value is permitted,
|
||||
* and indicates that the cause is nonexistent or unknown.)
|
||||
* @since 1.4
|
||||
*/
|
||||
public DataSourceException(Throwable cause)
|
||||
{
|
||||
super(cause);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* 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 .
|
||||
*/
|
||||
package org.libreoffice.report;
|
||||
|
||||
public interface ReportExpressionMetaData
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -28,12 +28,9 @@ import com.sun.star.io.XInputStream;
|
||||
import com.sun.star.lang.WrappedTargetException;
|
||||
import com.sun.star.lang.XMultiComponentFactory;
|
||||
import com.sun.star.lib.uno.adapter.ByteArrayToXInputStreamAdapter;
|
||||
import com.sun.star.lib.uno.adapter.InputStreamToXInputStreamAdapter;
|
||||
import com.sun.star.uno.UnoRuntime;
|
||||
import com.sun.star.uno.XComponentContext;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
|
||||
public class SOImageService implements ImageService
|
||||
{
|
||||
@@ -62,11 +59,6 @@ public class SOImageService implements ImageService
|
||||
}
|
||||
}
|
||||
|
||||
public Size getImageSize(final InputStream image) throws ReportExecutionException
|
||||
{
|
||||
return getImageSize(new InputStreamToXInputStreamAdapter(image));
|
||||
}
|
||||
|
||||
private Size getImageSize(final XInputStream image) throws ReportExecutionException
|
||||
{
|
||||
final Size dim = new Size();
|
||||
@@ -163,11 +155,6 @@ public class SOImageService implements ImageService
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getMimeType(final InputStream image) throws ReportExecutionException
|
||||
{
|
||||
return getMimeType(new InputStreamToXInputStreamAdapter(image));
|
||||
}
|
||||
|
||||
public String getMimeType(final byte[] image) throws ReportExecutionException
|
||||
{
|
||||
return getMimeType(new ByteArrayToXInputStreamAdapter(image));
|
||||
|
||||
@@ -147,11 +147,6 @@ public class StorageRepository implements InputRepository, OutputRepository
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isWritable(final String name)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public Object getId()
|
||||
{
|
||||
return "1";
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* 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 .
|
||||
*/
|
||||
package org.libreoffice.report.pentaho;
|
||||
|
||||
import org.libreoffice.report.ReportExpressionMetaData;
|
||||
import org.libreoffice.report.pentaho.expressions.SumExpression;
|
||||
|
||||
/**
|
||||
* This class is a dummy implementation. Ignore it for now, we may extend this
|
||||
* one later.
|
||||
*/
|
||||
public class PentahoReportAddIn
|
||||
{
|
||||
|
||||
public SumExpression createExpression(final int expression)
|
||||
{
|
||||
return (expression == 0) ? new SumExpression() : null;
|
||||
}
|
||||
|
||||
public int getExpressionCount()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public ReportExpressionMetaData getMetaData(final int expression)
|
||||
{
|
||||
// todo implement me
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -35,11 +35,6 @@ public class PentahoReportEngine
|
||||
this.metaData = new PentahoReportEngineMetaData();
|
||||
}
|
||||
|
||||
public ReportEngineMetaData getMetaData()
|
||||
{
|
||||
return metaData;
|
||||
}
|
||||
|
||||
public ReportJobDefinition createJobDefinition()
|
||||
{
|
||||
return new DefaultReportJobDefinition(metaData);
|
||||
|
||||
@@ -92,43 +92,9 @@ public class PentahoReportEngineMetaData
|
||||
enumerationValues.add(CONTENT_TYPE, PentahoReportEngineMetaData.DEBUG);
|
||||
}
|
||||
|
||||
public Object[] getEnumerationValues(final String parameter)
|
||||
{
|
||||
return enumerationValues.toArray(parameter);
|
||||
}
|
||||
|
||||
public Class getParameterType(final String parameter)
|
||||
{
|
||||
return parameterTypes.get(parameter);
|
||||
}
|
||||
|
||||
public boolean isEnumeration(final String parameter)
|
||||
{
|
||||
return enumerationValues.containsKey(parameter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks, whether a certain output type is available. Feed the mime-type of the output
|
||||
* type in and you'll get a true or false back.
|
||||
*
|
||||
* @return true, if the output type is supported; false otherwise.
|
||||
*/
|
||||
public boolean isOutputSupported(final String mimeType)
|
||||
{
|
||||
return enumerationValues.containsValue(CONTENT_TYPE, mimeType.toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all supported output parameters for the given mime-type. This listing can be
|
||||
* used to build a generic user interface for configuring a certain output.
|
||||
*/
|
||||
public String[] getOutputParameters(final String mimeType)
|
||||
{
|
||||
return new String[0];
|
||||
}
|
||||
|
||||
public boolean isMandatory(final String parameter)
|
||||
{
|
||||
return mandatoryParameters.contains(parameter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,6 @@ public class PentahoReportJob implements ReportJob
|
||||
{
|
||||
|
||||
private static final Log LOGGER = LogFactory.getLog(PentahoReportJob.class);
|
||||
private boolean finished;
|
||||
private final DataSourceFactory dataSourceFactory;
|
||||
private final OutputRepository outputRepository;
|
||||
private final JobProperties jobProperties;
|
||||
@@ -82,15 +81,9 @@ public class PentahoReportJob implements ReportJob
|
||||
private final String outputName;
|
||||
private final ImageService imageService;
|
||||
private final InputRepository inputRepository;
|
||||
private final ReportJobDefinition definition;
|
||||
private final List masterValues;
|
||||
private final List detailColumns;
|
||||
|
||||
public ReportJobDefinition getDefinition()
|
||||
{
|
||||
return definition;
|
||||
}
|
||||
|
||||
public PentahoReportJob(final ReportJobDefinition definition)
|
||||
throws JobDefinitionException
|
||||
{
|
||||
@@ -99,7 +92,6 @@ public class PentahoReportJob implements ReportJob
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
this.definition = definition;
|
||||
this.jobProperties = definition.getProcessingParameters().copy();
|
||||
|
||||
this.dataSourceFactory = (DataSourceFactory) jobProperties.getProperty(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY);
|
||||
@@ -176,37 +168,6 @@ public class PentahoReportJob implements ReportJob
|
||||
return tempReport;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interrupt the job.
|
||||
*/
|
||||
public void interrupt()
|
||||
{
|
||||
// hey, not yet ..
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries the jobs result status.
|
||||
*
|
||||
* @return true, if the job is finished (or has been interrupted), false if the job
|
||||
* waits for activation.
|
||||
*/
|
||||
public boolean isFinished()
|
||||
{
|
||||
return finished;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Queries the jobs execution status.
|
||||
*
|
||||
* @return true, if the job is currently running, false otherwise.
|
||||
*/
|
||||
public boolean isRunning()
|
||||
{
|
||||
return !finished;
|
||||
}
|
||||
|
||||
private void collectGroupExpressions(final Node[] nodes, final List<Object[]> expressions, final FormulaParser parser, final Expression reportFunctions[])
|
||||
{
|
||||
for (int i = 0; i < nodes.length; i++)
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.pentaho.reporting.libraries.base.boot.AbstractModule;
|
||||
import org.pentaho.reporting.libraries.base.boot.ModuleInitializeException;
|
||||
import org.pentaho.reporting.libraries.base.boot.SubSystem;
|
||||
|
||||
@SuppressWarnings("ucd")
|
||||
public class StarReportModule extends AbstractModule
|
||||
{
|
||||
|
||||
|
||||
@@ -17,26 +17,7 @@
|
||||
*/
|
||||
package org.libreoffice.report.pentaho.expressions;
|
||||
|
||||
import org.libreoffice.report.DataRow;
|
||||
|
||||
public class SumExpression
|
||||
{
|
||||
|
||||
private Object[] parameters;
|
||||
|
||||
public Object getParameters()
|
||||
{
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public Object getValue(final DataRow row)
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setParameters(final Object[] parameters)
|
||||
{
|
||||
this.parameters = parameters;
|
||||
}
|
||||
}
|
||||
|
||||
-69
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* 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 .
|
||||
*/
|
||||
package org.libreoffice.report.pentaho.expressions;
|
||||
|
||||
import org.libreoffice.report.ReportExpressionMetaData;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
||||
public class SumExpressionMetaData implements ReportExpressionMetaData
|
||||
{
|
||||
|
||||
public String getDescription(final Locale l)
|
||||
{
|
||||
// todo implement me
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getDisplayName(final Locale l)
|
||||
{
|
||||
// todo implement me
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
// todo implement me
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getParameterCount()
|
||||
{
|
||||
// todo implement me
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getParameterDescription(final int param, final Locale locale)
|
||||
{
|
||||
// todo implement me
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getParameterDisplayName(final int param, final Locale locale)
|
||||
{
|
||||
// todo implement me
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getParameterName(final int param)
|
||||
{
|
||||
// todo implement me
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-14
@@ -26,29 +26,15 @@ package org.libreoffice.report.pentaho.layoutprocessor;
|
||||
public class ImageElementContext
|
||||
{
|
||||
|
||||
private final int colSpan;
|
||||
private final int rowSpan;
|
||||
private String[] rowStyles;
|
||||
private String[] colStyles;
|
||||
|
||||
public ImageElementContext(final int colSpan, final int rowSpan)
|
||||
{
|
||||
this.colSpan = colSpan;
|
||||
this.rowSpan = rowSpan;
|
||||
this.colStyles = new String[colSpan];
|
||||
this.rowStyles = new String[rowSpan];
|
||||
}
|
||||
|
||||
public int getColSpan()
|
||||
{
|
||||
return colSpan;
|
||||
}
|
||||
|
||||
public int getRowSpan()
|
||||
{
|
||||
return rowSpan;
|
||||
}
|
||||
|
||||
public String[] getRowStyles()
|
||||
{
|
||||
return rowStyles;
|
||||
|
||||
-7
@@ -37,7 +37,6 @@ import java.util.List;
|
||||
public class VariablesCollection
|
||||
{
|
||||
|
||||
private VariablesCollection parent;
|
||||
private String namePrefix;
|
||||
private List<FormattedTextElement> variables;
|
||||
|
||||
@@ -54,15 +53,9 @@ public class VariablesCollection
|
||||
}
|
||||
|
||||
this.namePrefix = namePrefix;
|
||||
this.parent = parent;
|
||||
this.variables = new ArrayList<FormattedTextElement>();
|
||||
}
|
||||
|
||||
public VariablesCollection getParent()
|
||||
{
|
||||
return parent;
|
||||
}
|
||||
|
||||
public String getNamePrefix()
|
||||
{
|
||||
return namePrefix;
|
||||
|
||||
@@ -30,7 +30,6 @@ import org.pentaho.reporting.libraries.resourceloader.ResourceKey;
|
||||
import org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException;
|
||||
import org.pentaho.reporting.libraries.resourceloader.ResourceLoader;
|
||||
import org.pentaho.reporting.libraries.resourceloader.ResourceLoadingException;
|
||||
import org.pentaho.reporting.libraries.resourceloader.ResourceManager;
|
||||
import org.pentaho.reporting.libraries.resourceloader.loader.LoaderUtils;
|
||||
|
||||
|
||||
@@ -38,7 +37,6 @@ public class InputRepositoryLoader implements ResourceLoader
|
||||
{
|
||||
|
||||
private final InputRepository inputRepository;
|
||||
private ResourceManager resourceManager;
|
||||
|
||||
public InputRepositoryLoader(final InputRepository inputRepository)
|
||||
{
|
||||
@@ -147,16 +145,6 @@ public class InputRepositoryLoader implements ResourceLoader
|
||||
return new InputRepositoryResourceData(key, inputRepository);
|
||||
}
|
||||
|
||||
public void setResourceManager(final ResourceManager manager)
|
||||
{
|
||||
this.resourceManager = manager;
|
||||
}
|
||||
|
||||
public ResourceManager getResourceManager()
|
||||
{
|
||||
return resourceManager;
|
||||
}
|
||||
|
||||
public boolean isSupportedDeserializer(String string)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
|
||||
@@ -34,8 +34,4 @@ public class DataStyle extends Section
|
||||
return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name");
|
||||
}
|
||||
|
||||
public void setStyleName(final String name)
|
||||
{
|
||||
setAttribute(OfficeNamespaces.STYLE_NS, "name", name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,8 +34,4 @@ public class FontFaceElement extends Section
|
||||
return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name");
|
||||
}
|
||||
|
||||
public void setStyleName(final String name)
|
||||
{
|
||||
setAttribute(OfficeNamespaces.STYLE_NS, "name", name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,11 +61,6 @@ public class ImageElement extends ReportElement
|
||||
return OfficeToken.TRUE.equals(getAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.PRESERVE_IRI));
|
||||
}
|
||||
|
||||
public void setPreserveIRI(final boolean preserveIRI)
|
||||
{
|
||||
setAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.PRESERVE_IRI, String.valueOf(preserveIRI));
|
||||
}
|
||||
|
||||
public String getImageData()
|
||||
{
|
||||
return (String) getAttribute(OfficeNamespaces.FORM_NS, OfficeToken.IMAGE_DATA);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
*/
|
||||
package org.libreoffice.report.pentaho.model;
|
||||
|
||||
import org.libreoffice.report.OfficeToken;
|
||||
import org.libreoffice.report.pentaho.OfficeNamespaces;
|
||||
|
||||
import org.jfree.report.JFreeReportInfo;
|
||||
@@ -33,16 +32,6 @@ import org.jfree.report.structure.Section;
|
||||
public class OfficeGroup extends Section
|
||||
{
|
||||
|
||||
public boolean isStartNewColumn()
|
||||
{
|
||||
return OfficeToken.TRUE.equals(getAttribute(OfficeNamespaces.OOREPORT_NS, "start-new-column"));
|
||||
}
|
||||
|
||||
public boolean isResetPageNumber()
|
||||
{
|
||||
return OfficeToken.TRUE.equals(getAttribute(OfficeNamespaces.OOREPORT_NS, "reset-page-number"));
|
||||
}
|
||||
|
||||
public OfficeGroupSection getHeader()
|
||||
{
|
||||
final OfficeGroupInstanceSection instanceSection =
|
||||
|
||||
@@ -87,21 +87,11 @@ public class OfficeReport extends Element
|
||||
return columnHeader;
|
||||
}
|
||||
|
||||
public void setColumnHeader(final Node columnHeader)
|
||||
{
|
||||
this.columnHeader = columnHeader;
|
||||
}
|
||||
|
||||
public Node getColumnFooter()
|
||||
{
|
||||
return columnFooter;
|
||||
}
|
||||
|
||||
public void setColumnFooter(final Node columnFooter)
|
||||
{
|
||||
this.columnFooter = columnFooter;
|
||||
}
|
||||
|
||||
public Node getReportHeader()
|
||||
{
|
||||
return reportHeader;
|
||||
|
||||
@@ -87,21 +87,11 @@ public class OfficeStyle extends Section
|
||||
return findFirstChild(OfficeNamespaces.STYLE_NS, "table-row-properties");
|
||||
}
|
||||
|
||||
public Element getTableProperties()
|
||||
{
|
||||
return findFirstChild(OfficeNamespaces.STYLE_NS, "table-properties");
|
||||
}
|
||||
|
||||
public Element getTableColumnProperties()
|
||||
{
|
||||
return findFirstChild(OfficeNamespaces.STYLE_NS, "table-column-properties");
|
||||
}
|
||||
|
||||
public Element getSectionProperties()
|
||||
{
|
||||
return findFirstChild(OfficeNamespaces.STYLE_NS, "section-properties");
|
||||
}
|
||||
|
||||
public Element getTableCellProperties()
|
||||
{
|
||||
return findFirstChild(OfficeNamespaces.STYLE_NS, "table-cell-properties");
|
||||
|
||||
@@ -20,29 +20,8 @@ package org.libreoffice.report.pentaho.parser;
|
||||
public final class AttributeSpecification
|
||||
{
|
||||
|
||||
private final String namespaceUrl;
|
||||
private final String attributName;
|
||||
private final String mapperImplementation;
|
||||
|
||||
public AttributeSpecification(String namespaceUrl, String attributName, String mapperImplementation)
|
||||
{
|
||||
this.namespaceUrl = namespaceUrl;
|
||||
this.attributName = attributName;
|
||||
this.mapperImplementation = mapperImplementation;
|
||||
}
|
||||
|
||||
public String getAttributName()
|
||||
{
|
||||
return attributName;
|
||||
}
|
||||
|
||||
public String getMapperImplementation()
|
||||
{
|
||||
return mapperImplementation;
|
||||
}
|
||||
|
||||
public String getNamespaceUrl()
|
||||
{
|
||||
return namespaceUrl;
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -27,6 +27,7 @@ import org.jfree.report.modules.factories.report.base.JFreeReportXmlResourceFact
|
||||
*
|
||||
* @since 09.03.2007
|
||||
*/
|
||||
@SuppressWarnings("ucd")
|
||||
public class OfficeDocumentXmlResourceFactory extends JFreeReportXmlResourceFactory
|
||||
{
|
||||
|
||||
|
||||
+1
@@ -30,6 +30,7 @@ import org.pentaho.reporting.libraries.xmlns.parser.AbstractXmlResourceFactory;
|
||||
*
|
||||
* @since 09.03.2007
|
||||
*/
|
||||
@SuppressWarnings("ucd")
|
||||
public class OfficeStylesXmlResourceFactory extends AbstractXmlResourceFactory
|
||||
{
|
||||
|
||||
|
||||
+1
@@ -24,6 +24,7 @@ import org.pentaho.reporting.libraries.xmlns.parser.XmlDocumentInfo;
|
||||
import org.pentaho.reporting.libraries.xmlns.parser.XmlFactoryModule;
|
||||
import org.pentaho.reporting.libraries.xmlns.parser.XmlReadHandler;
|
||||
|
||||
@SuppressWarnings("ucd")
|
||||
public class StarStyleXmlFactoryModule implements XmlFactoryModule
|
||||
{
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.pentaho.reporting.libraries.xmlns.parser.XmlDocumentInfo;
|
||||
import org.pentaho.reporting.libraries.xmlns.parser.XmlFactoryModule;
|
||||
import org.pentaho.reporting.libraries.xmlns.parser.XmlReadHandler;
|
||||
|
||||
@SuppressWarnings("ucd")
|
||||
public class StarXmlFactoryModule implements XmlFactoryModule
|
||||
{
|
||||
|
||||
|
||||
-5
@@ -52,11 +52,6 @@ public class FontFaceDeclsReadHandler extends ElementReadHandler
|
||||
this.fontFaceReadHandlers = new ArrayList<FontFaceReadHandler>();
|
||||
}
|
||||
|
||||
public FontFaceDeclsSection getFontFaceDecls()
|
||||
{
|
||||
return fontFaceDecls;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the handler for a child element.
|
||||
*
|
||||
|
||||
-5
@@ -53,11 +53,6 @@ public class MasterStylesReadHandler extends ElementReadHandler
|
||||
this.otherHandlers = new ArrayList<ElementReadHandler>();
|
||||
}
|
||||
|
||||
public OfficeMasterStyles getMasterStyles()
|
||||
{
|
||||
return masterStyles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the handler for a child element.
|
||||
*
|
||||
|
||||
-5
@@ -37,11 +37,6 @@ public class SubDocumentReadHandler extends NoCDATATextContentReadHandler
|
||||
private final ObjectOleElement element;
|
||||
private boolean ignore = false;
|
||||
|
||||
public SubDocumentReadHandler(final ObjectOleElement element)
|
||||
{
|
||||
this.element = element;
|
||||
}
|
||||
|
||||
private SubDocumentReadHandler(final Section section, final ObjectOleElement element)
|
||||
{
|
||||
super(section);
|
||||
|
||||
-5
@@ -30,11 +30,6 @@ import org.xml.sax.SAXException;
|
||||
public class TextContentReadHandler extends NoCDATATextContentReadHandler
|
||||
{
|
||||
|
||||
public TextContentReadHandler(final Section section, final boolean copyType)
|
||||
{
|
||||
super(section, copyType);
|
||||
}
|
||||
|
||||
public TextContentReadHandler(final Section section)
|
||||
{
|
||||
super(section);
|
||||
|
||||
@@ -32,9 +32,6 @@ public class XLinkReadHandler extends AbstractXmlReadHandler
|
||||
{
|
||||
|
||||
private String uri;
|
||||
private String type;
|
||||
private String show;
|
||||
private String actuate;
|
||||
|
||||
/**
|
||||
* Starts parsing.
|
||||
@@ -46,9 +43,6 @@ public class XLinkReadHandler extends AbstractXmlReadHandler
|
||||
protected void startParsing(final Attributes attrs) throws SAXException
|
||||
{
|
||||
uri = attrs.getValue(OfficeNamespaces.XLINK_NS, "uri");
|
||||
type = attrs.getValue(OfficeNamespaces.XLINK_NS, "type");
|
||||
show = attrs.getValue(OfficeNamespaces.XLINK_NS, "show");
|
||||
actuate = attrs.getValue(OfficeNamespaces.XLINK_NS, "actuate");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,18 +62,4 @@ public class XLinkReadHandler extends AbstractXmlReadHandler
|
||||
return uri;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getShow()
|
||||
{
|
||||
return show;
|
||||
}
|
||||
|
||||
public String getActuate()
|
||||
{
|
||||
return actuate;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,26 +52,6 @@ public final class StyleMapperKey
|
||||
this.hashCode = computeHashCode();
|
||||
}
|
||||
|
||||
public String getElementNamespace()
|
||||
{
|
||||
return elementNamespace;
|
||||
}
|
||||
|
||||
public String getElementName()
|
||||
{
|
||||
return elementName;
|
||||
}
|
||||
|
||||
public String getAttributeNamespace()
|
||||
{
|
||||
return attributeNamespace;
|
||||
}
|
||||
|
||||
public String getAttributeName()
|
||||
{
|
||||
return attributeName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o)
|
||||
{
|
||||
|
||||
+1
@@ -26,6 +26,7 @@ import org.pentaho.reporting.libraries.xmlns.parser.XmlReadHandler;
|
||||
*
|
||||
* @since 12.03.2007
|
||||
*/
|
||||
@SuppressWarnings("ucd")
|
||||
public class StyleMapperXmlFactoryModule implements XmlFactoryModule
|
||||
{
|
||||
|
||||
|
||||
+1
@@ -27,6 +27,7 @@ import org.pentaho.reporting.libraries.xmlns.parser.AbstractXmlResourceFactory;
|
||||
*
|
||||
* @since 12.03.2007
|
||||
*/
|
||||
@SuppressWarnings("ucd")
|
||||
public class StyleMapperXmlResourceFactory extends AbstractXmlResourceFactory
|
||||
{
|
||||
|
||||
|
||||
@@ -33,11 +33,6 @@ public class DefaultParameterMap implements ParameterMap
|
||||
backend = new HashMap<String,Object>();
|
||||
}
|
||||
|
||||
public void clear()
|
||||
{
|
||||
backend.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the value stored for a key in this properties collection.
|
||||
*
|
||||
@@ -54,61 +49,9 @@ public class DefaultParameterMap implements ParameterMap
|
||||
return backend.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the value stored for a key in this properties collection, and returning the
|
||||
* default value if the key was not stored in this properties collection.
|
||||
*
|
||||
* @param key the property key.
|
||||
* @param defaultValue the default value to be returned when the key is not stored in
|
||||
* this properties collection.
|
||||
* @return The stored value, or the default value if the key does not exist in this
|
||||
* collection.
|
||||
*/
|
||||
public Object get(final String key, final Object defaultValue)
|
||||
{
|
||||
if (key == null)
|
||||
{
|
||||
throw new NullPointerException("DefaultParameterMap.get (..): Parameter 'key' must not be null");
|
||||
}
|
||||
final Object o = this.backend.get(key);
|
||||
if (o == null)
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
return o;
|
||||
}
|
||||
|
||||
public String[] keys()
|
||||
{
|
||||
return this.backend.keySet().toArray(new String[backend.size()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a property to this properties collection. If a property with the given name
|
||||
* exist, the property will be replaced with the new value. If the value is null, the
|
||||
* property will be removed.
|
||||
*
|
||||
* @param key the property key.
|
||||
* @param value the property value.
|
||||
*/
|
||||
public void put(final String key, final Object value)
|
||||
{
|
||||
if (key == null)
|
||||
{
|
||||
throw new NullPointerException("ReportProperties.put (..): Parameter 'key' must not be null");
|
||||
}
|
||||
if (value == null)
|
||||
{
|
||||
this.backend.remove(key);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.backend.put(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
public int size()
|
||||
{
|
||||
return this.backend.size();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,14 +17,9 @@
|
||||
*/
|
||||
package org.libreoffice.report.util;
|
||||
|
||||
import org.libreoffice.report.DataSourceFactory;
|
||||
import org.libreoffice.report.InputRepository;
|
||||
import org.libreoffice.report.JobDefinitionException;
|
||||
import org.libreoffice.report.JobProperties;
|
||||
import org.libreoffice.report.OutputRepository;
|
||||
import org.libreoffice.report.ParameterMap;
|
||||
import org.libreoffice.report.ReportEngineMetaData;
|
||||
import org.libreoffice.report.ReportEngineParameterNames;
|
||||
import org.libreoffice.report.ReportJobDefinition;
|
||||
|
||||
public class DefaultReportJobDefinition implements ReportJobDefinition
|
||||
@@ -40,39 +35,6 @@ public class DefaultReportJobDefinition implements ReportJobDefinition
|
||||
this.properties = new DefaultJobProperties(metaData);
|
||||
}
|
||||
|
||||
public void setDataSourceFactory(final DataSourceFactory dataSourceFactory)
|
||||
throws JobDefinitionException
|
||||
{
|
||||
this.properties.setProperty(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY, dataSourceFactory);
|
||||
}
|
||||
|
||||
public DataSourceFactory getDataSourceFactory()
|
||||
{
|
||||
return (DataSourceFactory) this.properties.getProperty(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY);
|
||||
}
|
||||
|
||||
public InputRepository getInputRepository()
|
||||
{
|
||||
return (InputRepository) this.properties.getProperty(ReportEngineParameterNames.INPUT_REPOSITORY);
|
||||
}
|
||||
|
||||
public void setInputRepository(final InputRepository inputRepository)
|
||||
throws JobDefinitionException
|
||||
{
|
||||
this.properties.setProperty(ReportEngineParameterNames.INPUT_REPOSITORY, inputRepository);
|
||||
}
|
||||
|
||||
public OutputRepository getOutputRepository()
|
||||
{
|
||||
return (OutputRepository) this.properties.getProperty(ReportEngineParameterNames.OUTPUT_REPOSITORY);
|
||||
}
|
||||
|
||||
public void setOutputRepository(final OutputRepository outputRepository)
|
||||
throws JobDefinitionException
|
||||
{
|
||||
this.properties.setProperty(ReportEngineParameterNames.OUTPUT_REPOSITORY, outputRepository);
|
||||
}
|
||||
|
||||
/**
|
||||
* The parameters of the root report definition. The parameters for the subreports are
|
||||
* defined using mappings, it would not make sense to define them here.
|
||||
@@ -84,22 +46,6 @@ public class DefaultReportJobDefinition implements ReportJobDefinition
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public void setReportDefinitionName(final String reportDefinitionName)
|
||||
throws JobDefinitionException
|
||||
{
|
||||
this.properties.setProperty(ReportEngineParameterNames.INPUT_NAME, reportDefinitionName);
|
||||
}
|
||||
|
||||
/**
|
||||
* The name under which we can load the report definition.
|
||||
*
|
||||
* @return the report definition's name.
|
||||
*/
|
||||
public String getReportDefinitionName()
|
||||
{
|
||||
return (String) this.properties.getProperty(ReportEngineParameterNames.INPUT_NAME);
|
||||
}
|
||||
|
||||
public JobProperties getProcessingParameters()
|
||||
{
|
||||
return properties;
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
/*
|
||||
* 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 .
|
||||
*/
|
||||
package org.libreoffice.report.util;
|
||||
|
||||
import org.libreoffice.report.OutputRepository;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jfree.report.JFreeReportBoot;
|
||||
|
||||
import org.pentaho.reporting.libraries.xmlns.common.AttributeList;
|
||||
import org.pentaho.reporting.libraries.xmlns.writer.DefaultTagDescription;
|
||||
import org.pentaho.reporting.libraries.xmlns.writer.XmlWriter;
|
||||
import org.pentaho.reporting.libraries.xmlns.writer.XmlWriterSupport;
|
||||
|
||||
|
||||
/**
|
||||
* Creation-Date: 24.07.2007, 18:16:52
|
||||
*
|
||||
*/
|
||||
public class ManifestWriter
|
||||
{
|
||||
// need this two strings other it breaks the ooo build :-(
|
||||
|
||||
public static final String MANIFEST_NS = "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0";
|
||||
public static final String TAG_DEF_PREFIX = "org.libreoffice.report.pentaho.output.";
|
||||
private final Map<String,String> entries;
|
||||
|
||||
public ManifestWriter()
|
||||
{
|
||||
entries = new HashMap<String,String>();
|
||||
}
|
||||
|
||||
public void addEntry(final String fullPath, final String mimeType)
|
||||
{
|
||||
if (fullPath == null)
|
||||
{
|
||||
throw new NullPointerException();
|
||||
}
|
||||
if (mimeType == null)
|
||||
{
|
||||
throw new NullPointerException();
|
||||
}
|
||||
if ("META-INF/manifest.xml".equals(fullPath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
entries.put(fullPath, mimeType);
|
||||
}
|
||||
|
||||
public boolean isEmpty()
|
||||
{
|
||||
return entries.isEmpty();
|
||||
}
|
||||
|
||||
public void write(final OutputRepository outputRepository) throws IOException
|
||||
{
|
||||
if (isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final DefaultTagDescription tagDescription = new DefaultTagDescription();
|
||||
tagDescription.configure(JFreeReportBoot.getInstance().getGlobalConfig(),
|
||||
TAG_DEF_PREFIX);
|
||||
|
||||
final OutputStream manifestOutputStream =
|
||||
outputRepository.createOutputStream("META-INF/manifest.xml", "text/xml");
|
||||
|
||||
final OutputStreamWriter writer = new OutputStreamWriter(manifestOutputStream, "UTF-8");
|
||||
final XmlWriter xmlWriter = new XmlWriter(writer, tagDescription);
|
||||
xmlWriter.setAlwaysAddNamespace(true);
|
||||
xmlWriter.writeXmlDeclaration("UTF-8");
|
||||
|
||||
final AttributeList rootAttributes = new AttributeList();
|
||||
rootAttributes.addNamespaceDeclaration("manifest", MANIFEST_NS);
|
||||
xmlWriter.writeTag(MANIFEST_NS, "manifest", rootAttributes, XmlWriterSupport.OPEN);
|
||||
|
||||
final Iterator<Map.Entry<String,String>> iterator = entries.entrySet().iterator();
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
final Map.Entry<String,String> entry = iterator.next();
|
||||
final AttributeList entryAttrs = new AttributeList();
|
||||
entryAttrs.setAttribute(MANIFEST_NS, "media-type", entry.getValue());
|
||||
entryAttrs.setAttribute(MANIFEST_NS, "full-path", entry.getKey());
|
||||
xmlWriter.writeTag(MANIFEST_NS, "file-entry", entryAttrs, XmlWriterSupport.CLOSE);
|
||||
}
|
||||
|
||||
xmlWriter.writeCloseTag();
|
||||
xmlWriter.close();
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,6 @@ import com.sun.star.uno.UnoRuntime;
|
||||
|
||||
public class Test01 implements PasswordContainerTest {
|
||||
private XMultiServiceFactory m_xMSF = null;
|
||||
XPasswordContainer m_xPasswordContainer = null;
|
||||
private TestHelper m_aTestHelper = null;
|
||||
|
||||
public Test01 ( XMultiServiceFactory xMSF )
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.sun.star.uno.UnoRuntime;
|
||||
|
||||
public class Test02 implements PasswordContainerTest {
|
||||
private XMultiServiceFactory m_xMSF = null;
|
||||
XPasswordContainer m_xPasswordContainer = null;
|
||||
private TestHelper m_aTestHelper = null;
|
||||
|
||||
public Test02 ( XMultiServiceFactory xMSF )
|
||||
|
||||
@@ -31,7 +31,6 @@ import com.sun.star.uno.UnoRuntime;
|
||||
|
||||
public class Test03 implements PasswordContainerTest {
|
||||
private XMultiServiceFactory m_xMSF = null;
|
||||
XPasswordContainer m_xPasswordContainer = null;
|
||||
private TestHelper m_aTestHelper = null;
|
||||
|
||||
public Test03 ( XMultiServiceFactory xMSF )
|
||||
|
||||
@@ -41,7 +41,6 @@ public class Settings
|
||||
|
||||
|
||||
private final XComponentContext m_xContext;
|
||||
private int lastUsedWikiServer = 0;
|
||||
private final List<Map<String, String>> m_WikiConnections = new ArrayList<Map<String, String>>();
|
||||
private final List<Map<String, Object>> m_aWikiDocs = new ArrayList<Map<String, Object>>();
|
||||
|
||||
@@ -66,11 +65,6 @@ public class Settings
|
||||
}
|
||||
|
||||
|
||||
public List<Map<String, String>> getWikiCons()
|
||||
{
|
||||
return m_WikiConnections;
|
||||
}
|
||||
|
||||
private String getWikiConUrlByNumber( int num )
|
||||
{
|
||||
String url = "";
|
||||
@@ -103,11 +97,6 @@ public class Settings
|
||||
}
|
||||
|
||||
|
||||
public List<Map<String, Object>> getWikiDocs()
|
||||
{
|
||||
return m_aWikiDocs;
|
||||
}
|
||||
|
||||
public Object[] getWikiDocList( int serverid )
|
||||
{
|
||||
String wikiserverurl = getWikiConUrlByNumber( serverid );
|
||||
@@ -125,14 +114,8 @@ public class Settings
|
||||
return theDocs.toArray( docs );
|
||||
}
|
||||
|
||||
public int getLastUsedWikiServer()
|
||||
{
|
||||
return lastUsedWikiServer;
|
||||
}
|
||||
|
||||
public void setLastUsedWikiServer( int l )
|
||||
{
|
||||
lastUsedWikiServer = l;
|
||||
}
|
||||
|
||||
public String[] getWikiURLs()
|
||||
|
||||
@@ -38,16 +38,8 @@ import com.sun.star.uno.UnoRuntime;
|
||||
*/
|
||||
public class _XAccessibleExtendedComponent {
|
||||
|
||||
private static final String className =
|
||||
"com.sun.star.accessibility.XAccessibleExtendedComponent" ;
|
||||
|
||||
private final XAccessibleExtendedComponent oObj;
|
||||
|
||||
// temporary while accessibility package is in com.sun.star
|
||||
protected String getTestedClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
public _XAccessibleExtendedComponent(XInterface object/*, LogWriter log*/) {
|
||||
oObj = UnoRuntime.queryInterface(XAccessibleExtendedComponent.class, object);
|
||||
}
|
||||
|
||||
@@ -94,11 +94,6 @@ final public class GridDataListener implements XGridDataListener
|
||||
return m_rowHeadingChangeEvent;
|
||||
}
|
||||
|
||||
public final boolean isDisposed()
|
||||
{
|
||||
return m_disposed;
|
||||
}
|
||||
|
||||
public final void reset()
|
||||
{
|
||||
m_rowInsertionEvent = m_rowRemovalEvent = m_dataChangeEvent = m_rowHeadingChangeEvent = null;
|
||||
|
||||
@@ -23,7 +23,6 @@ import com.sun.star.accessibility.XAccessible;
|
||||
import com.sun.star.accessibility.XAccessibleComponent;
|
||||
import com.sun.star.accessibility.XAccessibleContext;
|
||||
import com.sun.star.accessibility.XAccessibleEditableText;
|
||||
import com.sun.star.accessibility.XAccessibleExtendedComponent;
|
||||
import com.sun.star.accessibility.XAccessibleSelection;
|
||||
import com.sun.star.accessibility.XAccessibleTable;
|
||||
import com.sun.star.accessibility.XAccessibleText;
|
||||
@@ -52,24 +51,17 @@ class AccTreeNode
|
||||
private ArrayList<HandlerDescriptor> maHandlers;
|
||||
|
||||
// The accessible context of this node.
|
||||
private XAccessible mxAccessible;
|
||||
private XAccessibleContext mxContext;
|
||||
private XAccessibleComponent mxComponent;
|
||||
private XAccessibleText mxText;
|
||||
private XAccessibleTable mxTable;
|
||||
|
||||
public AccTreeNode (XAccessible xAccessible, XAccessibleContext xContext, AccessibleTreeNode aParent)
|
||||
{
|
||||
this (xAccessible, xContext, xContext, aParent);
|
||||
}
|
||||
|
||||
public AccTreeNode (XAccessible xAccessible, XAccessibleContext xContext, Object aDisplay, AccessibleTreeNode aParent)
|
||||
{
|
||||
super (aDisplay, aParent);
|
||||
|
||||
maHandlers = new ArrayList<HandlerDescriptor>(5);
|
||||
mxContext = xContext;
|
||||
mxAccessible = xAccessible;
|
||||
}
|
||||
|
||||
/** Update the internal data extracted from the corresponding accessible
|
||||
@@ -102,17 +94,6 @@ class AccTreeNode
|
||||
return mxComponent;
|
||||
}
|
||||
|
||||
public XAccessibleExtendedComponent getExtendedComponent ()
|
||||
{
|
||||
if (mxComponent == null)
|
||||
getComponent();
|
||||
if (mxComponent != null)
|
||||
return UnoRuntime.queryInterface(
|
||||
XAccessibleExtendedComponent.class, mxComponent);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public XAccessibleText getText ()
|
||||
{
|
||||
if (mxText == null && mxContext != null)
|
||||
@@ -136,14 +117,6 @@ class AccTreeNode
|
||||
}
|
||||
|
||||
|
||||
public XAccessible getAccessible()
|
||||
{
|
||||
if ((mxAccessible == null) && (mxContext != null))
|
||||
mxAccessible = UnoRuntime.queryInterface(
|
||||
XAccessible.class, mxContext);
|
||||
return mxAccessible;
|
||||
}
|
||||
|
||||
public XAccessibleSelection getSelection ()
|
||||
{
|
||||
return UnoRuntime.queryInterface(
|
||||
@@ -348,16 +321,6 @@ class AccTreeNode
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Update the specified handlers.
|
||||
@return
|
||||
The returned array contains the indices of the updated children
|
||||
and can be used to create a TreeModelEvent.
|
||||
*/
|
||||
public java.util.List<Integer> updateChildren (java.lang.Class class1)
|
||||
{
|
||||
return updateChildren (class1, null);
|
||||
}
|
||||
|
||||
public java.util.List<Integer> updateChildren (java.lang.Class class1, java.lang.Class<AccessibleExtendedComponentHandler> class2)
|
||||
{
|
||||
ArrayList<Integer> aChildIndices = new ArrayList<Integer>();
|
||||
|
||||
@@ -204,11 +204,6 @@ public class AccessibilityTree
|
||||
|
||||
|
||||
|
||||
public void disposing (com.sun.star.lang.EventObject e)
|
||||
{
|
||||
System.out.println ("disposing " + e);
|
||||
}
|
||||
|
||||
/*
|
||||
public Dimension getPreferredSize ()
|
||||
{
|
||||
|
||||
@@ -71,21 +71,6 @@ public class AccessibilityTreeModel
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** Inform all listeners (especially the renderer) of a change of the
|
||||
tree's structure.
|
||||
@param aNode This node specifies the sub tree in which all changes
|
||||
take place.
|
||||
*/
|
||||
public void FireTreeStructureChanged (AccessibleTreeNode aNode)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public synchronized void setRoot (AccessibleTreeNode aRoot)
|
||||
{
|
||||
@@ -339,12 +324,6 @@ public class AccessibilityTreeModel
|
||||
}
|
||||
}
|
||||
|
||||
protected TreeModelEvent createEvent (XAccessibleContext xParent)
|
||||
{
|
||||
AccessibleTreeNode aParentNode = maNodeMap.GetNode (xParent);
|
||||
return new TreeModelEvent (this, createPath (aParentNode));
|
||||
}
|
||||
|
||||
/** Create a TreeModelEvent object that informs listeners that one child
|
||||
has been removed from or inserted into its parent.
|
||||
*/
|
||||
|
||||
@@ -53,12 +53,6 @@ class AccessibleCellHandler extends NodeHandler
|
||||
maChildList.setSize (8);
|
||||
}
|
||||
|
||||
protected static XAccessibleTable getTable(Object aObject)
|
||||
{
|
||||
return UnoRuntime.queryInterface (
|
||||
XAccessibleTable.class, aObject);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccessibleTreeNode createChild (AccessibleTreeNode aParent, int nIndex)
|
||||
{
|
||||
|
||||
@@ -24,8 +24,6 @@ import tools.NameProvider;
|
||||
class AccessibleContextHandler
|
||||
extends NodeHandler
|
||||
{
|
||||
protected int nChildrenCount;
|
||||
|
||||
@Override
|
||||
public NodeHandler createHandler (XAccessibleContext xContext)
|
||||
{
|
||||
|
||||
@@ -45,12 +45,6 @@ class AccessibleEditableTextHandler extends NodeHandler
|
||||
maChildList.setSize (1);
|
||||
}
|
||||
|
||||
protected static XAccessibleEditableText getEText (AccTreeNode aNode)
|
||||
{
|
||||
return UnoRuntime.queryInterface (
|
||||
XAccessibleEditableText.class, aNode.getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccessibleTreeNode createChild (AccessibleTreeNode aParent, int nIndex)
|
||||
{
|
||||
|
||||
@@ -45,14 +45,6 @@ class AccessibleHyperlinkHandler extends AccessibleTreeHandler
|
||||
maChildList.setSize (1);
|
||||
}
|
||||
|
||||
protected XAccessibleHyperlink getHyperlink(Object aObject)
|
||||
{
|
||||
XAccessibleHyperlink xHyperlink =
|
||||
UnoRuntime.queryInterface (
|
||||
XAccessibleHyperlink.class, aObject);
|
||||
return xHyperlink;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccessibleTreeNode getChild (AccessibleTreeNode aParent, int nIndex)
|
||||
{
|
||||
|
||||
@@ -45,14 +45,6 @@ class AccessibleHypertextHandler extends AccessibleTreeHandler
|
||||
maChildList.setSize (1);
|
||||
}
|
||||
|
||||
protected static XAccessibleHypertext getHypertext (AccTreeNode aNode)
|
||||
{
|
||||
XAccessibleHypertext xHypertext =
|
||||
UnoRuntime.queryInterface (
|
||||
XAccessibleHypertext.class, aNode.getContext());
|
||||
return xHypertext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccessibleTreeNode getChild (AccessibleTreeNode aParent, int nIndex)
|
||||
{
|
||||
|
||||
@@ -45,12 +45,6 @@ class AccessibleTableHandler extends NodeHandler
|
||||
maChildList.setSize (4);
|
||||
}
|
||||
|
||||
protected static XAccessibleTable getTable(Object aObject)
|
||||
{
|
||||
return UnoRuntime.queryInterface (
|
||||
XAccessibleTable.class, aObject);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccessibleTreeNode createChild (AccessibleTreeNode aParent, int nIndex)
|
||||
{
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* 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 .
|
||||
*/
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.JTree;
|
||||
import javax.swing.tree.DefaultTreeCellRenderer;
|
||||
import javax.swing.tree.TreePath;
|
||||
|
||||
|
||||
public class AccessibleTreeCellRenderer
|
||||
extends DefaultTreeCellRenderer
|
||||
{
|
||||
private Color
|
||||
maDefaultColor,
|
||||
maChangedColor;
|
||||
private ArrayList<Boolean>
|
||||
maChangedLines;
|
||||
|
||||
|
||||
|
||||
public AccessibleTreeCellRenderer ()
|
||||
{
|
||||
maDefaultColor = Color.black;
|
||||
maChangedColor = Color.red;
|
||||
maChangedLines = new ArrayList<Boolean> ();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component getTreeCellRendererComponent (
|
||||
JTree tree,
|
||||
Object value,
|
||||
boolean sel,
|
||||
boolean expanded,
|
||||
boolean leaf,
|
||||
int row,
|
||||
boolean hasFocus)
|
||||
{
|
||||
super.getTreeCellRendererComponent(
|
||||
tree, value, sel,
|
||||
expanded, leaf, row,
|
||||
hasFocus);
|
||||
|
||||
if (maChangedLines.size()<=row || maChangedLines.get (row) == null)
|
||||
setTextNonSelectionColor (maDefaultColor);
|
||||
else
|
||||
setTextNonSelectionColor (maChangedColor);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Tell the cell renderer that no changes shall be displayed anymore.
|
||||
*/
|
||||
public void clearAllChanges ()
|
||||
{
|
||||
maChangedLines.clear();
|
||||
}
|
||||
|
||||
/** Inform the cell renderer of a new changed line which to paint
|
||||
highlighted when asked to paint it the next time.
|
||||
*/
|
||||
private void addChangedLine (int nRow)
|
||||
{
|
||||
while (maChangedLines.size() <= nRow) {
|
||||
maChangedLines.add(null);
|
||||
}
|
||||
nRow -= 1; // row index is one to large for some reason.
|
||||
maChangedLines.set (nRow, true);
|
||||
}
|
||||
|
||||
/** Inform the cell renderer of a set of changed line which to paint
|
||||
highlighted when asked to paint them the next time.
|
||||
@param aChangedNodes
|
||||
The set of changed nodes. Each entry is a TreePath.
|
||||
@param aTree
|
||||
The JTree that is used to transform the given TreePath objects
|
||||
into rows.
|
||||
*/
|
||||
public void addChangedNodes (List<TreePath> aChangedNodes, JTree aTree)
|
||||
{
|
||||
for (int i=0; i<aChangedNodes.size(); i++)
|
||||
{
|
||||
TreePath aPath = aChangedNodes.get (i);
|
||||
int nRow = aTree.getRowForPath (aPath);
|
||||
addChangedLine (nRow);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,11 +47,6 @@ class AccessibleTreeNode
|
||||
return maParent;
|
||||
}
|
||||
|
||||
public Object getDisplayObject ()
|
||||
{
|
||||
return maDisplayObject;
|
||||
}
|
||||
|
||||
public int getChildCount ()
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -43,7 +43,6 @@ class CanvasShape
|
||||
maSize = new Dimension (10,10);
|
||||
maFgColor = java.awt.Color.black;
|
||||
maBgColor = Color.blue;
|
||||
mnRole = -1;
|
||||
mbHighlighted = false;
|
||||
mbSelected = false;
|
||||
mbFocused = false;
|
||||
@@ -62,7 +61,6 @@ class CanvasShape
|
||||
{
|
||||
msName = mxContext.getAccessibleName();
|
||||
msDescription = mxContext.getAccessibleDescription();
|
||||
mnRole = mxContext.getAccessibleRole();
|
||||
|
||||
// Extract the selected and focused flag.
|
||||
XAccessibleStateSet xStateSet = mxContext.getAccessibleStateSet ();
|
||||
@@ -257,41 +255,16 @@ class CanvasShape
|
||||
mbHighlighted = false;
|
||||
}
|
||||
|
||||
public boolean isHighlighted ()
|
||||
{
|
||||
return mbHighlighted;
|
||||
}
|
||||
|
||||
public Rectangle getBBox ()
|
||||
{
|
||||
return new Rectangle (maPosition, maSize);
|
||||
}
|
||||
|
||||
public Point getOrigin ()
|
||||
{
|
||||
return maPosition;
|
||||
}
|
||||
|
||||
public TreePath getPath ()
|
||||
{
|
||||
return new TreePath (maNode.createPath());
|
||||
}
|
||||
|
||||
public int getRole ()
|
||||
{
|
||||
return mnRole;
|
||||
}
|
||||
|
||||
public XAccessibleContext getContext ()
|
||||
{
|
||||
return mxContext;
|
||||
}
|
||||
|
||||
public XAccessibleComponent getComponent ()
|
||||
{
|
||||
return mxComponent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString ()
|
||||
{
|
||||
@@ -314,5 +287,4 @@ class CanvasShape
|
||||
mbSelected,
|
||||
// Set when the accessible object is focused.
|
||||
mbFocused;
|
||||
private int mnRole;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user