);
		IFigure walker = fig.getParent( );
		while ( !figBounds.isEmpty( ) && walker != null )
		{
			walker.translateToParent( figBounds );
			figBounds.intersect( walker.getBounds( ) );
			walker = walker.getParent( );
		}
		return !figBounds.isEmpty( );
	}

	private boolean isGraphicalViewer( )
	{
		return getCurrentViewer( ) instanceof GraphicalViewer;
	}

	private void performMarqueeSelect( )
	{
		EditPartViewer viewer = getCurrentViewer( );

		List newSelections = calculateNewSelection( );

		// If in multi select mode, add the new selections to the already
		// selected group; otherwise, clear the selection and select the new
		// group
		if ( getSelectionMode( ) == APPEND_MODE )
		{
			for ( int i = 0; i < newSelections.size( ); i++ )
			{
				EditPart editPart = (EditPart) newSelections.get( i );
				viewer.appendSelection( editPart );
			}
		}
		else if ( getSelectionMode( ) == TOGGLE_MODE )
		{
			List selected = new ArrayList( viewer.getSelectedEditParts( ) );
			for ( int i = 0; i < newSelections.size( ); i++ )
			{
				EditPart editPart = (EditPart) newSelections.get( i );
				if ( editPart.getSelected( ) != EditPart.SELECTED_NONE )
					selected.remove( editPart );
				else
					selected.add( editPart );
			}
			viewer.setSelection( new StructuredSelection( selected ) );
		}
		else
		{
			viewer.setSelection( new StructuredSelection( newSelections ) );
		}
	}

	/**
	 * @see org.eclipse.gef.Tool#setViewer(org.eclipse.gef.EditPartViewer)
	 */
	public void setViewer( EditPartViewer viewer )
	{
		if ( viewer == getCurrentViewer( ) )
			return;
		super.setViewer( viewer );
		if ( viewer instanceof GraphicalViewer )
			setDefaultCursor( SharedCursors.CROSS );
		else
			setDefaultCursor( SharedCursors.NO );
	}

	private void setSelectionMode( int mode )
	{
		this.mode = mode;
	}

	private void showMarqueeFeedback( )
	{
		Rectangle rect = getMarqueeSelectionRectangle( ).getCopy( );
		getMarqueeFeedbackFigure( ).translateToRelative( rect );
		getMarqueeFeedbackFigure( ).setBounds( rect );
	}

	private void sho