src/main/java/ca/phon/plugins/praat/TextGridTierMapper.java
/**
	 * Create a {@link TreeModel} for selecting a new tier mapping given
	 * a {@link Session} and {@link TextGrid}
	 * 
	 * @param session
	 * @param textGrid
	 * @return treeModel
	 */
Create a  TreeModel for selecting a new tier mapping given
a  Session and  TextGrid

@param session
@param textGrid
@return treeModel
Create a TreeModel for selecting a new tier mapping given a Session and TextGrid @param session @param textGrid @return treeModel
public TreeModel createTreeModel() {
		final List<TierViewItem> tierOrder = session.getTierView();
		final DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(session.getCorpus() + "." + session.getName());
		for(TierViewItem tierView:tierOrder) {
			if(!tierView.isVisible()) continue;
			final String tierName = tierView.getTierName();
			final SystemTierType systemTier = SystemTierType.tierFromString(tierName);
			final DefaultMutableTreeNode tierNode = new DefaultMutableTreeNode(tierName);
			for(Segmentation type:Segmentation.values()) {
				if(type == Segmentation.SYLLABLE || type == Segmentation.PHONE) {
					final boolean isIPA =
							(systemTier == SystemTierType.IPATarget) || (systemTier == SystemTierType.IPAActual);
					if(!isIPA) continue;
				}
				final String name = tierName + ": " + type.toString();
				if(TextGridUtils.tierNumberFromName(textGrid, name) > 0) {
					continue;
				}
				final DefaultMutableTreeNode typeNode = new DefaultMutableTreeNode(type);
				tierNode.add(typeNode);
			}
			if(tierNode.getChildCount() > 0)
				rootNode.add(tierNode);
		}
		return new DefaultTreeModel(rootNode);
	}
public TreeModel createTreeModel ( ) { final List < TierViewItem > tierOrder = session . getTierView ( ) ; final DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode ( session . getCorpus ( ) + "." + session . getName ( ) ) ; for ( TierViewItem tierView : tierOrder ) { if ( ! tierView . isVisible ( ) ) continue ; final String tierName = tierView . getTierName ( ) ; final SystemTierType systemTier = SystemTierType . tierFromString ( tierName ) ; final DefaultMutableTreeNode tierNode = new DefaultMutableTreeNode ( tierName ) ; for ( Segmentation type : Segmentation . values ( ) ) { if ( type == Segmentation . SYLLABLE || type == Segmentation . PHONE ) { final boolean isIPA = ( systemTier == SystemTierType . IPATarget ) || ( systemTier == SystemTierType . IPAActual ) ; if ( ! isIPA ) continue ; } final String name = tierName + ": " + type . toString ( ) ; if ( TextGridUtils . tierNumberFromName ( textGrid , name ) > 0 ) { continue ; } final DefaultMutableTreeNode typeNode = new DefaultMutableTreeNode ( type ) ; tierNode . add ( typeNode ) ; } if ( tierNode . getChildCount ( ) > 0 ) rootNode . add ( tierNode ) ; } return new DefaultTreeModel ( rootNode ) ; }
Create a {@link TreeModel} for selecting a new tier mapping given
 a {@link Session} and {@link TextGrid}
Create a { @link TreeModel } for selecting a new tier mapping given a { @link Session } and { @link TextGrid }