public void export ( Graph pGraph , Schema pSchema , DotWriter pDotWriter , boolean pOutRefsOnly ) { pDotWriter . printHeaderStart ( pGraph . getStyleForGraph ( ) ) ; if ( pGraph . isCollapseSubgraphs ( ) ) { _writeSubgraphRecursiveCollapsed ( pGraph , pSchema , pDotWriter , pOutRefsOnly ) ; List < Graph > lEndGraphs = _getEndGraphListRecursive ( pGraph ) ; List < GraphAssociation > lGraphAssociations = new ArrayList < GraphAssociation > ( ) ; for ( Graph lGraphFrom : lEndGraphs ) { for ( Graph lGraphTo : lEndGraphs ) { GraphAssociation lGraphAssociation = new GraphAssociation ( ) ; lGraphAssociation . _graphFrom = lGraphFrom ; lGraphAssociation . _graphTo = lGraphTo ; for ( Table lTableFrom : pSchema . getTables ( ) ) { if ( lGraphFrom . containsTableRecursive ( lTableFrom ) ) { for ( Table lTableTo : pSchema . getTables ( ) ) { if ( lGraphTo . containsTableRecursive ( lTableTo ) ) { for ( Association lAssociation : pSchema . getAssociations ( ) ) { if ( lAssociation . getTableFrom ( ) == lTableFrom && lAssociation . getTableTo ( ) == lTableTo ) { lGraphAssociation . _countTableFks += 1 ; } } } } } } if ( lGraphAssociation . _countTableFks > 0 ) { lGraphAssociations . add ( lGraphAssociation ) ; } } } for ( GraphAssociation lGraphAssociation : _filterGraphAssociations ( lGraphAssociations ) ) { _printGraphAssociation ( lGraphAssociation , pDotWriter ) ; } } else { List < Association > lExtraAssociations = new ArrayList < Association > ( ) ; boolean lOtherTablesFound = false ; for ( Table lTable : pSchema . getTables ( ) ) { if ( ! pGraph . containsTableRecursive ( lTable ) ) { List < Association > lVisibleAssociation = pGraph . getVisibleAssociation ( lTable , pSchema , pOutRefsOnly ) ; if ( ! lVisibleAssociation . isEmpty ( ) ) { lExtraAssociations . addAll ( lVisibleAssociation ) ; lOtherTablesFound = true ; _printTable ( lTable , pDotWriter , lVisibleAssociation , pOutRefsOnly , pGraph . getStyleForTable ( lTable ) ) ; } } } _writeSubgraphRecursive ( pGraph , pSchema , pDotWriter , pOutRefsOnly , new ArrayList < Table > ( ) , lOtherTablesFound , pGraph . isRenderClusterForSubgraphs ( ) ) ; for ( Association lAssociation : pSchema . getAssociations ( ) ) { if ( lExtraAssociations . contains ( lAssociation ) || ( pGraph . allAssociations ( ) && ( pGraph . containsTableRecursive ( lAssociation . getTableFrom ( ) ) || ( ! pOutRefsOnly && pGraph . containsTableRecursive ( lAssociation . getTableTo ( ) ) ) ) ) ) { _printAssociation ( lAssociation , pDotWriter , pGraph ) ; } } } pDotWriter . printHeaderEnd ( ) ; }
Creates a dot File for the Schema .