// Example DataPilot source component // helper class to hold the settings class ExampleSettings { static public final int nDimensionCount = 6; static public final int nValueDimension = 4; static public final int nDataDimension = 5; static public final String [] aDimensionNames = { "ones", "tens", "hundreds", "thousands", "value", "" }; static public final String getMemberName( int nMember ) { return String.valueOf( nMember ); } public int nMemberCount = 3; public java.util.List aColDimensions = new java.util.ArrayList(); public java.util.List aRowDimensions = new java.util.ArrayList(); } // XPropertySetInfo implementation for getPropertySetInfo class ExamplePropertySetInfo implements com.sun.star.beans.XPropertySetInfo { private com.sun.star.beans.Property[] aProperties; public ExamplePropertySetInfo( com.sun.star.beans.Property[] aProps ) { aProperties = aProps; } public com.sun.star.beans.Property[] getProperties() { return aProperties; } public com.sun.star.beans.Property getPropertyByName( String aName ) throws com.sun.star.beans.UnknownPropertyException { for ( int i=0; i= 0 ) nDimensions = aSettings.aColDimensions.size(); else { nPosition = aSettings.aRowDimensions.indexOf( new Integer(nDimension) ); if ( nPosition >= 0 ) nDimensions = aSettings.aRowDimensions.size(); } if ( nPosition < 0 ) return new com.sun.star.sheet.MemberResult[0]; int nMembers = aSettings.nMemberCount; int nRepeat = 1; int nFill = 1; for ( int i=0; i nPosition ) nFill *= nMembers; } int nSize = nRepeat * nMembers * nFill; com.sun.star.sheet.MemberResult[] aResults = new com.sun.star.sheet.MemberResult[nSize]; int nResultPos = 0; for (int nOuter=0; nOuter= 1 ) { String aSource = (String) aArguments[0]; if ( aSource != null ) { try { int nValue = Integer.parseInt( aSource ); if ( nValue >= 2 && nValue <= 10 ) aSettings.nMemberCount = nValue; } catch ( NumberFormatException e ) { System.out.println( "Error: caught exception in " + "ExampleDataPilotSource.initialize!\nException Message = " + e.getMessage()); e.printStackTrace(); } } } } // XDataPilotResults public com.sun.star.sheet.DataResult[][] getResults() { int[] nDigits = new int[ExampleSettings.nDimensionCount]; int nValue = 1; for (int i=0; i