else { for ( int iBS = 1; iBS < iBaseSeriesCount; iBS++ ) { uiManager.addCollectionInstance( BASE_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITHOUT_AXES ); } }
	private void initialize( Chart chartModel, IUIManager uiManager )	{		// Register sheet collections		uiManager.registerSheetCollection( BASE_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITH_AXES,				BASE_SERIES_SHEETS_FOR_CHARTS_WITH_AXES );		uiManager.registerSheetCollection( ORTHOGONAL_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITH_AXES,				ORTHOGONAL_SERIES_SHEETS_FOR_CHARTS_WITH_AXES );		uiManager.registerSheetCollection( BASE_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITHOUT_AXES,				BASE_SERIES_SHEETS_FOR_CHARTS_WITHOUT_AXES );		uiManager.registerSheetCollection( ORTHOGONAL_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITHOUT_AXES,				ORTHOGONAL_SERIES_SHEETS_FOR_CHARTS_WITHOUT_AXES );		uiManager.registerSheetCollection( BASE_AXIS_SHEET_COLLECTION,				BASE_AXIS_SHEETS );		uiManager.registerSheetCollection( ORTHOGONAL_AXIS_SHEET_COLLECTION,				ORTHOGONAL_AXIS_SHEETS );		uiManager.registerSheetCollection( ANCILLARY_AXIS_SHEET_COLLECTION,				ANCILLARY_AXIS_SHEETS );		if ( chartModel instanceof ChartWithAxes )		{			iBaseAxisCount = ( (ChartWithAxes) chartModel ).getAxes( ).size( );			iOrthogonalAxisCount = 0;			iAncillaryAxisCount = 0;			iBaseSeriesCount = 0;			iOrthogonalSeriesCount = 0;			for ( int i = 0; i < iBaseAxisCount; i++ )			{				iBaseSeriesCount += ( (Axis) ( (ChartWithAxes) chartModel ).getAxes( )						.get( i ) ).getSeriesDefinitions( ).size( );				iOrthogonalAxisCount += ( (Axis) ( (ChartWithAxes) chartModel ).getAxes( )						.get( i ) ).getAssociatedAxes( ).size( );				if ( chartModel.getDimension( ).getValue( ) == ChartDimension.THREE_DIMENSIONAL )				{					iAncillaryAxisCount += ( (Axis) ( (ChartWithAxes) chartModel ).getAxes( )							.get( i ) ).getAncillaryAxes( ).size( );				}				for ( int iS = 0; iS < iOrthogonalAxisCount; iS++ )				{					iOrthogonalSeriesCount += ( (Axis) ( (Axis) ( (ChartWithAxes) chartModel ).getAxes( )							.get( i ) ).getAssociatedAxes( ).get( iS ) ).getSeriesDefinitions( )							.size( );				}			}			// Start from 1 because there will always be at least 1 entry for			// each registered sheet when this method is called			for ( int iBA = 1; iBA < iBaseAxisCount; iBA++ )			{				uiManager.addCollectionInstance( BASE_AXIS_SHEET_COLLECTION );			}			for ( int iOA = 1; iOA < iOrthogonalAxisCount; iOA++ )			{				uiManager.addCollectionInstance( ORTHOGONAL_AXIS_SHEET_COLLECTION );			}			// Remove Z axis by default			uiManager.removeCollectionInstance( ANCILLARY_AXIS_SHEET_COLLECTION );			// Must start from 0 because default is 0			for ( int iOA = 0; iOA < iAncillaryAxisCount; iOA++ )			{				uiManager.addCollectionInstance( ANCILLARY_AXIS_SHEET_COLLECTION );			}			// Remove series sheets (for charts with axes) since they are not			// needed for Charts Without Axes			uiManager.removeCollectionInstance( BASE_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITHOUT_AXES );			uiManager.removeCollectionInstance( ORTHOGONAL_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITHOUT_AXES );			for ( int iBS = 1; iBS < iBaseSeriesCount; iBS++ )			{				uiManager.addCollectionInstance( BASE_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITH_AXES );			}			for ( int iOS = 1; iOS < iOrthogonalSeriesCount; iOS++ )			{				uiManager.addCollectionInstance( ORTHOGONAL_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITH_AXES );			}		}		else		{			iBaseAxisCount = 0;			iOrthogonalAxisCount = 0;			iBaseSeriesCount = ( (ChartWithoutAxes) chartModel ).getSeriesDefinitions( )					.size( );			iOrthogonalSeriesCount = 0;			for ( int iS = 0; iS < iBaseSeriesCount; iS++ )			{				iOrthogonalSeriesCount += ( (SeriesDefinition) ( (ChartWithoutAxes) chartModel ).getSeriesDefinitions( )						.get( iS ) ).getSeriesDefinitions( ).size( );			}			// Remove axis sheets since they are not needed for Charts Without			// Axes			uiManager.removeCollectionInstance( ANCILLARY_AXIS_SHEET_COLLECTION );			uiManager.removeCollectionInstance( ORTHOGONAL_AXIS_SHEET_COLLECTION );			uiManager.removeCollectionInstance( BASE_AXIS_SHEET_COLLECTION );			// Remove series sheets (for charts with axes) since they are not			// needed for Charts Without Axes			uiManager.removeCollectionInstance( BASE_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITH_AXES );			uiManager.removeCollectionInstance( ORTHOGONAL_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITH_AXES );			if ( chartModel instanceof DialChart )			{				uiManager.removeCollectionInstance( BASE_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITHOUT_AXES );			}			else			{				for ( int iBS = 1; iBS < iBaseSeriesCount; iBS++ )				{					uiManager.addCollectionInstance( BASE_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITHOUT_AXES );				}			}			for ( int iOS = 1; iOS < iOrthogonalSeriesCount; iOS++ )			{				uiManager.addCollectionInstance( ORTHOGONAL_SERIES_SHEET_COLLECTION_FOR_CHARTS_WITHOUT_AXES );			}		}	}